Merge pull request #18 from LCTT/master

Update Repo
This commit is contained in:
joeren 2015-06-23 09:35:35 +08:00
commit a0e3d83586
29 changed files with 1870 additions and 1460 deletions

View File

@ -194,7 +194,7 @@ mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。
DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s"
上面一行的%s代表了由mod\_evasive检测到的攻击IP地址。
上面一行的%s代表了由mod_evasive检测到的攻击IP地址。
#####将apache用户添加到sudoers文件#####
@ -233,7 +233,7 @@ mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。
我们的测试环境由一个CentOS 7服务器[IP 192.168.0.17]和一个Windows组成在Windows[IP 192.168.0.103]上我们发起攻击:
![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png)
I
*确认主机IP地址*
请播放下面的视频YT 视频,请自备梯子: https://www.youtube.com/-U_mdet06Jk 并跟从列出的步骤来模拟一个Dos攻击
@ -257,7 +257,7 @@ mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/protect-apache-using-mod\_security-and-mod\_evasive-on-rhel-centos-fedora/
via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/
作者:[Gabriel Cánepa][a]
译者:[wwy-hust](https://github.com/wwy-hust)

View File

@ -1,37 +1,37 @@
在 Debian, Ubuntu, Linux Mint 及 Fedora 中安装 uGet 下载管理器 2.0
================================================================================
在经历了一段漫长的开发期后,期间发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横中的 uGet RSS 信息提供了更好的支持,其他特点包括:
在经历了一段漫长的开发期后,发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横中的 uGet RSS 信息提供了更好的支持,其他特点包括:
- 一个新的 “检查更新” 按钮,提醒您有关新的发行版本的信息;
- 新增一个 “检查更新” 按钮,提醒您有关新的发行版本的信息;
- 增添新的语言支持并升级了现有的语言;
- 增加了一个新的 “信息横栏” ,允许开发者轻松地向所有的用户提供有关 uGet 的信息;
- 通过对文档、提交反馈和错误报告等内容的链接,增强了帮助菜单;
- 新增一个 “信息横幅” ,可以让开发者轻松地向所有的用户提供有关 uGet 的信息;
- 增强了帮助菜单,包括文档、提交反馈和错误报告等内容的链接;
- 将 uGet 下载管理器集成到了 Linux 平台下的两个主要的浏览器 Firefox 和 Google Chrome 中;
- 改进了对 Firefox 插件 FlashGot 的支持;
### 何为 uGet ###
uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了一大类的功能,如恢复先前的下载任务,支持多重下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。
uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了大量功能,如恢复先前的下载任务,支持多点下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。
我已经在下面罗列出了 uGet 下载管理器的所有关键特点,并附带了详细的解释。
#### uGet 下载管理器的关键特点 ####
- 下载队列: 可以将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件;
- 下载队列: 将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件;
- 恢复下载: 假如在某些情况下,你的网络中断了,不要担心,你可以从先前停止的地方继续下载或重新开始;
- 下载分类: 支持多种分类来管理下载;
- 剪贴板监视: 将要下载的文件类型复制到剪贴板中,便会自动弹出下载提示框以下载刚才复制的文件;
- 批量下载: 允许你轻松地一次性下载多个文件;
- 支持多种协议: 允许你轻松地使用 aria2 命令行插件通过 HTTP, HTTPS, FTP, BitTorrent 及 Metalink 等协议下载文件;
- 多连接: 使用 aria2 插件,每个下载同时支持多达 20 个连接;
- 支持 FTP 登录或匿名 FTP 登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP
- 支持 FTP 登录或 FTP 匿名登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP
- 队列下载: 新增队列下载,现在你可以对你的所有下载进行安排调度;
- 通过 FlashGot 与 FireFox 集成: 与作为一个独立支持的 Firefox 插件的 FlashGot 集成,从而可以处理单个或大量的下载任务;
- CLI 界面或虚拟终端支持: 提供命令行或虚拟终端选项来下载文件;
- 自动创建目录: 假如你提供了一个先前并不存在的保存路径uGet 将会自动创建这个目录;
- 下载历史管理: 跟踪记录已下载和已删除的下载任务的条目,每个列表支持 9999 个条目,比当前默认支持条目数目更早的条目将会被自动删除;
- 多语言支持: uGet 默认使用英语,但它可支持多达 23 种语言;
- Aria2 插件: uGet 集成了 Aria2 插件,来为 aria2 提供更友好的 GUI 界面;
- Aria2 插件: uGet 集成了 Aria2 插件,来为提供更友好的 GUI 界面;
如若你想了解更加完整的特点描述,请访问 uGet 官方的 [特点页面][1].
@ -43,7 +43,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最
#### 在 Debian 下 ####
在 Debian 的测试版本 (Jessie)不稳定版本 (Sid) 中,你可以在一个可信赖的基础上,使用官方软件仓库轻易地安装和升级 uGet 。
在 Debian Jessie 和Sid 中,你可以使用官方软件仓库轻易地安装和升级可靠的 uGet 软件包
$ sudo apt-get update
$ sudo apt-get install uget
@ -58,7 +58,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最
#### 在 Fedora 下 ####
在 Fedora 20 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得,从这些软件仓库中安装是非常值得信赖的
在 Fedora 20 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得可靠的软件包
$ sudo yum install uget
@ -70,7 +70,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最
默认情况下uGet 在当今大多数的 Linux 系统中使用 `curl` 来作为后端,但 aria2 插件将 curl 替换为 aria2 来作为 uGet 的后端。
aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。
aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。
#### 在 Debian, Ubuntu 和 Linux Mint 下 ####
@ -91,28 +91,34 @@ Fedora 的官方软件仓库中已经添加了 aria2 软件包,所以你可以
为了启动 uGet从桌面菜单的搜索栏中键入 "uGet"。可参考如下的截图:
![开启 uGet 下载管理器](http://www.tecmint.com/wp-content/uploads/2014/03/Start-uGet.gif)
开启 uGet 下载管理器
*开启 uGet 下载管理器*
![uGet 版本: 2.0](http://www.tecmint.com/wp-content/uploads/2014/03/uGet-Version.gif)
uGet 版本: 2.0
*uGet 版本: 2.0*
#### 在 uGet 中激活 aria2 插件 ####
为了激活 aria2 插件, 从 uGet 菜单接着到 `编辑 > 设置 > 插件` , 从下拉菜单中选择 "aria2"。
![为 uGet 启用 Aria2 插件](http://www.tecmint.com/wp-content/uploads/2014/03/Enable-Aria2-Plugin.gif)
为 uGet 启用 Aria2 插件
*为 uGet 启用 Aria2 插件*
### uGet 2.0 截图赏析 ###
![使用 Aria2 下载文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Files-Using-Aria2.gif)
使用 Aria2 下载文件
*使用 Aria2 下载文件*
![使用 uGet 下载 Torrent 文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Torrent-File.gif)
使用 uGet 下载 Torrent 文件
*使用 uGet 下载 Torrent 文件*
![使用 uGet 进行批量下载](http://www.tecmint.com/wp-content/uploads/2014/03/Batch-Download-Files.gif)
使用 uGet 进行批量下载
*使用 uGet 进行批量下载*
针对其他 Linux 发行版本和 Windows 平台的 RPM 包和 uGet 的源文件都可以在 uGet 的[下载页面][5] 下找到。
@ -122,7 +128,7 @@ via: http://www.tecmint.com/install-uget-download-manager-in-linux/
作者:[Ravi Saive][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,9 +1,6 @@
translated by strugglingyouth
在linux上使用交换文件扩展交换空间
================================================================================
想像一种情景当我们的Linux系统用尽交换空间时在这种情况下
我们想要使用swap分区扩展交换空间但在某些情况下磁盘上的空闲分区是不可用的
致使我们不能把它扩大。
想像一种情景当我们的Linux系统用尽交换空间时在这种情况下我们想要使用swap分区扩展交换空间但在某些情况下磁盘上已经没有可用的空闲分区了致使我们不能把它扩大。
因此在这种情况下我们可以使用交换文件增加swap空间。
@ -16,7 +13,7 @@ free-output-with-swap
我的交换分区大小是2 GB我们将把交换空间扩展1GB。
#### 第一步使用下面的dd命令创建大小为1GB交换文件d ####
#### 第一步使用下面的dd命令创建大小为1GB交换文件 ####
[root@linuxtechi ~]# dd if=/dev/zero of=/swap_file bs=1G count=1
1+0 records in
@ -26,7 +23,7 @@ free-output-with-swap
根据你的需要替换 **bs****count** 的大小.
####第二步设置交换文件权限为644. ####
#### 第二步设置交换文件权限为600 ####
[root@linuxtechi ~]# chmod 600 /swap_file
@ -56,21 +53,20 @@ free-output-with-swap
![swap-space-after-extension](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-space-after-extension.jpg)
**Note**: 为了避免出现意外的情况如下所示使用swapoff命令关闭它
仅在需要使用时使用步骤5所示的swapon命令重新启用交换文件。.
**Note**: 为了避免出现意外的情况如下所示使用swapoff命令关闭它仅在需要使用时使用步骤5所示的swapon命令重新启用交换文件。
[root@linuxtechi ~]# swapoff /swap_file
[root@linuxtechi ~]#
请分享您的宝贵意见或者评论此文章.
请分享您的宝贵意见或者评论此文章
--------------------------------------------------------------------------------
via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/
作者:[Pradeep Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[strugglingyouth](https://github.com/strugglingyouth)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,133 +1,99 @@
如何在CentOS 7上安装Percona Server
如何在 CentOS 7 上安装 Percona服务器
================================================================================
在这篇文章中我们将了解关于Percona Server一个开源简易的MySQLMariaDB的替代。InnoDB的数据库引擎使得Percona Server非常有吸引力如果你需要的高性能高可靠性和高性价比的解决方案它将是一个很好的选择。
在下文中将介绍在CentOS 7上Percona的服务器的安装以及备份当前数据,配置的步骤和如何恢复备份。
###目录###
1.什么是Percona为什么使用它
2.备份你的数据库
3.删除之前的SQL服务器
4.使用二进制包安装Percona
5.配置Percona
6.保护你的数据
7.恢复你的备份
在这篇文章中我们将了解关于 Percona 服务器一个开源的MySQLMariaDB的替代品。InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。
在下文中将介绍在CentOS 7上Percona 服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。
### 1.什么是Percona为什么使用它 ###
Percona是一个开源简易的MySQLMariaDB数据库的替代它是MYSQL的一个分支相当多的改进和独特的功能使得它比MYSQL更可靠性能更强速度更快它与MYSQL完全兼容你甚至可以在Oracle的MYSQL与Percona之间使用复制命令。
Percona是一个MySQLMariaDB数据库的开源替代品它是MySQL的一个分支相当多的改进和独特的功能使得它比MYSQL更可靠性能更强速度更快它与MYSQL完全兼容你甚至可以在Oracle的MySQL与Percona之间使用复制。
#### 在Percona中独具特色的功能 ####
- 分区适应哈希搜索
- 快速校验算法
- 缓冲池预加载
- 支持FlashCache
-分段自适应哈希搜索
-快速校验算法
-缓冲池预加载
-支持FlashCache
#### MySQL企业版和Percona中的特有功能 ####
#### MySQL企业版和Percona的特定功能 ####
- 从不同的服务器导入表
- PAM认证
- 审计日志
- 线程池
-从不同的服务器导入表
-PAM认证
-审计日志
-线程池
现在你肯定很兴奋地看到这些好的东西整理在一起我们将告诉你如何安装和做些的Percona Server的基本配置。
现在你肯定很兴奋地看到这些好的东西整合在一起我们将告诉你如何安装和对Percona Server做基本配置。
### 2. 备份你的数据库 ###
接下来在命令行下使用SQL命令创建一个mydatabases.sql文件来重建/恢复salesdb和employeedb数据库重命名数据库以便反映你的设置如果没有安装MYSQL跳过此步
接下来在命令行下使用SQL命令创建一个mydatabases.sql文件来重建或恢复salesdb和employeedb数据库根据你的设置替换数据库名称如果没有安装MySQL则跳过此步
mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql
复制当前的配置文件如果你没有安装MYSQL也可跳过
复制当前的配置文件如果你没有安装MYSQL也可跳过
cp my.cnf my.cnf.bkp
### 3.删除之前的SQL服务器 ###
停止MYSQL/MariaDB如果它们还在运行
停止MYSQL/MariaDB如果它们还在运行
systemctl stop mysql.service
卸载MariaDB和MYSQL
卸载MariaDB和MYSQL
yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server
移动重命名在/var/lib/mysql当中的MariaDB文件这比仅仅只是移除更为安全快速这就像2级即时备份。:)
移动重命名放在/var/lib/mysql当中的MariaDB文件。这比仅仅只是移除更为安全快速这就像2级即时备份。:)
mv /var/lib/mysql /var/lib/mysql_mariadb
### 4.使用二进制包安装Percona ###
你可以在众多Percona安装方法中选择在CentOS中使用Yum或者RPM包安装通常是更好的主意所以这些是本文介绍的方式下载源文件编译后安装在本文中并没有介绍。
从Yum仓库中安装
从Yum仓库中安装:
首先你需要设置的Percona的Yum库:
首先你需要设置Percona的Yum库:
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
接下来安装Percona:
yum install Percona-Server-client-56 Percona-Server-server-56
上面的命令安装Percona的服务器和客户端共享库可能需要Perl和Perl模块以及其他依赖的需要。如DBI::MySQL的如果这些尚未安装
使用RPM包安装:
上面的命令安装Percona的服务器和客户端、共享库可能需要Perl和Perl模块以及其他依赖的需要如DBI::MySQL。如果这些尚未安装可能需要安装更多的依赖包。
使用RPM包安装
我们可以使用wget命令下载所有的rpm包:
wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/
wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \
http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/
使用rpm工具一次性安装所有的rpm包
rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \
Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \
Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm
rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm
注意在上面命令语句中最后的反斜杠'\',如果您安装单独的软件包,记住要解决依赖关系,在安装客户端之前要先安装共享包,在安装服务器之前请先安装客户端。
注意在上面命令语句中最后的反斜杠'\'(只是为了换行方便)。如果您安装单独的软件包,记住要解决依赖关系,在安装客户端之前要先安装共享包,在安装服务器之前请先安装客户端。
### 5.配置Percona服务器 ###
#### 恢复之前的配置 ####
当我们从MariaDB迁移过来时你可以将之前的my.cnf的备份文件恢复回来。
cp /etc/my.cnf.bkp /etc/my.cnf
#### 创建一个新的my.cnf文件 ####
如果你需要一个适合你需求的新的配置文件或者你并没有备份配置文件,你可以使用以下方法,通过简单的几步生成新的配置文件。
下面是Percona-server软件包自带的my.cnf文件
# Percona Server template configuration
[mysqld]
@ -158,33 +124,29 @@ Percona是一个开源简易的MySQLMariaDB数据库的替代它是MYSQL
根据你的需要配置好my.cnf后就可以启动该服务了
systemctl restart mysql.service
如果一切顺利的话它已经准备好执行SQL命令了你可以用以下命令检查它是否已经正常启动
mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"'
如果你不能够正常启动它,你可以在**/var/log/mysql/mysqld.log**中查找原因该文件可在my.cnf的[mysql_safe]的log-error中设置。
tail /var/log/mysql/mysqld.log
你也可以在/var/lib/mysql/文件夹下查找格式为[hostname].err的文件就像下面这个例子样
你也可以在/var/lib/mysql/文件夹下查找格式为[主机名].err的文件就像下面这个例子
tail /var/lib/mysql/centos7.err
如果还是没找出原因你可以试试strace
yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe
上面的命令挺长的,输出的结果也相对简单,但绝大多数时候你都能找到无法启动的原因。
### 6.保护你的数据 ###
好了你的关系数据库管理系统已经准备好接收SQL查询但是把你宝贵的数据放在没有最起码安全保护的服务器上并不可取为了更为安全最好使用mysql_secure_instalation这个工具可以帮助删除未使用的默认功能还设置root的密码并限制使用此用户进行访问。
只需要在shell中执行并参照屏幕上的说明。
好了你的关系数据库管理系统已经准备好接收SQL查询但是把你宝贵的数据放在没有最起码安全保护的服务器上并不可取为了更为安全最好使用mysql_secure_install来安装这个工具可以帮助你删除未使用的默认功能并设置root的密码限制使用此用户进行访问。只需要在shell中执行该命令并参照屏幕上的说明操作。
mysql_secure_install
@ -192,28 +154,27 @@ Percona是一个开源简易的MySQLMariaDB数据库的替代它是MYSQL
如果您参照之前的设置现在你可以恢复数据库只需再用mysqldump一次。
mysqldump -u root -p < mydatabases.sql
恭喜你你刚刚已经在你的CentOS上成功安装了Percona你的服务器已经可以正式投入使用你可以像使用MYSQL一样使用它你的服务器与他完全兼容。
恭喜你你刚刚已经在你的CentOS上成功安装了Percona你的服务器已经可以正式投入使用你可以像使用MySQL一样使用它你的服务器与它完全兼容。
### 总结 ###
为了获得更强的性能你需要对配置文件做大量的修改,但这里也有一些简单的选项来提高机器的性能。当使用InnoDB引擎时将innodb_file_per_table设置为on它将在一个文件中为每个表创建索引表这意味着每个表都有它自己的索引文件它使系统更强大和更容易维修。
为了获得更强的性能你需要对配置文件做大量的修改但这里也有一些简单的选项来提高机器的性能。当使用InnoDB引擎时将innodb_file_per_table设置为on它将在一个文件中为每个表创建索引表这意味着每个表都有它自己的索引文件它使系统更强大和更容易维修。
可以修改innodb_buffer_pool_size选项InnoDB应该有足够的缓存池来应对你的数据集大小应该为当前可用内存的70%到80%。
将innodb-flush-method设置为O_DIRECT关闭写入高速缓存如果你使用了RAID这可以提升性能因为在底层已经完成了缓存操作。
将innodb-flush-method设置为O_DIRECT关闭写入高速缓存如果你使用了RAID这可以提升性能因为在底层已经完成了缓存操作。
如果你的数据并不是十分关键并且并不需要对数据库事务正确执行的四个基本要素完全兼容可以将innodb_flush_log_at_trx_commit设置为2这也能提升系统的性能。
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-how-to/percona-server-centos-7/
作者:[Carlos Alberto][a]
译者:[FatJoe123](https://github.com/FatJoe123)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,41 +1,41 @@
安装 Tails 1.4 Linux 操作系统来保护隐私和保持匿名
用 Tails 1.4 Linux 系统来保护隐私和保持匿名
================================================================================
在这个互联网世界和互联网的世界中,我们在线执行我们的大多数任务,无论是订票,汇款,研究,商务,娱乐,社交网络,还是其他。每天我们花费大部分时间在网络上。在每个逝去的日子里,在网络中保持匿名变得越来越难,尤其是在被某些机构例如 NSA (National Security Agency,国安局) 植入后门的情况下,这些机构嗅探着我们在网络中的所有动作。在网络中,我们有着极少,或者说根本就没有隐私。基于用户浏览网络的活动和机器的活动的搜索都被记录了下来。
在这个互联网世界和互联网的世界中,我们在线执行我们的大多数任务,无论是订票,汇款,研究,商务,娱乐,社交网络,还是其它。每天我们花费大部分时间在网络上。在过去这些的日子里,在网络中保持匿名变得越来越难,尤其是在被某些机构例如 NSA (National Security Agency) 植入后门的情况下,他们嗅探着我们在网络中的所有动作。在网络中,我们有着极少,或者说根本就没有隐私。基于用户浏览网络的活动和机器的活动的搜索都被记录了下来。
来自于 Tor 项目的绝妙浏览器正被上百万人使用,它帮助我们匿名地浏览网络,即使这样,跟踪你的浏览习惯也并不难,所以只使用 Tor 并不能保证你的网络安全。你可以从下面的链接中查看 Tor 的特点及安装指南。
来自于 Tor 项目的绝妙浏览器正被上百万人使用,它帮助我们匿名地浏览网络,即使这样,跟踪你的浏览习惯也并不难,所以只使用 Tor 并不能保证你的网络安全。你可以从下面的链接中查看 Tor 的特点及安装指南。
- [使用 Tor 来进行匿名网络浏览][1]
Tor 项目中有一个名为 Tails 的操作系统。Tails (The Amnesic Incognito Live System) 是一个 live 操作系统,基于 Debian Linux 发行版本,主要着眼于在浏览网络时在网络中保护隐私和匿名,这意味着所有的外向连接都强制通过 Tor 来连接,直接的(非匿名的) 连接请求都会被阻挡。该系统被设计为可在任何可启动介质上运行,例如 USB 或 DVD。
Tor 项目中有一个名为 Tails 的操作系统。Tails (The Amnesic Incognito Live System) 是一个 live 操作系统,基于 Debian Linux 发行版本,主要着眼于在浏览网络时在网络中保护隐私和匿名,这意味着所有的外向连接都强制通过 Tor 来连接,直接的(非匿名的) 连接请求都会被阻挡。该系统被设计为可在任何可启动介质上运行,例如 USB 或 DVD。
Tails OS 的最新稳定发行版本为 1.4 于 2015 年 5 月 12 日发行。Tails 由开源单片 Linux 内核支持,构建在 Debian GNU/Linux 之上,着眼于个人电脑市场, 使用 GNOME 3 作为其默认的用户界面。
Tails OS 的最新稳定发行版本为 1.4 于 2015 年 5 月 12 日发行。Tails 由开源的 Linux 宏内核所驱动,构建在 Debian GNU/Linux 之上,着眼于个人电脑市场, 使用 GNOME 3 作为其默认的用户界面。
#### Tails OS 1.4 的特点 ####
- Tails 是一个 free 的操作系统, free 的意义正如 免费(free)啤酒和言论自由(free) 中的 free
- Tails 是一个 free 的操作系统, free 的意义不仅是免费(free)啤酒的免费,也是言论自由(free) 中的自由
- 构建在 Debian/GNU Linux 操作系统之上, Debian 是使用最广泛的通用操作系统
- 着眼于安全的发行版本
- 有 Windows 8 外观作为其伪装
- 伪装成 Windows 8 外观
- 不必安装就可以使用 Live Tails CD/DVD 来匿名浏览网络
- 当 Tails 运行时,不留下任何痕迹
- 当 Tails 运行时,不会在计算机上留下任何痕迹
- 使用先进的加密工具来加密任何相关文件,邮件等内容
- 通过 Tor 网络来发送和接收流量
- 在真正意义上为任何人在任何地方保护隐私
- 在 Live 环境中带有一些可用的应用
- 真正意义地无论何时何处保护隐私
- 在 Live 环境中带有一些立即可用的应用
- 系统自带的所有软件都预先配置好只通过 Tor 网络来连接到互联网
- 任何不通过 Tor 网络而尝试连接网络的应用都将被自动阻拦
- 任何不通过 Tor 网络而尝试连接网络的应用都将被自动阻拦
- 限制那些想查看你正在浏览什么网站的人的行动,并限制网站获取你的地理位置
- 连接到那些被墙或被审查的网站
- 特别设计不使用主操作系统的空间,即使在 swap 空间还有空余的情况下
- 整个操作系统加载在 RAM 中,在每次重启或关机后会自动擦除掉,所以不会留下任何运行的痕迹。
- 特别设计不使用主操作系统的空间,即便是 swap 空间也不用
- 整个操作系统加载在内存中,在每次重启或关机后会自动擦除掉,所以不会留下任何运行的痕迹。
- 先进的安全实现,通过加密 USB 磁盘, HTTPS 应答加密和对邮件,文档进行签名。
#### 在 Tails 1.4 中期待的东西 ####
#### 在 Tails 1.4 中期待的东西 ####
- 带有安全滑块的 Tor 浏览器 4.5
- Tor 被升级到版本 0.2.6.7
- 修补了几个安全漏洞
- 针对诸如 curl, OpenJDK 7, tor Network, openldap 等应用, 许多漏洞被修复并打上了补丁
- 针对诸如 curl、 OpenJDK 7、 tor Network、 openldap 等应用, 许多漏洞被修复并打上了补丁
要得到完整的更改记录,你需要访问 [这里][2]
@ -43,7 +43,7 @@ Tails OS 的最新稳定发行版本为 1.4 于 2015 年 5 月 12 日发行
#### 为什么我应该使用 Tails 操作系统 ####
你需要 Tails 因为你想:
你需要 Tails 因为你想
- 在网络监控下保持自由
- 捍卫自由,隐私和秘密
@ -62,85 +62,96 @@ Tails OS 的最新稳定发行版本为 1.4 于 2015 年 5 月 12 日发行
- [tails-i386-1.4.iso][3]
- [tails-i386-1.4.torrent][4]
2. 下载后,可使用 SHA256SUM 来获取 ISO 文件的哈希值并与官方提供的值相比较,以核实 ISO 文件的完整性
2. 下载后,可使用 sha256sum 来获取 ISO 文件的哈希值并与官方提供的值相比较,以核实 ISO 文件的完整性
$ sha256sum tails-i386-1.4.iso
339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d
假如你熟悉 OpenPGP ,将 Tails 的签名密钥与 Debian 的 keyring 相比较以验证其签名,若想了解任何有关 Tails 的加密签名,请将浏览器指向 [这里][5]
假如你熟悉 OpenPGP ,将 Tails 的签名密钥与 Debian 的 keyring 相比较以验证其签名,若想了解任何有关 Tails 的加密签名,请用浏览器访问 [这里][5]
3. 下一步,你需要将镜像写入 USB 或 DVD ROM 中。或许你需要看看这篇文章 [如何创建一个 Live 可启动的 USB][6] 以了解如何使得一个闪存驱动器变得可启动并向它写入 ISO 镜像文件。
3. 下一步,你需要将镜像写入 USB 或 DVD ROM 中。或许你需要看看这篇文章 “[如何创建一个 Live 可启动的 USB棒][6] ”以了解如何使得一个闪存盘变得可启动并向它写入 ISO 镜像文件。
4. 插入 Tails OS 可启动闪存驱动器或 DVD ROM并从那里启动 (在 BIOS 中选择该介质来启动)。第一个屏幕中会有两个选项 'Live' 和 'Live (failsafe)' 让你选择。选择 'Live' 并确定。
4. 插入 Tails OS 的可启动闪存盘或 DVD ROM并从那里启动 (在 BIOS 中选择该介质来启动)。第一个屏幕中会有两个选项 'Live' 和 'Live (failsafe)' 让你选择。选择 'Live' 并确定。
![Tails 启动菜单](http://www.tecmint.com/wp-content/uploads/2015/05/1.png)
Tails 启动菜单
*Tails 启动菜单*
5. 在登录之前,你有两个选项, 假如你想配置并设定高级选项,点击 '更多选项' 否则点击 'NO'。
![Tails 欢迎界面](http://www.tecmint.com/wp-content/uploads/2015/05/2.png)
Tails 欢迎界面
6. 在点击高级选项后,你需要设置 root 密码。假如你想升级它,这是非常重要的。这个 root 密码将会一直有效,知道你关机或重启。
*Tails 欢迎界面*
另外,若你想开启 Windows 伪装,假如你想在一个公共场所运行这个操作系统,这将使得看起来你正在运行 Windows 8 操作系统。这真是一个好的选项!不是吗?另外,你还有一个选项来配置 网络和 Mac 地址,当一切准备完毕后,点击 '登录'
6. 在点击高级选项后,你需要设置 root 密码。假如你想升级它,这是非常重要的。这个 root 密码的有效期将持续到你关机或重启。
另外,若你想开启 Windows 伪装,假如你想在一个公共场所运行这个操作系统,这将使得看起来你正在运行 Windows 8 操作系统。这真是一个好的选项!不是吗?另外,你还有一个选项来配置网络和 Mac 地址,当一切准备完毕后,点击 '登录'
![Tails OS 的配置](http://www.tecmint.com/wp-content/uploads/2015/05/3.png)
Tails OS 的配置
*Tails OS 的配置*
7. 这是使用 Windows 皮肤伪装的 Tails GNU/Linux OS
![Tails 的 Windows 伪装](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg)
Tails 的 Windows 伪装
8. 系统将在后台启动 Tor 网络。在屏幕的右上角查看通知 Tor 已经准备好了 或现在你已经连接上了互联网。
*Tails 的 Windows 伪装*
你也可以在 Internet 菜单下查看它包含了哪些东西。 注意 它包含有 Tor 浏览器(安全的) 和 不安全的网络浏览器(其中的向内和向外数据不通过 Tor 网络) 和其他应用。
8. 系统将在后台启动 Tor 网络。在屏幕的右上角查看通知 “Tor 已经准备好了,现在你已经连接上了互联网”。
你也可以在 Internet 菜单下查看它包含了哪些东西。 注意 :它包含有 Tor 浏览器(安全的) 和 不安全的网络浏览器(其中的向内和向外数据不通过 Tor 网络) 和其他应用。
![Tails 菜单和工具](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg)
Tails 菜单和工具
*Tails 菜单和工具*
9. 点击 Tor 并检查你的 IP 地址。 它确认我的物理位置没有被分享以及我的隐私未被触动。
![在 Tails 上检查隐私](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg)
在 Tails 上检查隐私
10. 你还可以激活 Tails 安装器来从 ISO 镜像文件中 克隆和安装, 克隆和升级以及升级系统。
*在 Tails 上检查隐私*
10. 你还可以激活 Tails 安装器来“克隆和安装”, “克隆和升级”以及“从 ISO 镜像文件中升级系统”。
![Tails 安装器选项](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg)
Tails 安装器选项
11. 其他选项为选择 Tor 不带有高级选项,就在登录之前。(查看上面的第 5 步).
*Tails 安装器选项*
![Tails 未带有高级选项](http://www.tecmint.com/wp-content/uploads/2015/05/8.png)
Tails 未带有高级选项
11. 如果选择另外的那个不带有高级选项的方式,那就直接登录。(查看上面的第 5 步).
12. 你将登录到 Gnome3 桌面环境。
![不设置高级选项的 Tails](http://www.tecmint.com/wp-content/uploads/2015/05/8.png)
*不设置高级选项的 Tails*
12. 这将登录到 Gnome3 桌面环境。
![Tails Gnome 桌面](http://www.tecmint.com/wp-content/uploads/2015/05/9.png)
Tails Gnome 桌面
13. 假如你点击启动不安全的浏览器,无论在带有伪装,还是没有带有伪装的情况下,你都将会收到弹窗通知。
*Tails Gnome 桌面*
13. 假如你点击启动不安全的浏览器,无论是否带有地址伪装,你都将会收到弹窗通知。
![Tails 浏览通知](http://www.tecmint.com/wp-content/uploads/2015/05/10.png)
Tails 浏览通知
*Tails 浏览通知*
假如你仍启动不安全的浏览器,你将在浏览器中看到如下网页:
![Tails 浏览警告](http://www.tecmint.com/wp-content/uploads/2015/05/11.png)
Tails 浏览警告
*Tails 浏览警告*
#### Tails 适合我吗?####
要想得到上面问题的答案,首先回答如下的问题:
- 在上网时,你想你的隐私被触动吗?
- 你想在身份信息窃取者的眼皮底下保持隐身吗?
- 在上网时,你想你的隐私被触动吗?
- 你想在窃取身份信息的人的眼皮底下保持隐身吗?
- 你想在你的网上私人聊天过程中被他人嗅探吗?
- 你真的想向任何人展示你的地理位置吗?
- 你开展银行网上交易吗?
- 你愿意受政府和 ISP(注:网络提供商) 的审查吗?
- 你愿意受政府和 ISP的审查吗
假如以上问题中,任意一个问题的答案为 'YES',则你最好需要 Tails。假如上面所有的问题的答案都是 'NO',则或许你不需要它。
@ -150,27 +161,28 @@ Tails 浏览警告
### 总结 ###
对于那些工作在不安全环境中的人来说Tails 是一个必需的操作系统。Tails 还是一个着眼于安全的操作系统,现在为止,包含一大批应用 Gnome 桌面, Tor, Firefox (Iceweasel), Network Manager, Pidgin, Claws mail, Liferea feed addregator, Gobby, Aircrack-ng, I2P。
对于那些工作在不安全环境中的人来说Tails 是一个必需的操作系统。Tails 还是一个着眼于安全的操作系统,现在为止,包含了一大批应用 Gnome 桌面、Tor、 Firefox (Iceweasel)、 Network Manager、 Pidgin、 Claws mail、 Liferea feed addregator、 Gobby、 Aircrack-ng、 I2P。
同时,它含有一些有关加密和隐私的工具,即 UKS, GNUPG, PWGen, Shamirs Secret Sharing, Virtual Keyboard (against Hardware Keylogging), MAT, KeePassX Password Manager 等。
同时,它含有一些有关加密和隐私的工具,即 UKS、 GnuPG、 PWGen、 Shamir's Secret Sharing、 Virtual Keyboard (对付硬件的键盘记录器)、 MAT、 KeePassX Password Manager 等。
这就是全部了。关注 Tecmint。请分享你的有关 Tails GNU/Linux 操作系统的想法。对于这个项目的未来,你怎么看?同时在实际中测试它,并让我们获知你的体验感受。
这就是全部了。关注我们。请分享你的有关 Tails GNU/Linux 操作系统的想法。对于这个项目的未来,你怎么看?同时在实际中测试它,并让我们获知你的体验感受。
你也可以在 [Virtualbox][8] 中运行它。 Tails 在 RAM 中加载整个操作系统,所以在 VM 中你需要给定足够的 RAM 来运行 Tails。
你也可以在 [Virtualbox][8] 中运行它。 Tails 在内存中加载整个操作系统,所以在虚拟机中你需要给定足够的内存来运行 Tails。
我在 1GB 内存的环境中测试了 Tails它工作起来毫无滞后感。谢谢我们的所有用户的支持。使我们成为一个包含所有 Linux 相关信息的地方,你的支持是必需的。 Kudos
我在 1GB 的环境中测试了 Tails它工作起来毫无滞后感。谢谢我们的所有用户的支持。使 Tecmint 成为一个包含所有 Linux 相关信息的地方,你的合作是必需的。 Kudos
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/
作者:[Avishek Kumar][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/
[1]:https://linux.cn/article-3566-1.html
[2]:https://tails.boum.org/news/version_1.4/index.en.html
[3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso
[4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent

View File

@ -1,8 +1,8 @@
Linux有问必答——Linux上Apache错误日志的位置在哪里
Linux有问必答Linux上Apache错误日志的位置在哪里
================================================================================
> **问题** 我尝试着解决我 Linux 系统上的 Apache 网络服务器的错误Apache的错误日志文件放在[你的 Linux 版本]的哪个位置呢?
> **问题** 我尝试着解决我 Linux 系统上的 Apache Web 服务器的错误Apache的错误日志文件放在[XX Linux 版本]的哪个位置呢?
错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为网络服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你网络服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。
错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为 Web 服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你 Web 服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。
本文可以帮助你**找到Linux上的Apache错误日志**。
@ -28,7 +28,7 @@ Linux有问必答——Linux上Apache错误日志的位置在哪里
#### 使用虚拟主机自定义的错误日志 ####
如果在 Apache 网络服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。
如果在 Apache Web 服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。
启用了虚拟主机后,各个虚拟主机可以定义其自身的自定义错误日志位置。要找出某个特定虚拟主机的错误日志位置,你可以打开 /etc/apache2/sites-enabled/<your-site>.conf然后查找 ErrorLog 指令,该指令会显示站点指定的错误日志文件。
@ -40,11 +40,11 @@ Linux有问必答——Linux上Apache错误日志的位置在哪里
#### 自定义的错误日志 ####
要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf然后查找 ServerRoot该参数显示了 Apache 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如:
要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf然后查找 ServerRoot该参数显示了 Apache Web 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如:
ServerRoot "/etc/httpd"
现在,查找 ErrorLog 开头的行,该行指出了 Apache 网络服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如:
现在,查找 ErrorLog 开头的行,该行指出了 Apache Web 服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如:
ErrorLog "log/error_log"
@ -71,11 +71,11 @@ via: http://ask.xmodulo.com/apache-error-log-location-linux.html
作者:[Dan Nanni][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://ask.xmodulo.com/author/nanni
[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html
[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html
[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html
[1]:https://linux.cn/article-5068-1.html
[2]:https://linux.cn/article-5352-1.html
[3]:https://linux.cn/article-4405-1.html

View File

@ -1,16 +1,13 @@
如何在Ubuntu/Debian/Linux Mint中编译和安装wxWidgets
================================================================================
### wxWidgets ###
wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。
它主要用C++写成但也可以与其他语言绑定比如Python、Perl、Ruby。
wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。它主要用C++写成但也可以与其他语言绑定比如Python、Perl、Ruby。
本教程中我将向你展示如何在基于Debian的linux中如Ubuntu和Linux Mint中编译wxwidgets 3.0+。
从源码编译wxWidgets并不困难仅仅需要几分钟。
库可以按不同的方式来编译,比如静态或者动态库。
从源码编译wxWidgets并不困难仅仅需要几分钟。库可以按不同的方式来编译比如静态或者动态库。
### 1. 下载 wxWidgets ###
@ -20,13 +17,13 @@ wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中
### 2. 设置编译环境 ###
要编译wxwidgets我们需要一些工具包括C++编译器, 在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。
要编译wxwidgets我们需要一些工具包括C++编译器在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。
我们还需要wxWidgets依赖的GTK开发库。
$ sudo apt-get install libgtk-3-dev build-essential checkinstall
>checkinstall工具允许我们为wxwidgets创建一个安装包这样之后就可以轻松的使用包管理器来卸载。
> 这个叫做checkinstall工具允许我们为wxwidgets创建一个安装包这样之后就可以轻松的使用包管理器来卸载。
### 3. 编译 wxWidgets ###
@ -42,7 +39,7 @@ wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中
"--disable-shared"选项将会编译静态库而不是动态库。
make命令完成后编译成功了。是时候安装wxWidgets到正确的目录。
make命令完成后编译成功了。是时候安装wxWidgets到正确的目录。
更多信息请参考install.txt和readme.txt这可在wxwidgets中的/docs/gtk/目录下找到。
@ -58,7 +55,7 @@ checkinstall会询问几个问题请保证在提问后提供一个版本号
### 5. 追踪安装的文件 ###
如果你想要检查文件安装的位置使用dpkg命令后面跟上checkinstall提供的名。
如果你想要检查文件安装的位置使用dpkg命令后面跟上checkinstall提供的名。
$ dpkg -L package_name
/.
@ -85,17 +82,17 @@ checkinstall会询问几个问题请保证在提问后提供一个版本号
$ cd samples/
$ make
make命令完成后进入sampl子目录这里就有一个可以马上运行的Demo程序了。
make命令完成后进入sample 子目录这里就有一个可以马上运行的Demo程序了。
### 7. 编译你的第一个程序 ###
你完成编译demo程序后可以写你自己的程序来编译了。这个也很简单。
假设你用的是C++这样你可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。
假设你用的是C++这样的话可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。
然而你的第一个程序只需要用一个文本编辑器来快速完成。
这里就是
如下:
#include <wx/wx.h>
@ -155,7 +152,7 @@ via: http://www.binarytides.com/install-wxwidgets-ubuntu/
作者:[Silver Moon][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,14 +1,14 @@
Linux 有问必答--如何在桌面版 Ubuntu 中用命令行更改系统代理设置
Linux 有问必答如何在桌面版 Ubuntu 中用命令行更改系统代理设置
================================================================================
> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗?
> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单点击"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗?
在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 dconf-editor 是访问 DConf 数据库的图形方法,而 gsettings 或 dconf 就是能更改数据库的命令行工具。
在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 `dconf-editor` 是访问 DConf 数据库的图形方法,而 `gsettings``dconf` 就是能更改数据库的命令行工具。
下面介绍如何用 gsettings 从命令行更改系统代理设置。
下面介绍如何用 `gsettings` 从命令行更改系统代理设置。
![](https://farm6.staticflickr.com/5460/17872782271_68e5267a4a_c.jpg)
gsetting 读写特定 Dconf 设置的基本用法如下:
`gsettings` 读写特定 Dconf 设置的基本用法如下:
更改 DConf 设置:
@ -53,7 +53,7 @@ gsetting 读写特定 Dconf 设置的基本用法如下:
### 在命令行中清除系统代理设置 ###
最后,清除所有 手动/自动 代理设置,还原为无代理设置:
最后,清除所有“手动/自动”代理设置,还原为无代理设置:
$ gsettings set org.gnome.system.proxy mode 'none'
@ -63,7 +63,7 @@ via: http://ask.xmodulo.com/change-system-proxy-settings-command-line-ubuntu-des
作者:[Dan Nanni][a]
译者:[ictlyh](https://github.com/ictlyh)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,8 +1,8 @@
Linux ntopng——网络监控工具的安装附截图
Linux 上网络监控工具 ntopng 的安装
================================================================================
当今世界人们的计算机都相互连接互联互通。小到你的家庭局域网LAN大到最大的一个被我们称为的——互联网。当你管理一台联网的计算机时,你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络,网络就连接起了这些关键点。
当今世界人们的计算机都相互连接互联互通。小到你的家庭局域网LAN大到最大的一个被我们称为互联网。当你管理一台联网的计算机时你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络网络就连接起了这些关键点。
这就是为什么我们需要网络监控工具。最好的网络监控工具之一它叫作ntop。来自[维基百科][1]的知识“ntop是一个网络探测器它以与top显示进程般类似的方式显示网络使用率。在交互模式中它显示了用户终端上的网络状态。在网页模式中它作为网络服务器创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector这是一个基于HTTP的客户端界面用于创建ntop为中心的监控应用和RRD用于持续地存储通信数据”
这就是为什么我们需要网络监控工具。ntop 是最好的网络监控工具之一。来自[维基百科][1]的知识“ntop是一个网络探测器它以与top显示进程般类似的方式显示网络使用率。在交互模式中它显示了用户终端上的网络状态。在网页模式中它作为网络服务器创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector这是一个基于HTTP的客户端界面用于创建ntop为中心的监控应用并使用RRD来持续存储通信数据”。
15年后的今天你将见到ntopng——下一代ntop。
@ -15,7 +15,7 @@ Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng
从[ntopng网站][2]上,我们可以看到他们说它有众多的特性。这里列出了其中一些:
- 按各种协议对网络通信排序
- 显示网络通信和IPv4/v6激活主机
- 显示网络通信和IPv4/v6激活主机
- 持续不断以RRD格式存储定位主机的通信数据到磁盘
- 通过nDPIntop的DPI框架发现应用协议
- 显示各种协议间的IP通信分布
@ -24,11 +24,9 @@ Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng
- 报告按协议类型排序的IP协议使用率
- 生成HTML5/AJAX网络通信数据
### 安装 ###
### 安装的先决条件 ###
Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的下载页面][3]找到这些包。对于32位操作系统你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。
#### 先决条件 ####
Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[它们的下载页面][3]找到这些包。对于32位操作系统你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。
#### 开发工具 ####
@ -78,7 +76,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的
# make
# make install
*由于ntopng是一个基于网页的应用你的系统必须安装有工作良好的网络服务器*
*由于ntopng是一个基于网页的应用你的系统必须安装有工作良好的 Web 服务器*
### 为ntopng创建配置文件 ###
@ -89,13 +87,16 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的
# cd ntopng
# vi ntopng.start
放入这些行:
--local-network “10.0.2.0/24”
放入这些行:
--local-network "10.0.2.0/24"
--interface 1
---
# vi ntopng.pid
放入该行:
放入该行:
-G=/var/run/ntopng.pid
保存这些文件,然后继续下一步。
@ -128,7 +129,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的
![Ntopng Flows](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_flows.png)
在**主机菜单**上,你可以看到连接到流的所有主机
在**主机菜单**上,你可以看到连接到流的所有主机
![Ntopng Hosts List](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hoslist.png)
@ -146,8 +147,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的
![Ntopng Apps](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_apps.png)
**界面菜单**将引领你进入更多内部菜单。
包菜单将给你显示包的分布大小。
**界面菜单**将引领你进入更多内部菜单。包菜单将给你显示包的大小分布。
![Ntopng packets](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_packets.png)
@ -157,7 +157,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的
![Ntopng protocols - detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol_detail.png)
你也可以通过使用**历史活跃度菜单**查看活跃度
你也可以通过使用**历史活跃度菜单**查看活跃度
![Ntopng Historical Activity](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical.png)
@ -167,7 +167,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包你可以在[他们的
![Ntopng Users](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_users.png)
Ntopng为你提供了一个范围宽广的时间线从5分钟到1年都可以。你只需要点击你想要现实的时间线。图标本身是可以点击的,你可以点击它来进行缩放。
Ntopng为你提供了一个范围宽广的时间线从5分钟到1年都可以。你只需要点击你想要显示的时间线。图表本身是可以点击的,你可以点击它来进行缩放。
当然ntopng能做的事比上面图片中展示的还要多得多。你也可以将定位和电子地图服务整合进来。在ntopng自己的网站上有已付费的模块可供使用如nprobe可以扩展ntopng可以提供给你的信息。更多关于ntopng的信息你可以访问[ntopng网站][5]。
@ -177,7 +177,7 @@ via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/
作者:[Pungki Arianto][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,102 @@
3个开源的Python Shell
=========================================================================
Python是一个高级、通用、结构化且强大的开源编程语言广泛用于各种编程工作。它拥有一个全动态类型系统和自动内存管理与SchemeRubyPerl和Tcl的十分相似避免编译型语言的许多复杂地方和难以理解。Python于1991年由Guido van Rossum创造然后逐渐成长流行。
Python是一个非常实用而且流行的计算机编程语言。使用一个如Python这样的解释型语言的好处之一就是可以借助其交互的shell探索式地编程。你可以试着代码而不必专门写一个脚本。但是Python shell也有一些局限性。基本来说有许多很漂亮的Python shell可选择都是在基础shell上扩展的。他们每一个都提供了一个极好的交互性的Python 体验。
### bpython ###
![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png)
对于LinuxBSDOS X和Windows来说bpython是一个不错的Python解释器的界面。
其想法是提供给用户所有的内置功能很像现在的IDE集成开发环境但是是在一个简单轻量级的包里可以在终端窗口里面运行。
bpython并不追求创造任何新的或者开创性的东西。相反它聚集了一些简洁的理念关注于实用性和操作性。
功能包括:
- 内置的语法高亮 - 使用Pygments排版你敲出的代码并合理配色
- 根据你的行为,显示自动补全的建议
- 为任何Python函数列出所期望的参数 - 可以显示你调用的任何函数的参数列表
- “Rewind”功能会调出内存里的最后一行代码并重新执行
- 可以将你输入的代码送到pastebin
- 可以将你输入的代码保存到一个文件
- 自动缩进
- 支持Python 3
---
- 网址: [www.bpython-interpreter.org][1]
- 开发者: Bob Farrell and contributors
- 证书: MIT License
- 版本号: 0.14.1
### IPython ###
![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png)
IPython是Python shell的一个交互加强版。她提供了一个丰富的工具集合帮助你交互式地充分利用Python。
IPython可以用来取代标准的Python shell也可以与标准Python科学和数值处理工具配合用做一个科学计算如Matlab或者Mathematical的完整工作环境。她支持动态对象内省有限的输入/输出提示一个宏系统会话日志会话恢复访问完整的系统外壳详尽且彩色的追踪报告自动圆括号补全自动引号补全和可嵌入其他Python程序。
功能包括:
- 强大的交互Shell基于终端或者Qt
- 一个基于浏览器的记事本,支持代码,富文本,数学表达式,内置图表和其他富媒介。
- 支持交互式的数据可视化和使用GUI工具箱
- 灵活,嵌入式的解释器可以加载进你自己的项目里
- 易于使用,高效的并行运算工具
---
- 网址: [ipython.org][2]
- 开发者: The IPython Development Team
- 证书: BSD
- 版本号: 3.1
### DreamPie ###
![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png)
DreamPie是一个为可靠性和趣味性设计的Python shell。
DreamPie可以用于任何Python解释器JythonIronPythonPyPy
功能包括:
- 一个新式的交互shell窗口被分成历史区域和代码区域历史区域可以让你看到之前的命令及其输出代码区域是里敲代码的地方。这样你可以编辑任意多的代码就好像在你最喜欢的编辑器里一样并且适当时候可以执行它。你也可以从其他地方复制代码编辑并马上运行它
- “只复制代码”命令可以复制你想要的代码,以便你可以把它存入一个文件。代码已经用四个空格缩进进行格式化
- 自动补全属性和文件名字
- 自动显示函数参数和文档
- 在结果历史中保存你最近的结果,备以后用
- 可以自动折叠很长的输出,以便你可以专注于重要的地方
- 保存会话的历史记录为一个HTML文件备以后查询。你可以加载历史文件到DreamPie里并且快速重复之前的命令。
- 自动添加圆括号与可选的引号当你在函数与方法后按下空格键。例如键入execfile后按下空格会提示execfile("fn")
- 支持交互的matplotlib绘图
- 支持Python 2.5Python 2.6Python 3.1Jython 2.5IronPython 2.6和PyPy
- 难以置信的快速反应
---
- 网址: [www.dreampie.org][3]
- 开发者: Noam Yorav-Raphael
- 证书: GNU GPL v3
- 版本号: 1.2.1
--------------------------------------------------------------------------------
via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html
作者Frazer Kline
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[1]:http://www.bpython-interpreter.org/
[2]:http://ipython.org/
[3]:http://www.dreampie.org/
--------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
11个让人惊叹的Linux终端彩蛋
11个无用而有趣的Linux终端彩蛋
================================================================================
这里有一些很酷的Linux终端彩蛋其中的每一个看上去并没有实际用途但很精彩
这里有一些很酷的Linux终端彩蛋其中的每一个看上去并没有实际用途但很有趣
![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png)
@ -8,7 +8,7 @@
当我们使用命令行工作时Linux是功能和实用性最好的操作系统之一。想要执行一个特殊任务可能一个程序或者脚本就可以帮你搞定。但就像一本书中说到的只工作不玩耍聪明的孩子也会变傻。下边是我最喜欢的可以在终端做的没有实际用途的、傻傻的、恼人的、可笑的事情。
### 给终端一个态度 ###
### 让终端成为一个有态度的人 ###
* 第一步)敲入`sudo visudo`
* 第二步在“Defaults”末尾文件的前半部分添加一行“Defaults insults”。
@ -20,13 +20,13 @@
### apt-get moo ###
你看过这张截图?那就是运行`apt-get moo`在基于Debian的系统的结果。对就是它了。不要对它抱太多幻想你会失望的我不骗你。但是这是Linux世界最被人熟知的彩蛋之一。所以我把它包含进来并且放在前排然后我也就不会收到5千封邮件指责我把它遗漏了。
![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png)
你看过这张截图?那就是运行`apt-get moo`在基于Debian的系统的结果。对就是它了。不要对它抱太多幻想你会失望的我不骗你。但是这是Linux世界最被人熟知的彩蛋之一。所以我把它包含进来并且放在前排然后我也就不会收到5千封邮件指责我把它遗漏了。
### aptitude moo ###
更有趣的是将moo应用到aptitude上。敲入`aptitude moo`在Ubuntu及其衍生版你对`moo`可以做什么事情的看法会有所变化。你还还会知道更多事情,尝试重新输入这条命令,但这次添加一个`-v`参数。这还没有结束,试着添加更多`v`一次添加一个直到aptitude给了你想要的东西。
更有趣的是将moo应用到aptitude上。敲入`aptitude moo`在Ubuntu及其衍生版你对`moo`可以做什么事情的看法会有所变化。你还还会知道更多事情,尝试重新输入这条命令,但这次添加一个`-v`参数。这还没有结束,试着添加更多`v`,一次添加一个,直到抓狂的aptitude给了你想要的东西。
![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png)
@ -38,25 +38,25 @@
* 第二步)在“# Misc options”部分去掉“Color”前的“#”。
* 第三步添加“ILoveCandy”。
现在我们使用pacman安装新软件包时进度条里会出现一个小吃豆人。真应该默认就这样的。
现在我们使用pacman安装新软件包时进度条里会出现一个小吃豆人。真应该默认就这样的。
![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png)
### Cowsay! ###
`aptitude moo`的输出格式很漂亮,但我想你苦于不能自由自在地使用。输入`cowsay`它会做到你想做的事情。你可以让牛说任何你喜欢的东西。而且不只可以用牛还可以用Calvin、Beavis和Ghostbusters的ASCII logo——输入`cowsay -l`可以得到所有可用的logo。它是Linux世界的强大工具。像很多其他命令一样你可以使用管道把其他程序的输出输送给它比如`fortune | cowsay`。
`aptitude moo`的输出格式很漂亮,但我想你苦于不能自由自在地使用。输入`cowsay`它会做到你想做的事情。你可以让牛说任何你喜欢的东西。而且不只可以用牛还可以用Calvin、Beavis和Ghostbusters logo的ASCII的艺术输入`cowsay -l`可以得到所有可用的参数。它是Linux世界的强大工具。像很多其他命令一样你可以使用管道把其他程序的输出输送给它比如`fortune | cowsay`,让这头牛变成哲学家
![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png)
### 变成3l33t h@x0r ###
`nmap`并不是我们平时经常使用的基本命令。但如果你想蹂躏`nmap`的话,可能想在它的输出中看到l33t。在任何`nmap`命令(比如`nmap -oS - google.com`)后添加`-oS`。现在你的`nmap`已经处于官方名称是“[Script Kiddie Mode][1]”的模式了。Angelina Jolie和Keanu Reeves会为此骄傲的。
`nmap`并不是我们平时经常使用的基本命令。但如果你想蹂躏`nmap`的话,比如像人一样看起来像l33t。在任何`nmap`命令后添加`-oS`(比如`nmap -oS - google.com`)。现在你的`nmap`已经处于标准叫法是“[脚本玩具模式][1]”的模式了。Angelina Jolie和Keanu Reeves会为此骄傲的。
![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png)
### 获得所有的Discordian日期 ###
如果你们曾经坐在一起思考,“嗨!我想使用无用但异想天开的方式来书写今天的日期……”试试运行`ddate`。结果类似于“Today is Setting Orange, the 72nd day of Discord in the YOLD 3181”这会让你的服务树日志平添不少香料
如果你们曾经坐在一起思考,“嗨!我想使用无用但异想天开的方式来书写今天的日期……”试试运行`ddate`。结果类似于“Today is Setting Orange, the 72nd day of Discord in the YOLD 3181”这会让你的服务树日志平添不少趣味
注意:在技术层面,确实有一个[Discordian Calendar][2],理论上被[Discordianism][3]追随者所使用。这意味着我可能得罪某些人。或者不会,我不确定。不管怎样,`ddate`是一个方便的工具。
@ -76,7 +76,7 @@
### 将任何文本逆序输出 ###
将任何文本使用管道输送给`rev`命令,它就会将文本内容逆序输出。`fortune | rev`会给你好运。当然这不意味着rev会将幸运转换成不幸。
将任何文本使用管道输送给`rev`命令,它就会将文本内容逆序输出。`fortune | rev`会给你好运。当然这不意味着rev会将幸运fortune转换成不幸。
![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png)
@ -94,7 +94,7 @@ via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-
作者:[Bryan Lunduke][a]
译者:[goreliu](https://github.com/goreliu)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,14 +1,12 @@
sevenot translated
下载年度报告了解The Document Foundation2014年的成果
================================================================================
![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg)
TDF ReportThe Document Foundation (TDF)郑重地发布了2014年度报告你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。
The Document Foundation (TDF)郑重地发布了2014年度报告你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。
TDF年度报告中以回顾2014年开始了这篇报告其中包括了TDF和LibreOffice的精彩集锦并且总结了财务情况和预算。
该报告涉及到项目和活动的会议包括2014年在伯尔尼的LibreOffice大会在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目网站与质量保证Hackfests项目,本土语言项目,基础设施,文档项目,市场设计与营销。
该报告涉及到项目和活动的会议包括2014年在伯尔尼的LibreOffice大会在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目、网站与质量保证、Hackfests项目等,本土语言项目,基础设施,文档项目,市场设计与营销。
该报告涉及到的软件开发活动和代码包括工程指导委员会的活动LibreOffice的开发文档解放项目LibreOffice的安卓移植。
@ -17,8 +15,7 @@ TDF年度报告中以回顾2014年开始了这篇报告其中包括了TDF
TDF 2014年度报告的编辑工作由Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli 和 Robinson Tryon完成由Barak Paz设计样式Libreoffice社区协助完成。
为了使该文档分布达到最大程度的分布采用了CC3 认证发布除非特殊标注TDF成员和自由软件基金会拥有其所有权。
[德语版年度报告下载请点击[http://tdf.io/bericht2014][3]].
为了最大程度的传播该文档采用了CC3 认证发布除非特殊标注TDF成员和自由软件基金会拥有其所有权。
--------------------------------------------------------------------------------
@ -26,7 +23,7 @@ via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-found
作者italovignoli
译者:[sevenot](https://github.com/sevenot)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,84 @@
PHP 20岁了从玩具到巨头
=============================================================================
> 曾经的‘丑小鸭工程’已经转变为一个互联网巨头,感谢灵活、务实和充满活力的开发者社区。
当Rasmus Lerdorf发布“[一个用C写的小型紧凑的CGI可执行程序集合][2]”时, 他没有想到他的创造会对网络发展产生多大的影响。今年在Miami举行的SunshinePHP大会上Lerdorf做了开场演讲他自嘲到“在1995年的时候我以为我已经在 Web 上解除了C API的束缚。显然事情并非那样我们全成了C程序员了。”
![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg)
题图来自: [Steve Jurvetson via Flickr][1]
实际上当Lerdorf发布个人主页工具Personal Home Page Tools即 PHP 名字的来源的1.0版本时那时的网络还是如此的年轻。直到那年的十一月份HTML 2.0还没有公布而且HTTP/1.0也是次年的五月份才出现。那时NCSA HTTPd是使用最广泛的网络服务器而网景的Navigator则是最流行的网络浏览器八月份的时候IE1.0才刚刚出现。换句话说PHP的开端刚好撞上了浏览器战争的前夜。
早些时候我们谈论了一大堆关于PHP对网络发展的影响。回到那时候当说到用于网络应用的服务器端处理我们的选择是有限的。PHP满足了我们对于一种工具的需求这就是可以使得我们在网络上做一些动态的事情。它的实用的灵活性只受限于我们的想像力PHP从那时起便与网络共同成长。现在PHP占据了网络语言的超过80%的份额,已经是成熟的脚本语言,特别适合解决网络问题。她独一无二的血统讲述了一个故事,实用高于理论,解决问题高于纯正。
### 把我们钩住的网络魔力 ###
PHP一开始并不是一门编程语言从她的设计就很明显不是 -- 或者她本来就缺乏相关特性正如那些贬低者指出的那样。最初她是作为一种API帮助网络开发者能够接入底层的C语言封装库。第一个版本是一组小的CGI可执行程序提供表单处理功能可以访问查询参数和mSQL数据库。而且她可以如此容易地处理一个网络应用的数据库证明了其在激发我们对于PHP的兴趣和PHP后来的支配地位的关键作用。
到了第二版 -- 即 PHP/FI -- 数据库的支持已经扩展到包括PostgreSQL、MySQL、Oracle、Sybase等等。她通过封装他们的C语言库来支持各种数据库将他们作为PHP库的一部分。PHP/FI也封装了GD库可以创建并管理GIF图像。她可以作为一个Apache模块运行或者编译进FastCGI支持并且她引入的 PHP 编程语言支持变量、数组、语言结构和函数。对于那个时候大多数在网络这块工作的人来说PHP是我们一直在寻求的那款“胶水”。
当PHP吸纳越来越多的编程语言功能演变为第三版和之后的版本时她从来没有失去这种黏合的特性。通过仓库如PECLPHP Extension Community LibraryPHP可以把各种库都连在一起将他们的函数引入到PHP层面。这种将组件结合在一起的能力成为PHP之美的一个重要方面使之不会受限于其源代码上。
### 网络,一个码农们的社区 ###
PHP在网络发展上的持续影响并不局限于能用这种语言干什么。PHP如何完成工作谁参与进来 -- 这些都是PHP传奇中很重要的部分。
早在1997年PHP的用户群体开始形成。其中最早的是美国中西部PHP用户组后来叫做 Chiago PHP并[1997年二月份的时候举行了第一次聚会][4]。这是一个充满生气、饱含激情的开发者社区形成的开端,聚合成一种吸引力 -- 在网络上的一个小工具就可以帮助他们解决问题。PHP这种普遍存在的特性使得她成为网络开发一个很自然的选择。在分享主导的世界里她开始盛行而且低入的门槛对于许多早期的网络开发者来说是十分有吸引力的。
伴随着社区的成长为开发者带来了一堆工具和资源。这一年是2000年出现了PHP的一个转折点它见证了第一次PHP开发者大会聚集了编程语言的核心开发者他们在Tel Aviv见面讨论即将到来的4.0版本的发布。PHP扩展和应用仓库PEAR也于2000年发起它提供了高质量的用户代码包依据标准和最佳操作。第一届PHP大会PHP Kongress不久之后在德国举行。[PHPDeveloper.org][5]也随后上线直到今天这都是PHP社区里最权威的新闻资源。
这个社区的势头表明了接下来几年里PHP成长的关键所在。随着网络开发产业的爆发PHP也获得发展。PHP开始为更多、更大的网站提供动力。越来越多的用户群在世界各地开花。邮件列表、在线论坛、IRC、大会以及如php[architect]、德国PHP杂志、国际PHP杂志等商业杂志 -- PHP社区的活力在完成网络工作的方式上有极其重要的影响共同地开放地倡导代码共享。
然后在10年前PHP 5发布后不久在网络发展史上一个有趣地事情发生了它导致了PHP社区如何构建库和应用的转变Ruby on Rails发布了。
### 框架的异军突起 ###
用于Ruby编程语言的Ruby on Rails框架在MVC模型-视图-控制架构模型上获得了不断增长的焦点与关注。Mojavi PHP框架几年前已经使用MVC模型了但是Ruby on Rails的高明之处在于巩固了MVC。框架引爆了PHP社区并且框架已经改变了开发者构建PHP应用程序的方式。
许多重要的项目和发展已经发端这归功于PHP社区框架的生长。[PHP框架互用性组织][6]成立于2009年致力于在框架间建立编码标准命名约定与最佳操作。编纂这些标准和操作帮助为开发者在使用成员项目的代码时提供了越来越多的互用性软件。互用性意味着每个框架可以拆分为组块和独立的库也可以作为整体的框架在一起使用。互用性带来了另一个重要的里程碑Composer项目于2011年诞生了。
从Node.js的NPM和Ruby的Bundler获得灵感Composer开辟了PHP应用开发的新纪元创造了一次PHP“文艺复兴”。它激发了包互用性、标准命名约定、编码标准的采用、覆盖测试的提升。它是任何现代PHP应用中的一个基本工具。
### 加速和创新的需要 ###
如今PHP社区有一个生机勃勃应用和库的生态系统有一些被广泛安装的PHP应用包括WordPressDrupalJoomla和MediaWiki。从小型的夫妻店站点到whitehouse.gov和Wikipeida这些应用支撑了各种不同规模的业务的网站。在Alexa前十的站点中有6个使用PHP在一天内为数十亿的页面访问提供服务。因此PHP应用已成为需要加速的首选并且许多创新也加入到PHP的核心来提升性能。
在2010年Facebook公开了其用作PHP源对源的编译器的HipHop可以翻译PHP代码为C++代码并且编译为一个单独的可执行二进制应用。Facebook的规模和成长需要从标准互用的PHP代码迁移到更快、最佳的可执行的代码。尽管如此由于PHP的易用和快速开发周期Facebook还想继续使用PHP。HipHop后来进化为HHVM这是一个针对PHP的JITjust-in-time编译基础的执行引擎其包含一个基于PHP的新的语言[Hack][7]。
Facebook的创新以及其他的VM项目是在引擎水平上的比较其引起了关于Zend引擎未来的讨论。Zend引擎依然是PHP的内核和语言规范。在2014年它创建了一个语言规范项目“提供一个完整的简明的语句定义和PHP语言的语义学”使得对编译器项目来说创建互用的PHP实现成为可能。
下一个PHP的主要版本成为了激烈争论的话题他们提出了一个叫做phpng下一代的项目来清理重构优化和改进PHP代码基础这也展示了对实际应用的性能的实质提升。由于之前有一个未发布的PHP 6.0版本因此在决定命名下一个主要版本叫做“PHP 7”后就合并了phpng分支并制定了开发PHP 7的计划以增加很多语言中拥有的功能如scalar和返回类型提示。
随着[今天第一版PHP 7 alpha发布][8],基准检测程序显示她在许多方面[与HHVM的一样好或者拥有更好的性能][9]PHP正与现代网络开发需求保持一致的步伐。同样地PHP-FIG继续创新和推动框架与库的协作 -- 最近由于[PSR-7][10]的采纳这将会改变PHP项目处理HTTP的方式。用户组、会议、公众和如[PHPMentoring.org][11]这样的布道者继续在PHP开发者社区提倡最好的操作、编码标准和测试。
PHP从各个方面见证了网络的成熟而且PHP自己也成熟了。曾经一个简单的低级C语言库的API封装PHP以她自己的方式已经成为一个羽翼丰满的编程语言。她的开发者社区是一个充满生气、乐于助人、在实用方面引以为傲并且欢迎新人的地方。PHP已经经受了20年的考验而且目前在语言与社区里的活跃性会保证她在接下来的几年里将会是一个密切相关的、积极有用的的语言。
在Rasmus Lerdorf的SunshinePHP的演讲中他回忆到“我会想到我会在20年之后讨论当初做的这个愚蠢的小项目吗没有。”
这里向Lerdorf和PHP社区的其他人致敬感谢他们把这个“愚蠢的小项目”变成了一个如今网络上持久、强大的组件。
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html
作者:[Ben Ramsey][a]
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Ben-Ramsey/
[1]:https://www.flickr.com/photos/jurvetson/13049862325
[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ
[3]:http://w3techs.com/technologies/overview/programming_language/all
[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm
[5]:http://www.phpdeveloper.org/
[6]:http://www.php-fig.org/
[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html
[8]:https://wiki.php.net/todo/php70#timetable
[9]:http://talks.php.net/velocity15
[10]:http://www.php-fig.org/psr/psr-7/
[11]:http://phpmentoring.org/

View File

@ -1,83 +0,0 @@
translating wi-cuckoo
PHP at 20: From pet project to powerhouse
================================================================================
![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg)
Credit: [Steve Jurvetson via Flickr][1]
> The one-time silly little project has transformed into a Web powerhouse, thanks to flexibility, pragmatism, and a vibrant community of Web devs
When Rasmus Lerdorf released “[a set of small tight CGI binaries written in C][2],” he had no idea how much his creation would impact Web development. Delivering the opening keynote at this years SunshinePHP conference in Miami, Lerdorf quipped, “In 1995, I thought I had unleashed a C API upon the Web. Obviously, thats not what happened, or wed all be C programmers.”
In fact, when Lerdorf released version 1.0 of Personal Home Page Tools -- as PHP was then known -- the Web was very young. HTML 2.0 would not be published until November of that year, and HTTP/1.0 not until May the following year. NCSA HTTPd was the most widely deployed Web server, and Netscape Navigator was the most popular Web browser, with Internet Explorer 1.0 to arrive in August. In other words, PHPs beginnings coincided with the eve of the browser wars.
Those early days speak volumes about PHPs impact on Web development. Back then, our options were limited when it came to server-side processing for Web apps. PHP stepped in to fill our need for a tool that would enable us to do dynamic things on the Web. That practical flexibility captured our imaginations, and PHP has since grown up with the Web. Now powering [more than 80 percent of the Web][3], PHP has matured into a scripting language that is especially suited to solve the Web problem. Its unique pedigree tells a story of pragmatism over theory and problem solving over purity.
### The Web glue we got hooked on ###
PHP didnt start out as a language, and this is clear from its design -- or lack thereof, as detractors point out. It began as an API to help Web developers access lower-level C libraries. The first version was a small CGI binary that provided form-processing functionality with access to request parameters and the mSQL database. And its facility with a Web apps database would prove key in sparking our interest in PHP and PHPs subsequent ascendancy.
By version 2 -- aka PHP/FI -- database support had expanded to include PostgreSQL, MySQL, Oracle, Sybase, and more. It supported these databases by wrapping their C libraries, making them a part of the PHP binary. PHP/FI could also wrap the GD library to create and manipulate GIF images. It could be run as an Apache module or compiled with FastCGI support, and it introduced the PHP script language with support for variables, arrays, language constructs, and functions. For many of us working on the Web at that time, PHP was the kind of glue we'd been looking for.
As PHP folded in more and more programming language features, morphing into version 3 and onward, it never lost this gluelike aspect. Through repositories like PECL (PHP Extension Community Library), PHP could tie together libraries and expose their functionality to the PHP layer. This capacity to bring together components became a significant facet of the beauty of PHP, though it was not limited to its source code.
### The Web as a community of coders ###
PHPs lasting impact on Web development isnt limited to what can be done with the language itself. How PHP work is done and who participates -- these too are important parts of PHPs legacy.
As early as 1997, PHP user groups began forming. One of the earliest was the Midwest PHP Users Group (later known as Chicago PHP), which held its [first meeting in February 1997][4]. This was the beginning of what would become a vibrant, energetic community of developers assembled over an affinity for a little tool that helped them solve problems on the Web. The ubiquity of PHP made it a natural choice for Web development. It became especially popular in the shared hosting world, and its low barrier to entry was attractive to many early Web developers.
With a growing community came an assortment of tools and resources for PHP developers. The year 2000 -- a watershed moment for PHP -- witnessed the first PHP Developers Meeting, a gathering of the core developers of the programming language, who met in Tel Aviv to discuss the forthcoming 4.0 release. PHP Extension and Application Repository (PEAR) also launched in 2000 to provide high-quality userland code packages following standards and best practices. The first PHP conference, PHP Kongress, was held in Germany soon after. [PHPDeveloper.org][5] came online, and to this day, it is the most authoritative news source in the PHP community.
This communal momentum proved vital to PHPs growth in subsequent years, and as the Web development industry erupted, so did PHP. PHP began powering more and larger websites. More user groups formed around the world. Mailing lists; online forums; IRC; conferences; trade journals such as php[architect], the German PHP Magazin, and International PHP Magazine -- the vibrancy of the PHP community had a significant impact on the way Web work would be done: collectively and openly, with an emphasis on code sharing.
Then, 10 years ago, shortly after the release of PHP 5, an interesting thing happened in Web development that created a general shift in how the PHP community built libraries and applications: Ruby on Rails was released.
### The rise of frameworks ###
The Ruby on Rails framework for the Ruby programming language created an increased focus and attention on the MVC (model-view-controller) architectural pattern. The Mojavi PHP framework a few years prior had used this pattern, but the hype around Ruby on Rails is what firmly cemented MVC in the PHP frameworks that followed. Frameworks exploded in the PHP community, and frameworks have changed the way developers build PHP applications.
Many important projects and developments have arisen, thanks to the proliferation of frameworks in the PHP community. The PHP [Framework Interoperability Group][6] formed in 2009 to aid in establishing coding standards, naming conventions, and best practices among frameworks. Codifying these standards and practices helped provide more interoperable software for developers using member projects code. This interoperability meant that each framework could be split into components and stand-alone libraries could be used together with monolithic frameworks. With interoperability came another important milestone: The Composer project was born in 2011.
Inspired by Node.jss NPM and Rubys Bundler, Composer has ushered in a new era of PHP application development, creating a PHP renaissance of sorts. It has encouraged interoperability between packages, standard naming conventions, adoption of coding standards, and increased test coverage. It is an essential tool in any modern PHP application.
### The need for speed and innovation ###
Today, the PHP community has a thriving ecosystem of applications and libraries. Some of the most widely installed PHP applications include WordPress, Drupal, Joomla, and MediaWiki. These applications power the Web presence of businesses of all sizes, from small mom-and-pop shops to sites like whitehouse.gov and Wikipedia. Six of the Alexa top 10 sites use PHP to serve billions of pages a day. As a result, PHP applications have been optimized for speed -- and much innovation has gone into PHP core to improve performance.
In 2010, Facebook unveiled its HipHop for PHP source-to-source compiler, which translates PHP code into C++ code and compiles it into a single executable binary application. Facebooks size and growth necessitated the move away from standard interpreted PHP code to a faster, optimized executable. However, Facebook wanted to continue using PHP for its ease of use and rapid development cycles. HipHop for PHP evolved into HHVM, a JIT (just-in-time) compilation-based execution engine for PHP, which included a new language based on PHP: [Hack][7].
Facebooks innovations, as well as other VM projects, created competition at the engine level, leading to discussions about the future of the Zend Engine that still powers PHPs core, as well as the question of a language specification. In 2014, a language specification project was created “to provide a complete and concise definition of the syntax and semantics of the PHP language,” making it possible for compiler projects to create interoperable PHP implementations.
The next major version of PHP became a topic of intense debate, and a project known as phpng (next generation) was offered as an option to clean up, refactor, optimize, and improve the PHP code base, which also showed substantial improvements to the performance of real-world applications. After deciding to name the next major version “PHP 7,” due to a previous, unreleased PHP 6.0 version, the phpng branch was merged in, and plans were made to proceed with PHP 7, working in many of the language features offered by Hack, such as scalar and return type hinting.
With the [first PHP 7 alpha release due out today][8] and benchmarks showing [performance as good as or better than that of HHVM][9] in many cases, PHP is keeping up with the pace of modern Web development needs. Likewise, the PHP-FIG continues to innovate and push frameworks and libraries to collaborate and cooperate -- most recently with the adoption of [PSR-7][10], which will change the way PHP projects handle HTTP. User groups, conferences, publications, and initiatives like [PHPMentoring.org][11] continue to advocate best practices, coding standards, and testing to the PHP developer community.
PHP has seen the Web mature through various stages, and PHP has matured. Once a simple API wrapper around lower-level C libraries, PHP has become a full-fledged programming language in its own right. Its developer community is vibrant and helpful, priding themselves in pragmatism and welcoming newcomers. PHP has stood the test of time for 20 years, and current activity in the language and community is ensuring it will be a relevant and useful language for years to come.
During his SunshinePHP keynote, Rasmus Lerdorf reflected, “Did I think Id be here 20 years later talking about this silly little project I did? No, I didnt.”
Heres to Lerdorf and the rest of the PHP community for transforming this “silly little project” into a lasting, powerful component of the Web today.
--------------------------------------------------------------------------------
via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html
作者:[Ben Ramsey][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.infoworld.com/author/Ben-Ramsey/
[1]:https://www.flickr.com/photos/jurvetson/13049862325
[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ
[3]:http://w3techs.com/technologies/overview/programming_language/all
[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm
[5]:http://www.phpdeveloper.org/
[6]:http://www.php-fig.org/
[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html
[8]:https://wiki.php.net/todo/php70#timetable
[9]:http://talks.php.net/velocity15
[10]:http://www.php-fig.org/psr/psr-7/
[11]:http://phpmentoring.org/

View File

@ -0,0 +1,186 @@
translating wi-cuckoo
What will be the future of Linux without Linus?
================================================================================
![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg)
The interview was conducted back in 2007 for Linux For You magazine and we are publishing it here for archival purposes.
**Q: What are the future enhancements/paths/plans for the Linux kernel?**
Linus: Ive never been much of a visionary — instead of looking at huge plans for the future, I tend to have a rather short time frame of issues in the next few months. Im a big believer in that the details matter, and if you take care of the details, the big issues will end up sorting themselves out on their own.
So I really dont have any great vision for what the kernel will look like in five years — just a very general plan to make sure that we keep our eye on the ball. In fact, when it comes to me personally, one of the things I worry about the most isnt even the technical issues, but making sure that the process works, and that people can work well with each other.
**Q: How do you see the relationship of Linux and Solaris evolving in the future? How will it benefit the users? **
Linus: I dont actually see a whole lot of overlap, except that I think Solaris will start using more of the Linux user space tools (which I obviously dont personally have a lot to do with — I really only do the kernel). The Linux desktop is just so much better than what traditional Solaris has, and I expect Solaris to move more and more towards a more Linux-like model there.
On the pure kernel side, the licensing differences mean that theres not much cooperation, but it will be very interesting to see if that will change. Sun has been making noises about licensing Solaris under the GPL (either v2 or v3), and if the licence differences go away, that could result in some interesting technology. But Im taking a wait-and-see attitude to that.
**Q: Now that the GPLv3 has been finalised and released, do you foresee any circumstance that would encourage you to begin moving the kernel to it? Or, from your perspective, is it so bad that you would never consider it?**
Linus: I think it is much improved over the early drafts, and I dont think its a horrible licence. I just dont think its the same kind of great licence that the GPLv2 is.
So in the absence of the GPLv2, I could see myself using the GPLv3. But since I have a better choice, why should I?
That said, I try to always be pragmatic, and the fact that I think the GPLv3 is not as good a licence as the GPLv2 is not a black and white question. Its a balancing act. And if there are other advantages to the GPLv3, maybe those other advantages would be big enough to tilt the balance in favour of the GPLv3.
Quite frankly, I dont really see any, but if Solaris really is to be released under the GPLv3, maybe the advantage of avoiding unnecessary non-compatible licence issues could be enough of an advantage that it might be worth trying to re-license the Linux kernel under the GPLv3 too.
Dont get me wrong — I think its unlikely. But I do want to make it clear that Im not a licence bigot, per se. I think the GPLv2 is clearly the better licence, but licences arent everything.
After all, I use a lot of programs that are under other licences. I might not put a project I start myself under the BSD (or the X11-MIT) licence, but I think its a great licence, and for other projects it may well be the right one.
**Q: Currently are there any Indians who youd like to highlight as key contributors to the Linux kernel?**
Linus: I have to admit that I dont directly work with anybody that I actually realise as being from India. That said, I should clarify a bit: Ive very consciously tried to set up the kernel development so that I dont end up working personally with a huge number of people.
I have this strong conviction that most humans are basically wired up to know a few people really well (your close family and friends), and Ive tried to make the development model reflect that: with a network of developers, where people interact with maybe a dozen other people they trust, and those other people in turn interact with their set of people they trust.
So while Im in occasional contact with hundreds of developers who send me a random patch or two, Ive tried to set up an environment where the bulk of what I do happens through a much smaller set of people that I know, just because I think thats how people work. Its certainly how I like to work.
Also, in all honesty, I dont even know where a lot of the people I work with live. Location ends up being pretty secondary. So while Im pretty sure that none of the top 10-15 I work with most closely, are in India, maybe after this goes public, it might get pointed out that there is actually somebody from there!
**Q: Since the Linux Kernel Development depends so heavily on you, how do you plan to organise/reorganise it for it to continue progressing without you, in case you decide to dedicate more time to your own life and family?**
Linus: Ive long since come to the realisation that Linux is much bigger than me. Yes, Im intimately involved in it still, and I have a fairly large day-to-day impact on it, and I end up being the person who, in some sense, acts as the central point for a lot of kernel activities; but no — I wouldnt say that Linux depends heavily on me.
So if I had a heart attack and died tomorrow (happily not likely: Im apparently healthy as anything), people would certainly notice, but there are thousands of people involved in just the kernel, and therere more than a few that could take over for me with little real confusion.
**Q: India is one of the major producers of software engineers, yet we dont contribute much to the Linux domain. What do you think is keeping Indians from becoming proactive on that front? How do you feel we could encourage Indians to get involved and contribute heavily? You have a fan following in India; could your iconic image be used to inspire enthusiasts?**
Linus: This is actually a very hard question for me to answer. Getting into open source is such a complicated combination of both infrastructure (Internet access, education, you name it), flow of information and simply culture that I cant even begin to guess what the biggest stumbling block could be.
In many ways, at least those with an English-speaking culture in India should have a rather easy time getting involved with Linux and other open source projects, if only thanks to the lack of a language barrier. Certainly much easier than many parts of Asia or even some parts of Europe.
Of course, while that is a lot of people, its equally obviously not the majority in India, and I personally simply dont know enough about the issues in India to be able to make an even half-way intelligent guess about what the best way forward is. I suspect that an enthusiastic local user community is always the best way, and I think you do have that.
As to my iconic image, I tend to dislike that part personally. Im not a great public speaker, and Ive avoided travelling for the last several years because Im not very comfortable being seen as this iconic visionary. Im just an engineer, and I just happen to love doing what I do, and to work with other people in public.
**Q: What would be a good reason for you to consider visiting India?**
Linus: As mentioned in the first answer, I absolutely detest public speaking, so I tend to avoid conferences, etc. Id love to go to India for a vacation some day, but if I do, Id likely just do it incognito — not tell anybody beforehand and just go as a tourist to see the country!
**Q: Recently, you seemed to slam Subversion and CVS, questioning their basic architecture. Now that youve got responses from the Subversion community, do you stand corrected, or are you still unconvinced?**
Linus: I like making strong statements, because I find the discussion interesting. In other words, I actually tend to like arguing. Not mindlessly, but I certainly tend to prefer the discussion a bit more heated, and not just entirely platonic.
And making strong arguments occasionally ends up resulting in a very valid rebuttal, and then Ill happily say: “Oh, ok, youre right.”
But no, that didnt happen on SVN/CVS. I suspect a lot of people really dont much like CVS, so I didnt really even expect anybody to argue that CVS was really anything but a legacy system. And while Ive gotten a few people who argued that I shouldnt have been quite so impolite against SVN (and hey, thats fair — Im really not a very polite person!), I dont think anybody actually argued that SVN was good.
SVN is, I think, a classic case of good enough. Its what people are used to, and its good enough to be used fairly widely, but its good enough in exactly the sense DOS and Windows were good enough. Not great technology, just very widely available, and it works well enough for people and looks familiar enough that people use it. But very few people are proud of it, or excited about it.
Git, on the other hand, has some of the UNIX philosophy behind it. Not that it is about UNIX, per se, but like original UNIX, it had a fundamental idea behind it. For UNIX, the underlying philosophy was/is that, “Everything is a file.” For git, its, Everything is just an object in the content-addressable database.”
**Q: Is having so many distros a good or bad idea? Choice is fine, but one does not need to be pampered with choices. Instead of so many man hours being spent in building hundreds of distros, wouldnt it be easier to get into the enterprise and take on the MS challenge if people could come together and support fewer distros (1 for each use maybe)? Whats your view on that?**
Linus: I think having multiple distros is an inevitable part of open source. And can it be confusing? Sure. Can it be inefficient? Yes. But Id just like to compare it to politics: democracy has all those confusing choices, and often none of the choices is necessarily what you really want either, and sometimes you might feel like things would be smoother and more efficient if you didnt have to worry about the whole confusion of voting, different parties, coalitions, etc.
But in the end, choice may be inefficient, but its also what keeps everybody involved at least somewhat honest. We all probably wish our politicians were more honest than they are, and we all probably wish that the different distros sometimes made other choices than they do, but without that choice, wed be worse off.
**Q: Why do you think CFS is better than SD?**
Linus: Part of it is that I have worked with Ingo [Molnar] for a long time, which means that I know him, and know that hell be very responsive to any issues that come up. That kind of thing is very important.
But part of it is simply about numbers. Most people out there actually say that CFS is better than SD. Including, very much, on 3D games (which people claimed was a strong point of SD).
At the same time, though, I dont think any piece of code is ever ”perfect”. The best thing to happen is that the people who want to be proponents of SD will try to improve that so much that the balance tips over the other way — and well keep both camps trying interesting things because the internal competition motivates them.
**Q: In a talk you had at Google about git, someone asked you how you would take an extremely large code base that is currently handled with something centralised and transition to git without stopping business for six months. What was your response to that?**
Linus: Ahh. That was the question where I couldnt hear the questioner well (the questions were much more audible in the recordings), and I noticed afterwards, when I went back and listened to the recorded audio, that I didnt answer the question he asked, but the question I thought hed asked.
Anyway, we do have lots of import tools, so that you can actually just import a large project from just about any other previous SCM into git. But the problem, of course, often doesnt end up being the act of importing itself, but just having to get used to the new model!
And quite frankly, I dont think there is any other answer to that get used to it but to just start out and try it. You obviously do not want to start out by importing the biggest and most central project you have; that would indeed just make everything come to a standstill, and make everybody very unhappy indeed.
So nobody sane would advocate moving everything over to git overnight, and forcing people to change their environment. No. Youd start with a smaller project inside a company, perhaps something that just one group mostly controls and maintains, and start off by converting that to git. That way you get people used to the model, and you start having a core group with the knowledge about how git works and how to use it within the company.
And then you just extend on that. Not in one go. Youd import more and more of the projects — even if you have the one big repository model at your company; you also almost certainly have that repository as a set of modules, because having everybody check out everything is just not a workable mode of operation (unless everything is just not very large).
So youd basically migrate one module at a time, until you get to the point where youre so comfortable with git that you can just migrate the rest (or the rest is so legacy that nobody even cares).
And one of the nice features of git is that it actually plays along pretty well with a lot of other SCMs. Thats how a lot of git users use it: they may use git, but sometimes the people they work with dont even realise, because they see the results of it propagated into some legacy SCM.
**Q: Did they ever experiment with alternate instruction set implementations at Transmeta? [Transmeta Crusoe chip seemed like a very soft CPU — reminding one of Burroughs B1000 interpretive machine, which actually implemented multiple virtual machines. There was one for system software, another for Cobol, another for Fortran; If that is correct, then one could implement Burroughs 6/7000 or HP3000 like stack architecture on the chip or an instruction set suitable for JVM, etc]**
Linus: We did indeed have some alternate instruction set, and while I still am not really supposed to talk about it, I can say that we did have a public demonstration of mixing instruction sets. We had a technology showcase where you could run x86 instructions side-by-side with Java byte code (actually, it was a slightly extended pico-java, iirc).
I think the app we showed running was running DOOM on top of Linux, where the Linux parts were a totally standard x86 distribution, but the DOOM binary was a specially compiled version where part of the game was actually compiled pico-Java. And the CPU ended up running them both the same way — as a JIT down to the native VLIW instruction set.
(The reason for picking DOOM was just that source code was available, and the core parts of the game were small enough that it was easy to set it up as a demonstration — and it was obviously visually interesting.)
There were more things going on internally, but I cant really talk about them. And I wasnt actually personally involved with the Java one either.
**Q: 386BSD, from which NetBSD, FreeBSD and OpenBSD were derived, was there well before Linux, but Linux spread much more than 386BSD and its derivatives. How much of this do you attribute to the choice of the licence and how much to the development process you chose? Dont you think that the GPLv3 protects the freedom that has bred Linux better than the BSDs till now, more than the GPLv2 can?**
Linus: I think theres both a licence issue, and a community and personality issue. The BSD licences always encouraged forking, but also meant that if somebody gets really successful and makes a commercial fork, you cannot necessarily join back. And so even if that doesnt actually happen (and it did, in the BSD cases — with BSDi), people cant really trust each other as much.
In contrast, the GPLv2 also encourages forking, but it not only encourages the branching off part, it also encourages (and requires) the ability to merge back again. So now you have a whole new level of trust: you know that everybody involved will be bound by the licence, and wont try to take advantage of you.
So I see the GPLv2 as the licence that allows people the maximum possible freedom within the requirement that you can always join back together again from either side. Nobody can stop you from taking the improvements to the source code.
So is the BSD licence even more free? Yes. Unquestionably. But I just wouldnt want to use the BSD licence for any project I care about, because I not only want the freedom, I also want the trust so that I can always use the code that others write for my projects.
So to me, the GPLv2 ends up being a wonderful balance of as free as you can make it, considering that I do want everybody to be able to trust so that they can always get the source code and use it.
Which is why I think the GPLv3 ends up being a much less interesting licence. Its no longer about that trust about “getting the source code back”; it has degenerated into a “I wrote the code, so I should be able to control how you use it.”
In other words, I just think the GPLv3 is too petty and selfish. I think the GPLv2 has a great balance between freedom and trust. Its not as free as the BSD licences are, but it gives you peace of mind in return, and matches what I consider tit-for-tat': I give source code, you give me source code in return.
The GPLv3 tries to control the use of that source code. Now its, “I give you my source code, so if you use it, youd better make your devices hackable by me.” See? Petty and small-minded, in my opinion.
**Q: Slowly but steadily, features of the -rt tree are getting integrated into the mainline. What are your current thoughts regarding a merger of the remaining -rt tree into the mainline (and Im not talking about the CFS)?**
Linus: I wont guarantee that everything from -rt will ever be merged into the standard kernel (there may be pieces that simply dont end up making sense in the generic kernel), but yes, over the years weve actually integrated most of it, and the remaining parts could end up making it one of these days.
Im a big fan of low-latency work, but at the same time Im pretty conservative, and I pushed back on some of the more aggressive merging, just because I want to make sure that it all makes sense for not just some extreme real time perspective, but also for normal users who dont need it. And that explains why the process has been a pretty slow but steady trickle of code that has gotten merged, as it was sufficiently stable and made sense.
That, by the way, is not just an -rt thing; its how a lot of the development happens. -rt just happens to be one of the more directed kernel projects, and one where the main developer is pretty directly involved with the normal kernel too. But quite often the migration of other features (security, virtual memory changes, virtualisation, etc) follows a similar path: they get written up in a very targeted environment, and then pieces of the features get slowly but surely merged into the standard kernel.
**Q: Im very curious about what the future holds for file systems in the kernel. What do you think about Reiser4, XFS4, ZFS and the new project founded by Oracle? ZFS has been receiving a lot of press these days. Reiser4 delivers very good benchmarks, and xfs4 is trying to keep up, whereas the one by Oracle has a lot of the same specs as Suns ZFS. Where are we heading? Which FS looks the most promising in your opinion?**
Linus: Actually, just yesterday we had a git performance issue, where ZFS was orders of magnitude slower than UFS for one user (not under Linux, but git is gaining a lot of traction even outside of kernel development). So I think a lot of the new file system mania is partly fed by knowing about the issues with old file systems, and then the (somewhat unrealistic) expectation that a new and improved file system will make everything perfect.
In the end, this is one area where you just let people fight it out. See who comes out the winner — and it doesnt need to be (and likely will not) be a single winner. Almost always, the right choice of file system ends up depending on the load and circumstances.
One thing that Im personally more excited about than any of the file systems you mention is actually the fact that Flash-based hard disks are quickly becoming available even for normal users. Sure, theyre still expensive (and fairly small), but Flash-based storage has such a different performance profile from rotating media, that I suspect that it will end up having a large impact on file system design. Right now, most file systems tend to be designed with the latencies of rotating media in mind.
**Q: The operating system is becoming less and less important. You have said several times that the user is not supposed to see the operating system at all. It is the applications that matter. Browser-based applications, like Googles basic office applications, are making an impact. Where do you think operating systems are headed?**
Linus: I dont really believe in the browser OS, because I think that people will always want to do some things locally. It might be about security, or simply about privacy reasons. And while connectivity is widely available, it certainly isnt everywhere.
So I think the whole Web OS certainly is part of the truth, but another part that people seem to dismiss is that operating systems have been around for decades, and its really a fairly stable and well-known area of endeavour. People really shouldnt expect the OS to magically change: its not like people were stupid back in the 60s either, or even that hardware was that fundamentally different back then!
So dont expect a revolution. I think OSs will largely continue to do what they do, and while well certainly evolve, I dont think theyll change radically. What may change radically are the interfaces and the things you do on top of the OS (and certainly the hardware beneath the OS will continue to evolve too), and thats what people obviously care about.
The OS? Its just that hidden thing that makes it all possible. You really shouldnt care about it, unless you find it very interesting to know what is really going on in the machine.
**Q: The last I heard, you were using a PPC G4/5 for your main personal machine — what are you using now, and why?**
Linus: I ended up giving up on the PowerPC, since nobody is doing any workstations any more, and especially since x86-64 has become such an undeniable powerhouse. So these days, I run a bog-standard PC, with a normal Core 2 Duo on it.
It was a lot of fun to run another architecture (I ran with alpha as my main architecture way back then, for a few years, so it wasnt the first time either), but commodity CPUs is where it is at. The only thing that I think can really ever displace the x86 architecture would come from below, i.e., if something makes us not use x86 as our main ISA in a decade, I think it would be ARM, thanks to the mobile device market.
**Q: What does Linux mean to you — a hobby, philosophy, the meaning of life, a job, the best OS, something else…?**
Linus: Its some of all of that. Its a hobby, but a deeply meaningful one. The best hobbies are the ones that you care really deeply about. And these days its obviously also my work, and Im very happy to be able to combine it all.
I dont know about a philosophy, and I dont really do Linux for any really deeply held moral or philosophical reasons (I literally do it because its interesting and fun), but its certainly the case that I have come to appreciate the deeper reasons why I think open source works so well. So I may not have started to do Linux for any such deep reasons, and I cannot honestly say that that is what motivates me, but I do end up thinking about why it all works.
**Q: Did Microsofts Men in Black ever talk to you?**
Linus: Ive never really talked to MS, no. Ive occasionally been at the same conferences with some MS people (I used to go to more conferences than I do these days), but Ive never really had anything to do with them. I think there is a mutual wariness.
--------------------------------------------------------------------------------
via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/
作者:[Swapnil Bhartiya][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.linuxveda.com/author/arnieswap/

View File

@ -1,84 +0,0 @@
translating by wwy-hust
What is good audio editing software on Linux
================================================================================
Whether you are an amateur musician or just a student recording his professor, you need to edit and work with audio recordings. If for a long time such task was exclusively attributed to Macintosh, this time is over, and Linux now has what it takes to do the job. In short, here is a non-exhaustive list of good audio editing software, fit for different tasks and needs.
### 1. Audacity ###
![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg)
Let's get started head on with my personal favorite. [Audacity][1] works on Windows, Mac, and Linux. It is open source. It is easy to use. You get it: Audacity is almost perfect. This program lets you manipulate the audio waveform from a clean interface. In short, you can overlay tracks, cut and edit them easily, apply effects, perform advanced sound analysis, and finally export to a plethora of format. The reason I like it so much is that it combines both basic features with more complicated ones, but maintain an easy leaning curve. However, it is not a fully optimized software for hardcore musicians, or people with professional knowledge.
### 2. Jokosher ###
![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg)
On a different level, [Jokosher][2] focuses more on the multi-track aspect for musical artists. Developed in Python and using the GTK+ interface with GStreamer for audio back-end, Jokosher really impressed me with its slick interface and its extensions. If the editing features are not the most advanced, the language is clear and directed to musicians. And I really like the association between tracks and instruments for example. In short, if you are starting as a musician, it might be a good place to get some experience before moving on to more complex suites.
### 3. Ardour ###
![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg)
And talking about compex suites, [Ardour][3] is complete software for recording, editing, and mixing. Designed this time to appeal to all professionals, Ardour features in term of sound routing and plugins go way beyond my comprehension. So if you are looking for a beast and are not afraid to tame it, Ardour is probably a good pick. Again, the interface contributes to its charm, as well as its extensive documentation. I particularly appreciated the first-launch configuration tool.
### 4. Kwave ###
![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg)
For all KDE lovers, [KWave][4] corresponds to your idea of design and features. There are plenty of shortcuts and interesting options, like memory management. Even if the few effects are nice, we are more dealing with a simple tool to cut/paste audio together. It becomes shard not to compare it with Audacity unfortunately. And on top of that, the interface did not appeal to me that much.
### 5. Qtractor ###
![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg)
If Kwave is too simplistic for you but a Qt-based program really has some appeal, then [Qtractor][5] might be your option. It aims to be "simple enough for the average home user, and yet powerful enough for the professional user." Indeed the quantity of features and options is almost overwhelming. My favorite being of course customizable shortcuts. Apart from that, Qtractor is probably one of my favorite tools to deal with MIDI files.
### 6. LMMS ###
![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg)
Standing for Linux MultiMedia Studio, LMMS is directly targeted for music production. If you do not have prior experience and do not want to spend too much time getting some, go elsewhere. LMMS is one of those complex but powerful software that only a few will truly master. The number of features and effects is simply too long to list, but if I had to pick one, I would say that the Freeboy plugin to emulate Game Boy sound system is just magical. Past that, go see their amazing documentation.
### 7. Traverso ###
![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg)
Finally, Traverso stood out to me for its unlimited track count and its direct integration with CD burning capacities. Aside from that, it appeared to me as a middle man between a simplistic software and a professional program. The interface is very KDE-like, and the keyboard configuration is always welcome. And cherry on the cake, Traverso monitors your resources and make sure that your CPU or hard drive does not go overboard.
To conclude, it is always a pleasure to see such a large diversity of applications on Linux. It makes finding the software that best fits your needs always possible. While my personal favorite stays Audacity, I was very surprised by the design of programs like LMMS or Jokosher.
Did we miss one? What do you use for audio editing on Linux? And why? Let us know in the comments.
--------------------------------------------------------------------------------
via: http://xmodulo.com/good-audio-editing-software-linux.html
作者:[Adrien Brochard][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:http://audacity.sourceforge.net/
[2]:https://launchpad.net/jokosher/
[3]:http://ardour.org/
[4]:http://kwave.sourceforge.net/
[5]:http://qtractor.sourceforge.net/qtractor-index.html
[6]:
[7]:
[8]:
[9]:
[10]:
[11]:
[12]:
[13]:
[14]:
[15]:
[16]:
[17]:
[18]:
[19]:
[20]:

View File

@ -1,301 +0,0 @@
Translating by ZTinoZ
20 Useful Terminal Emulators for Linux
================================================================================
A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface.
![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg)
20 Linux Terminal Emulators
You may find huge number of terminal emulators to choose from this open source world. Some of them offers large range of features while others offers less features. To give a better understanding to the quality of software that are available, we have gathered a list of marvelous terminal emulator for Linux. Each title provides its description and feature along with screenshot of the software with relevant download link.
### 1. Terminator ###
Terminator is an advanced and powerful terminal emulator which supports multiple terminals windows. This emulator is fully customizable. You can change the size, colour, give different shapes to the terminal. Its very user friendly and fun to use.
#### Features of Terminator ####
- Customize your profiles and colour schemes, set the size to fit your needs.
- Use plugins to get even more functionality.
- Several key-shortcuts are available to speed up common activities.
- Split the terminal window into several virtual terminals and re-size them as needed.
![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg)
Terminator Terminal
- [Terminator Homepage][1]
- [Download and Installation Instructions][2]
### 2. Tilda ###
Tilda is a stylish drop-down terminal based on GTK+. With the help of a single key press you can launch a new or hide Tilda window. However, you can add colors of your choice to change the look of the text and Terminal background.
#### Features of Tilda ####
Interface with Highly customization option.
You can set the transparency level for Tilda window.
Excellent built-in colour schemes.
![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg)
Tilda Terminal
- [Tilda Homepage][3]
### 3. Guake ###
Guake is a python based drop-down terminal created for the GNOME Desktop Environment. It is invoked by pressing a single keystroke, and can make it hidden by pressing same keystroke again. Its design was determined from FPS (First Person Shooter) games such as Quake and one of its main target is be easy to reach.
Guake is very much similar to Yakuaka and Tilda, but its an experiment to mix the best of them into a single GTK-based program. Guake has been written in python from scratch using a little piece in C (global hotkeys stuff).
![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg)
Guake Terminal
- [Guake Homepage][4]
### 4. Yakuake ###
Yakuake (Yet Another Kuake) is a KDE based drop-down terminal emulator very much similar to Guake terminal emulator in functionality. Its design was inspired from fps consoles games such as Quake.
Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages.
#### Yakuake Features ####
- Fluently turn down from the top of your screen
- Tabbed interface
- Configurable dimensions and animation speed
- Customizable
![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg)
Yakuake Terminal
- [Yakuake Homepage][5]
### 5. ROXTerm ###
ROXterm is yet another lightweight terminal emulator designed to provide similar features to gnome-terminal. It was originally constructed to have lesser footprints and faster start-up time by not using the Gnome libraries and by using a independent applet to bring the configuration interface (GUI), but over the time its role has shifted to bringing a higher range of features for power users.
However, it is more customizable than gnome-terminal and anticipated more at “power” users who make excessive use of terminals. It is easily integrated with GNOME desktop environment and provides features like drag & drop of items into terminal.
![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg)
Roxterm Terminal
- [ROXTerm Homepage][6]
### 6. Eterm ###
Eterm is a lightest color terminal emulator designed as a replacement for xterm. It is developed with a Freedom of Choice ideology, leaving as much power, flexibility, and freedom as workable in the hands of the user.
![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg)
Eterm Terminal
- [Eterm Homepage][7]
### 7. Rxvt ###
Rxvt stands for extended virtual terminal is a color terminal emulator application for Linux intended as an xterm replacement for power users who dont need to have a feature such as Tektronix 4014 emulation and toolkit-style configurability.
![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg)
Rxvt Terminal
- [Rxvt Homepage][8]
### 8. Wterm ###
Wterm is a another light weight color terminal emulator based on rxvt project. It includes features such as background images, transparency, reverse transparency and an considerable set or runtime options are accessible resulting in a very high customizable terminal emulator.
![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg)
wterm Terminal
- [Wterm Homepage][9]
### 9. LXTerminal ###
LXTerminal is a default VTE-based terminal emulator for LXDE (Lightweight X Desktop Environment) without any unnecessary dependency. The terminal has got some nice features such as.
LXTerminal Features
- Multiple tabs support
- Supports common commands like cp, cd, dir, mkdir, mvdir.
- Feature to hide the menu bar for saving space
- Change the color scheme.
![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg)
lxterminal Terminal
- [LXTerminal Homepage][10]
### 10. Konsole ###
Konsole is yet another powerful KDE based free terminal emulator was originally created by Lars Doelle.
Konsole Features
- Multiple Tabbed terminals.
- Translucent backgrounds.
- Support for Split-view mode.
- Directory and SSH bookmarking.
- Customizable color schemes.
- Customizable key bindings.
- Notification alerts about activity in a terminal.
- Incremental search
- Support for Dolphin file manager
- Export of output in plain text or HTML format.
![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg)
Konsole Terminal
- [Konsole Homepage][11]
### 11. TermKit ###
TermKit is a elegant terminal that aims to construct aspects of the GUI with the command line based application using WebKit rendering engine mostly used in web browsers like Google Chrome and Chromium. TermKit is originally designed for Mac and Windows, but due to TermKit fork by Floby which you can now able to install it under Linux based distributions and experience the power of TermKit.
![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg)
TermKit Terminal
- [TermKit Homepage][12]
12. st
st is a simple terminal implementation for X Window.
![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png)
st terminal
- [st Homepage][13]
### 13. Gnome-Terminal ###
GNOME terminal is a built-in terminal emulator for GNOME desktop environment developed by Havoc Pennington and others. It allow users to run commands using a real Linux shell while remaining on the on the GNOME environment. GNOME Terminal emulates the xterm terminal emulator and brings a few similar features.
The Gnome terminal supports multiple profiles, where users can able to create multiple profiles for his/her account and can customize configuration options such as fonts, colors, background image, behavior, etc. per account and define a name to each profile. It also supports mouse events, url detection, multiple tabs, etc.
![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg)
Gnome Terminal
- [Gnome Terminal][14]
### 14. Final Term ###
Final Term is a open source stylish terminal emulator that has some exciting capabilities and handy features into one single beautiful interface. It is still under development, but provides significant features such as Semantic text menus, Smart command completion, GUI terminal controls, Omnipotent keybindings, Color support and many more. The following animated screen grab demonstrates some of their features. Please click on image to view demo.
![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif)
FinalTerm Terminal
- [Final Term][15]
### 15. Terminology ###
Terminology is yet another new modern terminal emulator created for the Enlightenment desktop, but also can be used in different desktop environments. It has some awesome unique features, which do not have in any other terminal emulator.
Apart features, terminology offers even more things that you wouldnt assume from a other terminal emulators, like preview thumbnails of images, videos and documents, it also allows you to see those files directly from Terminology.
You can watch a following demonstrations video created by the Terminology developer (the video quality isnt clear, but still its enough to get the idea about Terminology).
<iframe width="630" height="480" frameborder="0" allowfullscreen="" src="//www.youtube.com/embed/ibPziLRGvkg"></iframe>
- [Terminology][16]
### 16. Xfce4 terminal ###
Xfce terminal is a lightweight modern and easy to use terminal emulator specially designed for Xfce desktop environment. The latest release of xfce terminal has some new cool features such as search dialog, tab color changer, drop-down console like Guake or Yakuake and many more.
![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg)
Xfce Terminal
- [Xfce4 Terminal][17]
### 17. xterm ###
The xterm application is a standard terminal emulator for the X Window System. It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that cant use the window system directly.
![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg)
xterm Terminal
- [xterm][18]
### 18. LilyTerm ###
The LilyTerm is a another less known open source terminal emulator based off of libvte that desire to be fast and lightweight. LilyTerm also include some key features such as:
- Support for tabbing, coloring and reordering tabs
- Ability to manage tabs through keybindings
- Support for background transparency and saturation.
- Support for user specific profile creation.
- Several customization options for profiles.
- Extensive UTF-8 support.
![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg)
Lilyterm Terminal
- [LilyTerm][19]
### 19. Sakura ###
The sakura is a another less known Unix style terminal emulator developed for command line purpose as well as text-based terminal programs. Sakura is based on GTK and livte and provides not more advanced features but some customization options such as multiple tab support, custom text color, font and background images, speedy command processing and few more.
![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg)
Sakura Terminal
- [Sakura][20]
### 20. rxvt-unicode ###
The rxvt-unicode (also known as urxvt) is a yet another highly customizable, lightweight and fast terminal emulator with xft and unicode support was developed by Marc Lehmann. It got some outstanding features such as support for international language via Unicode, the ability to display multiple font types and support for Perl extensions.
![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png)
rxvt unicode
- [rxvt-unicode][21]
If you know any other capable Linux terminal emulators that Ive not included in the above list, please do share with me using our comment section.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/linux-terminal-emulators/
作者:[Ravi Saive][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:https://launchpad.net/terminator
[2]:http://www.tecmint.com/terminator-a-linux-terminal-emulator-to-manage-multiple-terminal-windows/
[3]:http://tilda.sourceforge.net/tildaabout.php
[4]:https://github.com/Guake/guake
[5]:http://extragear.kde.org/apps/yakuake/
[6]:http://roxterm.sourceforge.net/index.php?page=index&lang=en
[7]:http://www.eterm.org/
[8]:http://sourceforge.net/projects/rxvt/
[9]:http://sourceforge.net/projects/wterm/
[10]:http://wiki.lxde.org/en/LXTerminal
[11]:http://konsole.kde.org/
[12]:https://github.com/unconed/TermKit
[13]:http://st.suckless.org/
[14]:https://help.gnome.org/users/gnome-terminal/stable/
[15]:http://finalterm.org/
[16]:http://www.enlightenment.org/p.php?p=about/terminology
[17]:http://docs.xfce.org/apps/terminal/start
[18]:http://invisible-island.net/xterm/
[19]:http://lilyterm.luna.com.tw/
[20]:https://launchpad.net/sakura
[21]:http://software.schmorp.de/pkg/rxvt-unicode

View File

@ -1,436 +0,0 @@
zpl1025
How to Manipulate Filenames Having Spaces and Special Characters in Linux
================================================================================
We come across files and folders name very regularly. In most of the cases file/folder name are related to the content of the file/folder and starts with number and characters. Alpha-Numeric file name are pretty common and very widely used, but this is not the case when we have to deal with file/folder name that has special characters in them.
**Note**: We can have files of any type but for simplicity and easy implementation we will be dealing with Text file (.txt), throughout the article.
Example of most common file names are:
abc.txt
avi.txt
debian.txt
...
Example of numeric file names are:
121.txt
3221.txt
674659.txt
...
Example of Alpha-Numeric file names are:
eg84235.txt
3kf43nl2.txt
2323ddw.txt
...
Examples of file names that has special character and is not very common:
#232.txt
#bkf.txt
#bjsd3469.txt
#121nkfd.txt
-2232.txt
-fbjdew.txt
-gi32kj.txt
--321.txt
--bk34.txt
...
One of the most obvious question here is who on earth create/deal with files/folders name having a Hash `(#)`, a semi-colon `(;)`, a dash `(-)` or any other special character.
I Agree to you, that such file names are not common still your shell should not break/give up when you have to deal with any such file names. Also speaking technically every thing be it folder, driver or anything else is treated as file in Linux.
### Dealing with file that has dash (-) in its name ###
Create a file that starts with a dash `(-)`, say -abx.txt.
$ touch -abc.txt
#### Sample Output ####
touch: invalid option -- 'b'
Try 'touch --help' for more information.
The reason for above error, that shell interprets anything after a dash `(-)`, as option, and obviously there is no such option, hence is the error.
To resolve such error, we have to tell the Bash shell (yup this and most of the other examples in the article is for BASH) not to interpret anything after special character (here dash), as option.
There are two ways to resolve this error as:
$ touch -- -abc.txt [Option #1]
$ touch ./-abc.txt [Option #2]
You may verify the file thus created by both the above ways by running commands ls or [ls -l][1] for long listing.
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 11:05 -abc.txt
To edit the above file you may do:
$ nano -- -abc.txt
or
$ nano ./-abc.txt
**Note**: You may replace nano with any other editor of your choice say vim as:
$ vim -- -abc.txt
or
$ vim ./-abc.txt
Similarly to move such file you have to do:
$ mv -- -abc.txt -a.txt
or
$ mv -- -a.txt -abc.txt
and to Delete this file, you have to do:
$ rm -- -abc.txt
or
$ rm ./-abc.txt
If you have lots of files in a folder the name of which contains dash, and you want to delete all of them at once, do as:
$ rm ./-*
**Important to Note:**
1. The same rule as discussed above follows for any number of hypen in the name of the file and their occurrence. Viz., -a-b-c.txt, ab-c.txt, abc-.txt, etc.
2. The same rule as discussed above follows for the name of the folder having any number of hypen and their occurrence, except the fact that for deleting the folder you have to use rm -rf as:
$ rm -rf -- -abc
or
$ rm -rf ./-abc
### Dealing with files having HASH (#) in the name ###
The symbol `#` has a very different meaning in BASH. Anything after a `#` is interpreted as comment and hence neglected by BASH.
**Understand it using examples:**
create a file #abc.txt.
$ touch #abc.txt
#### Sample Output ####
touch: missing file operand
Try 'touch --help' for more information.
The reason for above error, that Bash is interpreting #abc.txt a comment and hence ignoring. So the [command touch][2] has been passed without any file Operand, and hence is the error.
To resolve such error, you may ask BASH not to interpret # as comment.
$ touch ./#abc.txt
or
$ touch '#abc.txt'
and verify the file just created as:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:14 #abc.txt
Now create a file the name of which contains # anywhere except at the begging.
$ touch ./a#bc.txt
$ touch ./abc#.txt
or
$ touch 'a#bc.txt'
$ touch 'abc#.txt'
Run ls -l to verify it:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:16 a#bc.txt
-rw-r--r-- 1 avi avi 0 Jun 8 12:16 abc#.txt
What happens when you create two files (say a and #bc) at once:
$ touch a.txt #bc.txt
Verify the file just created:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:18 a.txt
Obvious from the above example it only created file a and file #bc has been ignored. To execute the above situation successfully we can do,
$ touch a.txt ./#bc.txt
or
$ touch a.txt '#bc.txt'
and verify it as:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:20 a.txt
-rw-r--r-- 1 avi avi 0 Jun 8 12:20 #bc.txt
You can move the file as:
$ mv ./#bc.txt ./#cd.txt
or
$ mv '#bc.txt' '#cd.txt'
Copy it as:
$ cp ./#cd.txt ./#de.txt
or
$ cp '#cd.txt' '#de.txt'
You may edit it as using your choice of editor as:
$ vi ./#cd.txt
or
$ vi '#cd.txt'
----------
$ nano ./#cd.txt
or
$ nano '#cd.txt'
And Delete it as:
$ rm ./#bc.txt
or
$ rm '#bc.txt'
To delete all the files that has hash (#) in the file name, you may use:
# rm ./#*
### Dealing with files having semicolon (;) in its name ###
In case you are not aware, semicolon acts as a command separator in BASH and perhaps other shell as well. Semicolon lets you execute several command in one go and acts as separator. Have you ever deal with any file name having semicolon in it? If not here you will.
Create a file having semi-colon in it.
$ touch ;abc.txt
#### Sample Output ####
touch: missing file operand
Try 'touch --help' for more information.
bash: abc.txt: command not found
The reason for above error, that when you run the above command BASH interpret touch as a command but could not find any file operand before semicolon and hence it reports error. It also reports another error that abc.txt command not found, only because after semicolon BASH was expecting another command and abc.txt, is not a command.
To resolve such error, tell BASH not to interpret semicolon as command separator, as:
$ touch ./';abc.txt'
or
$ touch ';abc.txt'
**Note**: We have enclosed the file name with single quote ''. It tells BASH that ; is a part of file name and not command separator.
Rest of the action (viz., copy, move, delete) on the file and folder having semicolon in its name can be carried out straight forward by enclosing the name in single quote.
### Dealing with other special characters in file/folder name ###
#### Plus Sign (+) in file name ####
Dont requires anything extra, just do it normal way, as simple file name as shown below.
$ touch +12.txt
#### Dollar sign ($) in file name ####
You have to enclose file name in single quote, as we did in the case of semicolon. Rest of the things are straight forward..
$ touch '$12.txt'
#### Percent (%) in file name ####
You dont need to do anything differently, treat it as normal file.
$ touch %12.txt
#### Asterisk (*) in file name ####
Having Asterisk in file name dont change anything and you can continue using it as normal file.
$ touch *12.txt
Note: When you have to delete a file that starts with *, Never use following commands to delete such files.
$ rm *
or
$ rm -rf *
Instead use,
$ rm ./*.txt
#### Exclamation mark (!) in file name ####
Just Enclose the file name in single quote and rest of the things are same.
$ touch '!12.txt'
#### At Sign (@) in file name ####
Nothing extra, treat a filename having At Sign as nonrmal file.
$ touch '@12.txt'
#### ^ in file name ####
No extra attention required. Use a file having ^ in filename as normal file.
$ touch ^12.txt
#### Ampersand (&) in file name ####
Filename should be enclosed in single quotes and you are ready to go.
$ touch '&12.txt'
#### Parentheses () in file name ####
If the file name has Parenthesis, you need to enclose filename with single quotes.
$ touch '(12.txt)'
#### Braces {} in file name ####
No Extra Care needed. Just treat it as just another file.
$ touch {12.txt}
#### Chevrons <> in file name ####
A file name having Chevrons must be enclosed in single quotes.
$ touch '<12.txt>'
#### Square Brackets [ ] in file name ####
Treat file name having Square Brackets as normal files and you need not take extra care of it.
$ touch [12.txt]
#### Under score (_) in file name ####
They are very common and dont require anything extra. Just do what you would have done with a normal file.
$ touch _12.txt
#### Equal-to (=) in File name ####
Having an Equal-to sign do not change anything, you can use it as normal file.
$ touch =12.txt
#### Dealing with back slash (\) ####
Backslash tells shell to ignore the next character. You have to enclose file name in single quote, as we did in the case of semicolon. Rest of the things are straight forward.
$ touch '\12.txt'
#### The Special Case of Forward Slash ####
You cannot create a file the name of which includes a forward slash (/), until your file system has bug. There is no way to escape a forward slash.
So if you can create a file such as /12.txt or b/c.txt then either your File System has bug or you have Unicode support, which lets you create a file with forward slash. In this case the forward slash is not a real forward slash but a Unicode character that looks alike a forward slash.
#### Question Mark (?) in file name ####
Again, an example where you dont need to put any special attempt. A file name having Question mark can be treated in the most general way.
$ touch ?12.txt
#### Dot Mark (.) in file name ####
The files starting with dot `(.)` are very special in Linux and are called dot files. They are hidden files generally a configuration or system files. You have to use switch -a or -A with ls command to view such files.
Creating, editing, renaming and deleting of such files are straight forward.
$ touch .12.txt
Note: In Linux you may have as many dots `(.)` as you need in a file name. Unlike other system dots in file name dont means to separate name and extension. You can create a file having multiple dots as:
$ touch 1.2.3.4.5.6.7.8.9.10.txt
and check it as:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 14:32 1.2.3.4.5.6.7.8.9.10.txt
#### Comma (,) in file name ####
You can have comma in a file name, as many as you want and you Dont requires anything extra. Just do it normal way, as simple file name.
$ touch ,12.txt
or
$ touch ,12,.txt
#### Colon (:) in File name ####
You can have colon in a file name, as many as you want and you Dont requires anything extra. Just do it normal way, as simple file name.
$ touch :12.txt
or
$ touch :12:.txt
#### Having Quotes (single and Double) in file name ####
To have quotes in file name, we have to use the rule of exchange. I.e, if you need to have single quote in file name, enclose the file name with double quotes and if you need to have double quote in file name, enclose it with single quote.
$ touch "15'.txt"
and
$ touch '15”.txt'
#### Tilde (~) in file name ####
Some Editors in Linux like emacs create a backup file of the file being edited. The backup file has the name of the original file plus a tilde at the end of the file name. You can have a file that name of which includes tilde, at any location simply as:
$ touch ~1a.txt
or
$touch 2b~.txt
#### White Space in file name ####
Create a file the name of which has space between character/word, say “hi my name is avishek.txt”.
It is not a good idea to have file name with spaces and if you have to distinct readable name, you should use, underscore or dash. However if you have to create such a file, you have to use backward slash which ignores the next character to it. To create above file we have to do it this way..
$ touch hi\ my\ name\ is\ avishek.txt
hi my name is avishek.txt
I have tried covering all the scenario you may come across. Most of the above implementation are explicitly for BASH Shell and may not work in other shell.
If you feel that I missed something (that is very common and human nature), you may include your suggestion in the comments below. Keep Connected, Keep Commenting. Stay Tuned and connected! Like and share us and help us get spread!
--------------------------------------------------------------------------------
via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/

View File

@ -1,175 +0,0 @@
wyangsun 申领
Inside NGINX: How We Designed for Performance & Scale
================================================================================
NGINX leads the pack in web performance, and its all due to the way the software is designed. Whereas many web servers and application servers use a simple threaded or process-based architecture, NGINX stands out with a sophisticated event-driven architecture that enables it to scale to hundreds of thousands of concurrent connections on modern hardware.
The [Inside NGINX][1] infographic drills down from the high-level process architecture to illustrate how NGINX handles multiple connections within a single process. This blog explains how it all works in further detail.
### Setting the Scene the NGINX Process Model ###
![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png)
To better understand this design, you need to understand how NGINX runs. NGINX has a master process (which performs the privileged operations such as reading configuration and binding to ports) and a number of worker and helper processes.
# service nginx restart
* Restarting nginx
# ps -ef --forest | grep nginx
root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \
-c /etc/nginx/nginx.conf
nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process
nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process
On this 4-core server, the NGINX master process creates 4 worker processes and a couple of cache helper processes which manage the on-disk content cache.
### Why Is Architecture Important? ###
The fundamental basis of any Unix application is the thread or process. (From the Linux OS perspective, threads and processes are mostly identical; the major difference is the degree to which they share memory.) A thread or process is a self-contained set of instructions that the operating system can schedule to run on a CPU core. Most complex applications run multiple threads or processes in parallel for two reasons:
- They can use more compute cores at the same time.
- Threads and processes make it very easy to do operations in parallel (for example, to handle multiple connections at the same time).
Processes and threads consume resources. They each use memory and other OS resources, and they need to be swapped on and off the cores (an operation called a context switch). Most modern servers can handle hundreds of small, active threads or processes simultaneously, but performance degrades seriously once memory is exhausted or when high I/O load causes a large volume of context switches.
The common way to design network applications is to assign a thread or process to each connection. This architecture is simple and easy to implement, but it does not scale when the application needs to handle thousands of simultaneous connections.
### How Does NGINX Work? ###
NGINX uses a predictable process model that is tuned to the available hardware resources:
- The master process performs the privileged operations such as reading configuration and binding to ports, and then creates a small number of child processes (the next three types).
- The cache loader process runs at startup to load the disk-based cache into memory, and then exits. It is scheduled conservatively, so its resource demands are low.
- The cache manager process runs periodically and prunes entries from the disk caches to keep them within the configured sizes.
- The worker processes do all of the work! They handle network connections, read and write content to disk, and communicate with upstream servers.
The NGINX configuration recommended in most cases running one worker process per CPU core makes the most efficient use of hardware resources. You configure it by including the [worker_processes auto][2] directive in the configuration:
worker_processes auto;
When an NGINX server is active, only the worker processes are busy. Each worker process handles multiple connections in a non-blocking fashion, reducing the number of context switches.
Each worker process is single-threaded and runs independently, grabbing new connections and processing them. The processes can communicate using shared memory for shared cache data, session persistence data, and other shared resources.
### Inside the NGINX Worker Process ###
![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png)
Each NGINX worker process is initialized with the NGINX configuration and is provided with a set of listen sockets by the master process.
The NGINX worker processes begin by waiting for events on the listen sockets ([accept_mutex][3] and [kernel socket sharding][4]). Events are initiated by new incoming connections. These connections are assigned to a state machine the HTTP state machine is the most commonly used, but NGINX also implements state machines for stream (raw TCP) traffic and for a number of mail protocols (SMTP, IMAP, and POP3).
![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png)
The state machine is essentially the set of instructions that tell NGINX how to process a request. Most web servers that perform the same functions as NGINX use a similar state machine the difference lies in the implementation.
### Scheduling the State Machine ###
Think of the state machine like the rules for chess. Each HTTP transaction is a chess game. On one side of the chessboard is the web server a grandmaster who can make decisions very quickly. On the other side is the remote client the web browser that is accessing the site or application over a relatively slow network.
However, the rules of the game can be very complicated. For example, the web server might need to communicate with other parties (proxying to an upstream application) or talk to an authentication server. Third-party modules in the web server can even extend the rules of the game.
#### A Blocking State Machine ####
Recall our description of a process or thread as a self-contained set of instructions that the operating system can schedule to run on a CPU core. Most web servers and web applications use a process-per-connection or thread-per-connection model to play the chess game. Each process or thread contains the instructions to play one game through to the end. During the time the process is run by the server, it spends most of its time blocked waiting for the client to complete its next move.
![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png)
1. The web server process listens for new connections (new games initiated by clients) on the listen sockets.
1. When it gets a new game, it plays that game, blocking after each move to wait for the clients response.
1. Once the game completes, the web server process might wait to see if the client wants to start a new game (this corresponds to a keepalive connection). If the connection is closed (the client goes away or a timeout occurs), the web server process returns to listening for new games.
The important point to remember is that every active HTTP connection (every chess game) requires a dedicated process or thread (a grandmaster). This architecture is simple and easy to extend with third-party modules (new rules). However, theres a huge imbalance: the rather lightweight HTTP connection, represented by a file descriptor and a small amount of memory, maps to a separate thread or process, a very heavyweight operating system object. Its a programming convenience, but its massively wasteful.
#### NGINX is a True Grandmaster ####
Perhaps youve heard of [simultaneous exhibition][5] games, where one chess grandmaster plays dozens of opponents at the same time?
![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif)
[Kiril Georgiev played 360 people simultaneously in Sofia, Bulgaria][6]. His final score was 284 wins, 70 draws and 6 losses.
Thats how an NGINX worker process plays “chess.” Each worker (remember theres usually one worker for each CPU core) is a grandmaster that can play hundreds (in fact, hundreds of thousands) of games simultaneously.
![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png)
1. The worker waits for events on the listen and connection sockets.
1. Events occur on the sockets and the worker handles them:
- An event on the listen socket means that a client has started a new chess game. The worker creates a new connection socket.
- An event on a connection socket means that the client has made a new move. The worker responds promptly.
A worker never blocks on network traffic, waiting for its “opponent” (the client) to respond. When it has made its move, the worker immediately proceeds to other games where moves are waiting to be processed, or welcomes new players in the door.
### Why Is This Faster than a Blocking, Multi-Process Architecture? ###
NGINX scales very well to support hundreds of thousands of connections per worker process. Each new connection creates another file descriptor and consumes a small amount of additional memory in the worker process. There is very little additional overhead per connection. NGINX processes can remain pinned to CPUs. Context switches are relatively infrequent and occur when there is no work to be done.
In the blocking, connection-per-process approach, each connection requires a large amount of additional resources and overhead, and context switches (swapping from one process to another) are very frequent.
For a more detailed explanation, check out this [article][7] about NGINX architecture, by Andrew Alexeev, VP of Corporate Development and Co-Founder at NGINX, Inc.
With appropriate [system tuning][8], NGINX can scale to handle hundreds of thousands of concurrent HTTP connections per worker process, and can absorb traffic spikes (an influx of new games) without missing a beat.
### Updating Configuration and Upgrading NGINX ###
NGINXs process architecture, with a small number of worker processes, makes for very efficient updating of the configuration and even the NGINX binary itself.
![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png)
Updating NGINX configuration is a very simple, lightweight, and reliable operation. It typically just means running the `nginx s reload` command, which checks the configuration on disk and sends the master process a SIGHUP signal.
When the master process receives a SIGHUP, it does two things:
- Reloads the configuration and forks a new set of worker processes. These new worker processes immediately begin accepting connections and processing traffic (using the new configuration settings).
- Signals the old worker processes to gracefully exit. The worker processes stop accepting new connections. As soon as each current HTTP request completes, the worker process cleanly shuts down the connection (that is, there are no lingering keepalives). Once all connections are closed, the worker processes exit.
This reload process can cause a small spike in CPU and memory usage, but its generally imperceptible compared to the resource load from active connections. You can reload the configuration multiple times per second (and many NGINX users do exactly that). Very rarely, issues arise when there are many generations of NGINX worker processes waiting for connections to close, but even those are quickly resolved.
NGINXs binary upgrade process achieves the holy grail of high-availability you can upgrade the software on the fly, without any dropped connections, downtime, or interruption in service.
![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png)
The binary upgrade process is similar in approach to the graceful reload of configuration. A new NGINX master process runs in parallel with the original master process, and they share the listening sockets. Both processes are active, and their respective worker processes handle traffic. You can then signal the old master and its workers to gracefully exit.
The entire process is described in more detail in [Controlling NGINX][9].
### Conclusion ###
The [Inside NGINX infographic][10] provides a high-level overview of how NGINX functions, but behind this simple explanation is over ten years of innovation and optimization that enable NGINX to deliver the best possible performance on a wide range of hardware while maintaining the security and reliability that modern web applications require.
If youd like to read more about the optimizations in NGINX, check out these great resources:
- [Installing and Tuning NGINX for Performance][11] (webinar; [slides][12] at Speaker Deck)
- [Tuning NGINX for Performance][13]
- [The Architecture of Open Source Applications NGINX][14]
- [Socket Sharding in NGINX Release 1.9.1][15] (using the SO_REUSEPORT socket option)
--------------------------------------------------------------------------------
via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/
作者:[Owen Garrett][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://nginx.com/author/owen/
[1]:http://nginx.com/resources/library/infographic-inside-nginx/
[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes
[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex
[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/
[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition
[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/
[7]:http://www.aosabook.org/en/nginx.html
[8]:http://nginx.com/blog/tuning-nginx/
[9]:http://nginx.org/en/docs/control.html
[10]:http://nginx.com/resources/library/infographic-inside-nginx/
[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/
[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning
[13]:http://nginx.com/blog/tuning-nginx/
[14]:http://www.aosabook.org/en/nginx.html
[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/

View File

@ -1,3 +1,5 @@
FSSlc translating
LINUX 101: POWER UP YOUR SHELL
================================================================================
> Get a more versatile,featureful and colourful command line interface with our guide to shell basics.
@ -174,4 +176,4 @@ via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/
[3]:http://tinyurl.com/osopjv9
[4]:http://www.xiki.org/
[5]:http://ciembor.github.io/4bit
[6]:http://ethanschoonover.com/solarized
[6]:http://ethanschoonover.com/solarized

View File

@ -1,3 +1,4 @@
zpl1025
XBMC: build a remote control
================================================================================
**Take control of your home media player with a custom remote control running on your Android phone.**
@ -261,4 +262,4 @@ via: http://www.linuxvoice.com/xbmc-build-a-remote-control/
[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6
[3]:https://github.com/ben-ev/xbmc-remote
[4]:https://github.com/ben-ev/xbmc-remote
[5]:https://github.com/features
[5]:https://github.com/features

View File

@ -1,3 +1,5 @@
translating by wwy-hust
Tor Browser: An Ultimate Web Browser for Anonymous Web Browsing in Linux
================================================================================
Most of us give a considerable time of ours to Internet. The primary Application we require to perform our internet activity is a browser, a web browser to be more perfect. Over Internet most of ours activity is logged to Server/Client machine which includes IP address, Geographical Location, search/activity trends and a whole lots of Information which can potentially be very harmful, if used intentionally the other way.
@ -203,4 +205,4 @@ via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/
[a]:http://www.tecmint.com/author/avishek/
[1]:https://www.torproject.org/download/download-easy.html.en
[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi
[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi

View File

@ -1,100 +0,0 @@
3个开源的Python Shell
=========================================================================
Python是一个高级,通用,结构化且强大的开源编程语言用于广泛的编程工作。它拥有一个完全的动态类型系统和自动内存管理与SchemeRubyPerl和Tcl的十分相似避免编译型语言的许多复杂地方和难以理解。Python于1991年由Guido van Rossum创造然后逐渐成长流行。
Python是一个非常实用而且流行的计算机编程语言。使用一个如Python这样的解释型语言的好处之一就是可以借助其交互的shell考察式地编程。你可以试用代码而不必写一个脚本。但是Python shell也有一些局限性。基本来说有许多很nice的Python shell可选择都是在基础shell上扩展的。他们每一个都提供了一个极好的交互性的Python 体验。
--------------
### bpython ###
![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png)
对于LinuxBSDOS X和Windows来说bpython是Python解释器一个受欢迎的接口。
想法是提供给用户所有的内置功能很像现在的IDEs集成开发环境但是是在一个简单轻量级的包里可以在终端窗口里面运行。
bpython并不追求创造任何新的或者开创性的东西。相反她聚集了一些简洁的理念关注于实用性和操作性。
功能包括:
- 内置的语法高亮 - 使用Pygments排版你敲出的代码并合理地上色
- 根据你的行为,显示自动补全的建议。
- 为任何Python函数列出期望的参数 - 力求显示一列参数,为你调用的任何函数
- “Rewind”功能弹出内存里的最后一行代码并重新评定
- 发送你已经解除占用的代码到粘贴缓存
- 保存你已经输入到一个文件里的代码
- 自动缩进
- 支持Python 3
- 网址: [www.bpython-interpreter.org][1]
- 开发者: Bob Farrell and contributors
- 证书: MIT License
- 版本号: 0.14.1
----------
### IPython ###
![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png)
IPython是Python shell的一个交互加强版。她提供了一个丰富的工具集合帮助你交互式地充分利用Python。
IPython可以用来取代标准的Python shell或者当与标准Python 科学和数值处理工具配合用做一个科学计算如Matlab或者Mathematical的完整工作环境。她支持动态对象内省有限的输入/输出提示一个宏观系统会话登录会话恢复完整的系统接入详尽且彩色的追踪报告自动圆括号自动应用和可嵌入其他Python程序。
功能包括:
- 强大的交互Shell终端或者基于Qt
- 一个基于浏览器的记事本,支持代码,多样文本,数学表达式,内置飞行图表和其他丰富媒介。
- 支持交互式的数据虚拟化和GUI工具箱使用
- 灵活,嵌入式的解释器可以加载进你自己的项目里
- 易于使用,高效的并行运算工具
- 网址: [ipython.org][2]
- 开发者: The IPython Development Team
- 证书: BSD
- 版本号: 3.1
----------
### DreamPie ###
![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png)
DreamPie是一个为可靠性和兴趣设计的Python shell。
DreamPie可以用于任何Python解释器JythonIronPythonPyPy
功能包括:
- 一个交互shell的新概念窗口被分成历史区域和代码区域历史区域可以让你看到之前的命令及其输出代码区域是里敲代码的地方。这样你可以编辑任意数量的代码就好像在你最喜欢的编辑器里一样并且适当时候可以执行它。你也可以从其他地方复制你想保存的代码所以你可以把它存入一个文件。代码可以很好地格式化为四级缩进。
- 自动补全属性和文件名字
- 自动显示函数参数和文档
- 在结果历史中保存你最近的结果,备以后用
- 可以自动展开很长的输出,所以你可以专注于重要的地方
- 保存会话的历史记录为一个HTML文件备以后查询。你可以加载历史文件到DreamPie里并且快速回退到之前的命令。
- 自动添加圆括号与可选的引用当你在函数与方法后按下空格键。例如键入execfile fn并且获得execfile"fn"
- 支持交互的matplotlib绘图
- 支持Python 2.5Python 2.6Python 3.1Jython 2.5IronPython 2.6和PyPy
- 难以置信的快速反应
- 网址: [www.dreampie.org][3]
- 开发者: Noam Yorav-Raphael
- 证书: GNU GPL v3
- 版本号: 1.2.1
--------------------------------------------------------------------------------
via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html
作者Frazer Kline
译者:[wi-cuckoo](https://github.com/wi-cuckoo)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[1]:http://www.bpython-interpreter.org/
[2]:http://ipython.org/
[3]:http://www.dreampie.org/
--------------------------------------------------------------------------------

View File

@ -0,0 +1,67 @@
Linux下优秀的音频编辑软件
================================================================================
不论您是一个音乐爱好者或只是一个要记录您导师声音的学生您都需要录制音频和编辑音频。长久以来这样的工作都要靠Macintosh如今那个时代已经过去现在Linux也可以胜任这些工作了。简而言之这里有一份不完全的音频编辑器软件列表适用于不同的任务和需求。
### 1. Audacity ###
![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg)
让我们从我个人最喜欢的软件开始。[Audacity][1]可以运行在Windows、Mac和Linux上。它是开源的且易于使用。你会觉得Audacity几乎是完美的。它可以让您在干净的界面上操作音频波形。简单地说您可以覆盖音轨、剪切和修改音轨、增加特效、执行高级的声音分析然后将它们导出到一大堆可用的格式。我喜欢它的原因是它将基本的功能和复杂的功能结合在一起并且保持一个简单的学习曲线。然而它并不是一个完全最优化的软件尤其是对于音乐家和有着专业知识的人。
### 2. Jokosher ###
![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg)
在不同的层次上,[Jokosher][2]更多的聚焦在多音轨方面。它使用Python和GTK+作为前端借口并使用GStreamer作为音频后端。Jokosher那平滑的界面和它的扩展性给我留下了深刻的印象。也许编辑的功能并不是最先进的但它的语言十分清晰适合音乐家。例如我十分喜欢音轨和乐器的组合。简而言之如果您是一个音乐家那么它是在您转移到下一个软件前进行实践的好机会。
### 3. Ardour ###
![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg)
接下来谈论一些复杂的工具,[Ardour][3]是一套完整的可以录制、编辑和混音的软件。这个设计吸引所有的专业人员Ardour在声音和插件方面超出我的想象。如果您在寻找一头野兽并且不惧怕驯服他那么Ardour获取是一个不错的选择。再次它的接口和它丰富的文档尤其是它首次启动时的配置工具都是他迷人魅力的一部分。
### 4. Kwave ###
![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg)
对于所有KDE的热爱者[KWave][4]绝对符合您对于设计和功能的想象。它有丰富的快捷键以及很多有趣的选项,例如内存管理。尽管很多特效很不错,但我们更应该关注那些用于音频剪切/粘贴的工具。可惜的是它无法与Audacity相比而更重要的是该接口并没有那么吸引我。
### 5. Qtractor ###
![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg)
如果Kwave对您来说过于简单但基于Qt的程序却有些吸引力那么对您来说也许[Qtractor][5]是一个选项。它致力于做一个“对于家庭用户来说足够简单并且对专业人员来说足够强大的软件。”实际上它功能和选项的数量几乎是压倒性的。我最喜欢的当然是可定制的快捷键。除此之外Qtractor可能是我最喜欢的一个处理MIDI文件的工具。
### 6. LMMS ###
![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg)
作为Linux多媒体工作室LMMS的直接目标是音乐制作。如果您之前没有什么经验并且不想浪费太多的时间那么请去别处吧。LMMS是其中一个复杂但强大的软件只有少数的人真正的掌握了它。它有太多的功能和特效以至于无法一一列出但如果我必须找一个我会说用来模拟Game Boy声音系统的Freeboy插件简直像魔术一样。然后去看看它那惊人的文档吧。
### 7. Traverso ###
![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg)
最后站在我面前的是Traverso它支持无限制的音轨计数并直接整合了CD烧录的功能。另外它对我来说是介于简单的软件和专业的软件之间的程序。它的界面是KDE样式的其键盘配置很简单。更有趣的是Traverso会监视您的系统资源以确定不会超过您的CPU或者硬件的能力。
总而言之能在Linux系统上看到这么多不同的应用程序是一件开心的事。它使得您永远可以找到最适合自己的那一款。虽然我最喜欢的应用是Audacity但我非常震惊于LMMS和Jokosher的设计。
我们有漏掉什么么您在Linux下使用哪一款软件呢原因是什么呢请在留言处留言让我们知道。
--------------------------------------------------------------------------------
via: http://xmodulo.com/good-audio-editing-software-linux.html
作者:[Adrien Brochard][a]
译者:[wwy-hust](https://github.com/wwy-hust)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://xmodulo.com/author/adrien
[1]:http://audacity.sourceforge.net/
[2]:https://launchpad.net/jokosher/
[3]:http://ardour.org/
[4]:http://kwave.sourceforge.net/
[5]:http://qtractor.sourceforge.net/qtractor-index.html

View File

@ -0,0 +1,302 @@
20款优秀的Linux终端仿真器
================================================================================
终端仿真器是一款用其它显示结构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台客户机连接上了服务器。终端仿真器允许最终用户像文本用户界面和命令行界面一样连接控制台和应用程序。
![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg)
20款Linux终端仿真器
你能从开源世界中找到大量的终端仿真器来使用有些拥有大量的特性而有些则反之。为了能更好地理解它们所能提供的质量我们收集了一份不可思议的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。
### 1. Terminator ###
Terminator是一款先进且强大的终端仿真器它支持多终端窗口。这款仿真器可以完全自定义。你可以更改它的界面尺寸、颜色给它设置不同的形状。拥有高用户友好性且使用起来很有乐趣。
#### Terminator的特性 ####
- 自定义外形和配色方案,根据你的需要设置尺寸。
- 使用插件来获取更多功能。
- 快捷键可以加快普通操作。
- 可以把终端窗口分裂成几个虚拟终端并把它们重新设置成你需要的尺寸。
![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg)
Terminator Terminal
- [Terminator Homepage][1]
- [Download and Installation Instructions][2]
### 2. Tilda ###
Tilda是一款漂亮的基于GTK+的下拉式终端敲击一个键你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以添加你所选择的颜色来更改文本颜色和终端背景颜色。
#### Tilda的特性 ####
- 高度定制的选项界面设置。
- 你可以给Tilda设置透明度。
- 优秀的嵌入式配色方案。
![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg)
Tilda Terminal
- [Tilda Homepage][3]
### 3. Guake ###
Guake是一款基于python的下拉式终端诞生于GNOME桌面环境。按一个键就能调出再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏例如Quake其目标显而易见。
Guake与Yakuaka和Tilda非常相似不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和小片的C写成的(全局热键部分)。
![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg)
Guake Terminal
- [Guake Homepage][4]
### 4. Yakuake ###
Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器它与Guake再功能上非常相似。它的射击构思也是受FPS游戏的启发例如Quake。
Yakuake主要是一款KDE应用程序它能非常轻松地安装在KDE桌面上但是如果你试着将它安装在GNOME桌面上你将会安装大量的依赖包。
#### Yakuake的特性 ####
- 从屏幕顶端弹回顺畅
- 选项卡式界面
- 可配置的尺寸和动画速度
- 可定制
![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg)
Yakuake Terminal
- [Yakuake Homepage][5]
### 5. ROXTerm ###
ROXterm又是一款轻量级终端仿真器旨在提供与GNOME终端相似的特性。它原本创造出来是为了通过不使用Gnome库从而拥有更少的占用空间和更快的启动速度并使用独立的小程序来建立配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高一层的特性。
然而它比GNOME终端更加具有可制定性并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。
![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg)
Roxterm Terminal
- [ROXTerm Homepage][6]
### 6. Eterm ###
Eterm是最轻量级的一款彩色终端仿真器是作为xterm的替代品而被设计出来。它是以一种选择自由的思想、避免臃肿、灵活性和自由在用户手中是触手可及的理念而开发出来的。
![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg)
Eterm Terminal
- [Eterm Homepage][7]
### 7. Rxvt ###
代表着扩展虚拟终端的Rxvt是一款彩色终端仿真器为那些不需要一些特性例如Tektronix 4014仿真和toolkit-style可配置性的高级用户而生的xterm的替代品。
![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg)
Rxvt Terminal
- [Rxvt Homepage][8]
### 8. Wterm ###
Wterm是另一款以rxvt项目为基础的轻量级彩色终端仿真器。它所包含的特性包括设置背景图片、透明度、反向透明度和大量的设置或运行环境选项让它成为一款可高度自定义的终端仿真器。
![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg)
wterm Terminal
- [Wterm Homepage][9]
### 9. LXTerminal ###
LXTerminal是一款基于VTE的终端仿真器默认运行于没有任何多余依赖的LXDE(轻量级X桌面环境)下。这款终端有很多很棒的特性。
#### LXTerminal的特性 ####
- 多标签支持
- 支持普通命令如cp, cd, dir, mkdir, mvdir
- 隐藏菜单栏以保证足够界面空间
- 更改配色方案
![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg)
lxterminal Terminal
- [LXTerminal Homepage][10]
### 10. Konsole ###
Konsole是另一款强大的基于KDE的免费终端仿真器最初由Lars Doelle创造。
#### Konsole的特性 ####
- 多标签式终端
- 半透明背景
- 支持拆分视图模式
- 目录和SSH书签化
- 可定制的配色方案
- 可定制的按键绑定
- 终端中的活动通知警告
- 增量搜索
- 支持Dolphin文件管理器
- 普通文本和HTML格式输出出口
![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg)
Konsole Terminal
- [Konsole Homepage][11]
### 11. TermKit ###
TermKit是一款漂亮简洁的终端其目标是用在Google Chrome和Chromium中广泛被使用的WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图。TermKit起初是为Mac和Windows设计的但是由于TermKit被Floby给fork并做了修改现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。
![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg)
TermKit Terminal
- [TermKit Homepage][12]
### 12. st ###
st是一款简单的X Window终端实现接口。
![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png)
st terminal
- [st Homepage][13]
### 13. Gnome-Terminal ###
GNOME终端是一款在GNOME桌面环境下的嵌入式终端仿真器由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下的同时使用一个真实的Linux shell来运行命令。GNOME终端是模拟的xterm终端仿真器并带来了一些相似的特性。
Gnome终端支持多用户用户可以为他们的账户创建多个用户每个用户能自定义配置选项如字体、颜色、背景图片、行为习惯等等并能分别给它们取名。它也支持鼠标事件、url探测、多标签等。
![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg)
Gnome Terminal
- [Gnome Terminal][14]
### 14. Final Term ###
Final Term是一款漂亮的开源终端仿真器在这一个界面里蕴藏着一些令人激动的功能和特性。虽然它仍然有待改进但是它提供了一些重要的特性比如Semantic文本菜单、智能的命令行实现、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性点开来看看吧。
![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif)
FinalTerm Terminal
- [Final Term][15]
### 15. Terminology ###
Terminology是一款新的现代化终端仿真器为Enlightenment桌面创造但也能用于其它桌面环境。它有一些独一无二的棒极了的特性这是其它终端仿真器所不具备的。
抛开这些特性terminology甚至还提供了你无法从其它仿真器看到的东西比如图像、视频和文档的缩略图预览它允许你从Terminology直接就能看到那些文件。
你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰但足以让你了解Terminology了)。
<iframe width="630" height="480" frameborder="0" allowfullscreen="" src="//www.youtube.com/embed/ibPziLRGvkg"></iframe>
- [Terminology][16]
### 16. Xfce4 terminal ###
Xfce终端是一款轻量级的现代化终端仿真器它简单易用为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性比如搜索会话、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。
![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg)
Xfce Terminal
- [Xfce4 Terminal][17]
### 17. xterm ###
xterm应用程序是一款标准的在X Window系统上的终端仿真器。它保持了DEC VT102和Tektronix 4014让应用能直接使用X Window系统。
![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg)
xterm Terminal
- [xterm][18]
### 18. LilyTerm ###
LilyTerm是一款基于libvte的开源终端仿真器这款不太出名的仿真器追求的是快速和轻量级。LilyTerm也包括一些关键特性
- 支持标签移动、着色以及标签重新排序
- 通过快捷键管理标签
- 支持背景透明化和饱和度调整
- 支持为特定用户创建配置文件
- 若干个自定义选项
- 广泛支持UTF-8
![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg)
Lilyterm Terminal
- [LilyTerm][19]
### 19. Sakura ###
Sakura是另一款不知名的Unix风格终端仿真器按照命令行模式和基于文本的终端程序开发。Sakura基于GTK和livte自身特性不多不过还是有一些自定义选项比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。
![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg)
Sakura Terminal
- [Sakura][20]
### 20. rxvt-unicode ###
rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器支持xft和unicode由Marc Lehmann开发。它有许多显著特性比如支持Unicode上的国际语言能显示多种字体类型并支持Perl扩展。
![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png)
rxvt unicode
- [rxvt-unicode][21]
如果你知道任何其它强大的Linux终端仿真器而上文未提及欢迎在评论中与我们分享。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/linux-terminal-emulators/
作者:[Ravi Saive][a]
译者:[ZTinoZ](https://github.com/ZTinoZ)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:https://launchpad.net/terminator
[2]:http://www.tecmint.com/terminator-a-linux-terminal-emulator-to-manage-multiple-terminal-windows/
[3]:http://tilda.sourceforge.net/tildaabout.php
[4]:https://github.com/Guake/guake
[5]:http://extragear.kde.org/apps/yakuake/
[6]:http://roxterm.sourceforge.net/index.php?page=index&lang=en
[7]:http://www.eterm.org/
[8]:http://sourceforge.net/projects/rxvt/
[9]:http://sourceforge.net/projects/wterm/
[10]:http://wiki.lxde.org/en/LXTerminal
[11]:http://konsole.kde.org/
[12]:https://github.com/unconed/TermKit
[13]:http://st.suckless.org/
[14]:https://help.gnome.org/users/gnome-terminal/stable/
[15]:http://finalterm.org/
[16]:http://www.enlightenment.org/p.php?p=about/terminology
[17]:http://docs.xfce.org/apps/terminal/start
[18]:http://invisible-island.net/xterm/
[19]:http://lilyterm.luna.com.tw/
[20]:https://launchpad.net/sakura
[21]:http://software.schmorp.de/pkg/rxvt-unicode

View File

@ -0,0 +1,435 @@
Linux 下如何处理包含空格和特殊字符的文件名
================================================================================
我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母-数字文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。
** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只处理文本文件(.txt
最常见的文件名例子:
abc.txt
avi.txt
debian.txt
...
数字文件名例子:
121.txt
3221.txt
674659.txt
...
字母数字文件名例子:
eg84235.txt
3kf43nl2.txt
2323ddw.txt
...
包含特殊字符的文件名的例子,并不常见:
#232.txt
#bkf.txt
#bjsd3469.txt
#121nkfd.txt
-2232.txt
-fbjdew.txt
-gi32kj.txt
--321.txt
--bk34.txt
...
一个显而易见的问题是 - 在这个星球上有谁会创建/处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。
我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说Linux 下的一切比如文件夹,驱动器或其他所有的都被当作文件处理。
### 处理名字包含破折号(-)的文件 ###
创建以破折号`(-)`开头的文件,比如 -abx.txt。
$ touch -abc.txt
#### 测试输出 ####
touch: invalid option -- 'b'
Try 'touch --help' for more information.
出现上面错误的原因是shell 把破折号`(-)`之后的内容认作参数了,而很明显没有这样的参数,所以报错。
要解决这个问题,我们得告诉 Bash shell是的这里以及本文后面的大多数例子都是基于 BASH 环境)不要将特殊字符(这里是破折号)后的字符解释为参数。
有两种方法解决这个错误:
$ touch -- -abc.txt [方法 #1]
$ touch ./-abc.txt [方法 #2]
你可以通过运行命令 ls 或 [ls -l][1] 列出详细信息来检查通过上面两种方式创建的文件。
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 11:05 -abc.txt
要编辑上述文件可以这样:
$ nano -- -abc.txt
或者
$ nano ./-abc.txt
**注意**:你可以将 nano 替换为任何其他你喜欢的编辑器比如说 vim
$ vim -- -abc.txt
或者
$ vim ./-abc.txt
如果只是简单地移动文件可以这样:
$ mv -- -abc.txt -a.txt
或者
$ mv -- -a.txt -abc.txt
删除这种文件,可以这样:
$ rm -- -abc.txt
或者
$ rm ./-abc.txt
如果一个目录下有大量这种名字包含破折号的文件,要一次全部删除的话,可以这样:
$ rm ./-*
**重要:**
1. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件。就是说,-a-b-c.txtab-c.txtabc-.txt等等。
2. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`
$ rm -rf -- -abc
或者
$ rm -rf ./-abc
### 处理名字包含井号(#)的文件 ###
符号`#`在 BASH 里有非常特别的含义。`#`之后的一切都会被认为是评论,因此会被 BASH 忽略。
**通过例子来加深理解:**
创建一个名字是 #abc.txt 的文件:
$ touch #abc.txt
#### 测试输出 ####
touch: missing file operand
Try 'touch --help' for more information.
出现上面错误的原因是BASH 将 #abc.txt 解释为评论而忽略了。所以[命令 touch][2]没有收到任何文件作为参数,所以导致这个错误。
要解决这个问题,你肯能需要告诉 BASH 不要将 # 解释为评论。
$ touch ./#abc.txt
或者
$ touch '#abc.txt'
检查刚创建的文件:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:14 #abc.txt
现在创建名字中除了开头的其他地方包含 # 的文件。
$ touch ./a#bc.txt
$ touch ./abc#.txt
或者
$ touch 'a#bc.txt'
$ touch 'abc#.txt'
运行 ls -l 来检查:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:16 a#bc.txt
-rw-r--r-- 1 avi avi 0 Jun 8 12:16 abc#.txt
如果同时创建两个文件(比如 a 和 #bc)会怎么样:
$ touch a.txt #bc.txt
检查刚创建的文件:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:18 a.txt
很明显上面的例子中只创建了文件 `a` 而文件 `#bc` 被忽略了。对于上面的情况我们可以这样做,
$ touch a.txt ./#bc.txt
或者
$ touch a.txt '#bc.txt'
检查一下:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 12:20 a.txt
-rw-r--r-- 1 avi avi 0 Jun 8 12:20 #bc.txt
可以这样移动文件:
$ mv ./#bc.txt ./#cd.txt
或者
$ mv '#bc.txt' '#cd.txt'
这样拷贝:
$ cp ./#cd.txt ./#de.txt
或者
$ cp '#cd.txt' '#de.txt'
可以使用你喜欢的编辑器来编辑文件:
$ vi ./#cd.txt
或者
$ vi '#cd.txt'
----------
$ nano ./#cd.txt
或者
$ nano '#cd.txt'
这样删除:
$ rm ./#bc.txt
或者
$ rm '#bc.txt'
要删除所有以井号(#)开头的文件,可以这样:
# rm ./#*
### 处理名字包含分号(;)的文件 ###
如果你还不知道的话,分号在 BASH 里起到命令分隔的作用,其他 shell 可能也是一样的。分号作为分隔符可以让你一次执行几个命令。你碰到过名字包含分号的文件吗?如果没有的话,这里有例子。
创建一个名字包含分号的文件。
$ touch ;abc.txt
#### 测试输出 ####
touch: missing file operand
Try 'touch --help' for more information.
bash: abc.txt: command not found
出现上面错误的原因是,在运行上面命令的时候 BASH 会把 touch 解释为一个命令但是在分号前没有任何文件参数,所以报告错误。然后报告的另一个错误找不到命令 `abc.txt`,只是因为在分号后 BASH 会期望另一个新的命令,而 `abc.txt` 并不是一个命令。
要解决这个问题,我们得告诉 BASH 不要将分号解释为命令分隔符,例如:
$ touch ./';abc.txt'
或者
$ touch ';abc.txt'
**注意**:我们将文件名用单引号 '' 包含起来。这样可以告诉 BASH 分号 ; 是文件名的一部分而不是命令分隔符。
对名字包含分号的文件和文件夹的其他操作(就是,拷贝、移动、删除)可以直接将名字用单引号包含起来就好了。
### 处理名字包含其他特殊字符的文件/文件夹 ###
#### 文件名包含加号 (+) ####
不需要任何特殊处理,按平时的方式做就好了,比如下面测试的文件名。
$ touch +12.txt
#### 文件名包含美元符 ($) ####
你需要将文件名用单引号括起来,像处理分号那样的方式。然后就很简单了。
$ touch '$12.txt'
#### 文件名包含百分号 (%) ####
不需要任何特殊处理,当作一个普通文件就可以了。
$ touch %12.txt
#### 文件名包含星号 (*) ####
名字包含星号的文件没有改变太多,你仍然可以把它当作一个普通文件。(注:星号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch *12.txt
注意:当你需要删除星号开头的文件时,千万不要用类似下面的命令。
$ rm *
或者
$ rm -rf *
而是用这样的命令,(注:这个命令是删除当前目录所有.txt文件。。。
$ rm ./*.txt
#### 文件名包含叹号 (!) ####
只要将文件名用单引号括起来,其他的就一样了。
$ touch '!12.txt'
#### 文件名包含小老鼠 (@) ####
没有什么特别的,可以将名字包含小老鼠的文件当作普通文件。
$ touch '@12.txt'
#### 文件名包含 ^ ####
不需要特殊处理。可以将名字包含 ^ 的文件当作普通文件。
$ touch ^12.txt
#### 文件名包含 (&) ####
将文件名用单引号括起来,然后就可以操作了。
$ touch '&12.txt'
#### 文件名包含括号 () ####
如果文件名包含括号,你需要将文件名用单引号括起来。
$ touch '(12.txt)'
#### 文件名包含花括号 {} ####
不需要特别注意。可以当作普通文件处理。(注:花括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch {12.txt}
#### 文件名包含尖括号 <> ####
名字包含尖括号的文件需要用单引号括起来。
$ touch '<12.txt>'
#### 文件名包含方括号 [ ] ####
名字包含方括号的文件可以当作普通文件,不用特别处理。(注:方括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch [12.txt]
#### 文件名包含下划线 (_) ####
这个非常普遍不需要特殊对待。当作普通文件随意处理。
$ touch _12.txt
#### 文件名包含等号 (=) ####
文件名包含等号不会改变任何事情,你可以当作普通文件。(注:等号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch =12.txt
#### 处理反斜杠 (\) ####
反斜杠会告诉 shell 忽略后面字符的特殊含义。你必须将文件名用单引号括起来,就像处理分号那样。其他的就没什么了。
$ touch '\12.txt'
#### 包含斜杠的特殊情形 ####
除非你的文件系统有问题,否则你不能创建名字包含斜杠的文件。没办法转义斜杠。
所以如果你能创建类似 /12.txt 或者 b/c.txt 这样的文件,那要么你的文件系统有问题,或者支持 Unicode这样你可以创建包含斜杠的文件。只是这样并不是真的斜杠而是一个看起来像斜杠的 Unicode 字符。
#### 文件名包含问号 (?) ####
再一次,这个也是不需要特别处理的情况。名字包含问号的文件可以和大多数情况一样对待。(注:问号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch ?12.txt
#### 文件名包含点 (.) ####
在 Linux 里以点 `(.)` 开头的文件非常特别,被称为点文件。它们通常是隐藏的配置文件或系统文件。你需要使用 ls 命令的 -a-A 开关来查看这种文件。
创建,编辑,重命名和删除这种文件很直接。
$ touch .12.txt
注意:在 Linux 里你可能碰到名字包含许多点 `(.)` 的文件。不像其他操作系统,文件名里的点并不意味着分隔名字和扩展后缀。你可以创建名字包含多个点的文件:
$ touch 1.2.3.4.5.6.7.8.9.10.txt
检查一下:
$ ls -l
total 0
-rw-r--r-- 1 avi avi 0 Jun 8 14:32 1.2.3.4.5.6.7.8.9.10.txt
#### 文件名包含逗号 (,) ####
你可以在文件名中使用逗号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。
$ touch ,12.txt
或者
$ touch ,12,.txt
#### 文件名包含冒号 (:) ####
你可以在文件名中使用冒号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。(注:冒号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch :12.txt
或者
$ touch :12:.txt
#### 文件名包含引号(单引号和双引号) ####
要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。
$ touch "15'.txt"
以及
$ touch '15”.txt'
#### 文件名包含波浪号 (~) ####
Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如:(注:波浪号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义)
$ touch ~1a.txt
或者
$touch 2b~.txt
#### 文件名包含空格 ####
创建名字的字符/单词之间包含空格的文件,比如 “hi my name is avishek.txt”。
最好不要在文件名里使用空格,如果你必须要分隔可读的名字,可以使用下划线或横杠。不过,你还是需要创建这样的文件的话,你可以用反斜杠来转义下一个字符。要创建上面名字的文件可以这样做。
$ touch hi\ my\ name\ is\ avishek.txt
hi my name is avishek.txt
我已经尝试覆盖你可能碰到的所有情况。上面大多数测试都在 BASH Shell 里完成,可能在其他 shell 下会有差异。
如果你觉得我遗漏了什么(这很正常也符合人性),请把你的建议发表到下面的评论里。保持联系,多评论。不要走开!求点赞求分享求扩散!
--------------------------------------------------------------------------------
via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/
作者:[Avishek Kumar][a]
译者:[zpl1025](https://github.com/zpl1025)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/

View File

@ -0,0 +1,174 @@
NGINX内部: 我们如何设计性能和扩展
================================================================================
NGINX是web应用中性能最好的一个这一切都是由于软件设计。而许多web服务器和应用程序服务器使用一个简单的线程或基于流程的架构NGINX立足于一个复杂的事件驱动的体系结构使它能够在现代硬件上扩展到成千上万的并发连接。
[NGINX内部][1]信息图从高级流程架构深度挖掘说明了NGINX如何在单进程里保持多连接。这个博客进一步详细地解释了这一切是如何工作的。
### 知识 NGINX进程模型 ###
![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png)
为了更好的理解这个设计你需要理解NGINX如何运行的。NGINX有一个主进程它执行特权操作如读取配置和绑定端口和一些工作进程与辅助进程。
# service nginx restart
* Restarting nginx
# ps -ef --forest | grep nginx
root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \
-c /etc/nginx/nginx.conf
nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process
nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process
nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process
在四核服务器NGINX主进程创建4工作进程和两个管理磁盘内容缓存的缓存辅助进程。
### 为什么架构很重要? ###
任何Unix应用程序的根本基础是线程或进程。从Linux操作系统的角度来看线程和进程大多是相同的,主要的区别是他们共享内存的程度。)一个线程或进程是一个独立的指令,操作系统可以运行在一个CPU核心。大多数复杂的应用程序并行运行多个线程或进程有两个原因
- 他们可以同时使用更多的计算核心。
- 线程或进程可以轻松实现并行操作。(例如,在同一时刻保持多连接)。
进程和线程消耗资源。他们每个都使用内存和其他系统资源他们需要被交换进出核心一个操作可以叫做上下文切换。大多数现代服务器可以保持上百小型、活动的并发连接一旦内存耗尽或高I/O压力引起大量的上下文切换性能会严重下降。
网络应用程序设计的常用方法是为每个连接分配一个线程或进程。此体系结构简单、容易实现,但是当应用程序需要处理成千上万的并发连接时这种结构不具规模。
### NGINX如何工作 ###
NGINX使用一种可预测进程模式被调到了可使用的硬件资源上
- 主进程执行特权操作,如读取配置和绑定端口,然后创建一个小数量的子进程(接下来的三种类型)。
- 缓存加载程序进程在加载磁盘缓存到内存中时开始运行,然后退出。它被适当的安排,所以其资源需求很低。
- 缓存管理器进程定期修剪磁盘缓存中的记录来保持他们在配置的大小之内。
- 工作进程做所有的工作!他们保持网络连接、读写内容到磁盘,与上游服务器通信。
在大多数情况下建议NGINX的配置 每个CPU核心运行一个工作进程 最有效地利用硬件资源。你的配置包含了[worker_processes auto][2]指令配置:
worker_processes auto;
当一个NGINX服务处于活动状态只有工作进程是忙碌的。每个工作进程以非阻塞方式保持多连接减少上下文交换。
每个工作进程是一个单线程并且独立运行,获取新链接并处理他们。这些进程可以使用共享内存通信来共享缓存数据,会话持久性数据,和其他共享资源。
### NGINX工作进程内部 ###
![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png)
NGINX主进程通过NGINX配置初始化每个工作进程并提供一组监听端口。
NGINX工作进程首先在监听套接字上等待事件[accept_mutex][3]和[内核套接字分片][4])。事件被新进来的链接初始化。这些连接被分配到一个状态机 HTTP状态机是最常用的,但NGINX也具备流式(原始的TCP)状态机和大量的邮件协议SMTP、IMAP和POP3
![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png)
状态机本质上是一组指令,告诉NGINX如何处理一个请求。大多数web服务器执行相同的函数作为NGINX使用类似的状态机 - 区别在于实现。
### 调度状态机 ###
把状态机想象成国际象棋的规则。每个HTTP事务是一个象棋游戏。一方面棋盘是web服务器 一位大师可以非常迅速地做出决定。另一方面是远程客户端 在一个相对较慢的网络下web浏览器访问网站或应用程序。
不管咋地这个游戏规则很复杂。例如web服务器可能需要与各方沟通(代理一个上游的应用程序)或与身份验证服务器对话。web服务器的第三方模块甚至可以扩展游戏规则。
#### 一个阻塞状态机 ####
回忆我们描述一个进程或线程就像一个独立的指令集,操作系统可以调度运行它在一个CPU核心。大多数web服务器和web应用使用一个进程一个链接或者一个线程一个链接的模式来运行这个“象棋游戏”。每个进程或线程都包含指令来玩“一个游戏”直到结束。一次进程在服务器运行它花费大部分的时间“阻塞” - 等待客户端完成它的下一步行动。
![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png)
1. web服务器进程在监听套接字监听新连接客户端发起新“游戏”
1. 当它获得一个新游戏,就玩这个游戏,每走一步去等待客户端响应时就阻塞了。
1. 游戏完成后web服务器进程可能会等待是否有客户机想要开始一个新游戏这对应于一个保持连接。如果这个链接关闭了客户端离开或者发生超时web服务器进程返回监听一个新“游戏”。
要记住最重要的一点是每个活动的HTTP链接每局棋需要一个专用的进程或线程象棋高手。这个结构简单容并且易扩展第三方模块“新规则”。无论如何还是有巨大的不平衡尤其是轻量的HTTP链接作为代表是一个文件描述符和小量的内存映射到一个单独的线程或进程一个非常重量的系统对象。这种方式易于编程,但太过浪费。
#### NGINX是一个真正的象棋大师 ####
也许你听过[同时表演赛][5]游戏,有一个象棋大师同时对战许多对手?
![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif)
[列夫·吉奥吉夫在保加利亚的索非亚同时对阵360人][6]。他的最终成绩是284胜70平6负。
这就是NGINX工作进程如何“下棋”的。每个工作进程记住 - 通常每个CPU核心上有一个工作进程是一个可同时对战上百人事实是成百上千的象棋大师。
![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png)
1. 工作进程在监听和链接套接字上等待事件。
1. 事件发生在套接字并且由工作进程处理它们:
- 在监听套接字的事件意味着一个客户端已经开始了一局新棋局。工作进程创建了一个新链接套接字。
- 在链接套接字的事件意味着客户端已经下了一步棋。工作进程快速的响应。
一个工作进程在网络流量上从不阻塞,等待它的“对手”(客户端)做出反应。当它下了一步,工作进程立即继续其他的游戏,在那里工作进程正在处理下一步,或者在门口欢迎一个新玩家。
### 为什么这个比阻塞式多进程架构更快? ###
NGINX每个工作进程很好的扩展支撑了成百上千的链接。每个链接在工作进程中创建另一个文件描述符和消耗一小部分额外内存。每个链接很少有额外的开销。NGINX进程可以固定在一些CPU上。上下文交换非常罕见只发生在没有工作要做。
阻塞方式,一个链接一个进程的方法中,每个连接需要大量额外的资源和开销,和上下文切换(从一个进程切换到另一个)非常频繁
更详细的解释,看看这个[文章][7]关于NGINX架构由NGINX公司发展副总裁和创始人之一 Andrew Alexeev 著。
适当的[系统优化][8],NGINX的每个工作进程可以扩展来处理成千上万的并发HTTP连接,并能脸不红心不跳的承受峰值流量(大量涌入的新“游戏”)。
### 更新配置和升级NGINX ###
NGINX是过程体系架构有一小部分工作进程有助于有效的更新配置文件甚至NGINX程序本身。
![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png)
更新NGINX配置文件是非常简单、轻量、可靠的操作。它通常意味着运行命令`nginx s reload`所做的就是检查磁盘上的配置并发送SIGHUP信号给主进程。
当主进程接收到一个SIGHUP信号它会做两件事
- 重载配置文件和分出一组新的工作进程。这些新的工作进程立即开始接受连接和处理流量(使用新的配置设置)
- 通知旧的工作进程优雅的退出。工作进程停止接受新的链接。当前的http请求一完成工作进程就彻底关闭这个链接那就是没有残存的保持链接。一旦所有链接关闭这个工作进程就退出。
这个重载过程能引发一个CPU和内存使用的小峰值但是跟活动链接加载的支援比它一般不易察觉。你可以每秒多次重载配置很多NGINX用户都这么做。很少情况下问题发生在很多代的工作进程等待关闭连接时但即使是那样也很快被解决了。
NGINX的程序升级过程中实现了高可用的圣杯 - 你可以随随时更新这个软件,不会丢失连接,停机,或者中断服务。
![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png)
程序升级过程很像优雅的重载配置的方法。一个新的NGINX主进程与原主进程并行运行然后他们共享监听套接字。两个进程都是活动的并且各自的工作进程处理流量。然后你可以通知旧主进程和他的工作进程优雅的退出。
整个进程的详细描述在[NGINX管理][9].
### 结论 ###
[NGINX内部信息图][10] 提供一个NGINX功能实现的高级的概况但在这简单的解释是超过十年的创新和优化使Nginx在一个范围广泛的硬件上提供尽可能最好的性能同时保持现代Web应用程序需要的安全性和可靠性。
如果你想阅读更多关于NGINX的优化查看这些优秀的资源
- [Installing and Tuning NGINX for Performance][11] (webinar; [slides][12] at Speaker Deck)
- [Tuning NGINX for Performance][13]
- [The Architecture of Open Source Applications NGINX][14]
- [Socket Sharding in NGINX Release 1.9.1][15] (using the SO_REUSEPORT socket option)
--------------------------------------------------------------------------------
via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/
作者:[Owen Garrett][a]
译者:[wyangsun](https://github.com/wyangsun)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://nginx.com/author/owen/
[1]:http://nginx.com/resources/library/infographic-inside-nginx/
[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes
[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex
[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/
[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition
[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/
[7]:http://www.aosabook.org/en/nginx.html
[8]:http://nginx.com/blog/tuning-nginx/
[9]:http://nginx.org/en/docs/control.html
[10]:http://nginx.com/resources/library/infographic-inside-nginx/
[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/
[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning
[13]:http://nginx.com/blog/tuning-nginx/
[14]:http://www.aosabook.org/en/nginx.html
[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/

View File

@ -1,64 +1,64 @@
Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0
在RHEL/CentOS 7.0中安装LAMPLinux、 Apache、 MariaDB、 PHP/PhpMyAdmin
================================================================================
Skipping the LAMP introduction, as Im sure that most of you know what is all about. This tutorial will concentrate on how to install and configure famous LAMP stack Linux Apache, MariaDB, PHP, PhpMyAdmin on the last release of Red Hat Enterprise Linux 7.0 and CentOS 7.0, with the mention that both distributions have upgraded httpd daemon to Apache HTTP 2.4.
跳过LAMP的介绍因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到Apache 2.4的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0中安装和配置LAMP-Linux Apache、 MariaDB、 PHP、PhpMyAdmin。
![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg)
Install LAMP in RHEL/CentOS 7.0
在RHEL/CentOS 7.0中安装LAMP
#### Requirements ####
#### 要求 ####
Depending on the used distribution, RHEL or CentOS 7.0, use the following links to perform a minimal system installation, using a static IP Address for network configuration.
根据使用的发行版RHEL 或者 CentOS 7.0使用下面的链接来执行最小的系统安装网络使用静态ip
**For RHEL 7.0**
**对于RHEL 7.0**
- [RHEL 7.0 Installation Procedure][1]
- [Register and Enable Subscriptions/Repositories on RHEL 7.0][2]
- [RHEL 7.0安装过程][1]
- [在RHEL 7.0中注册和启用订阅仓库][2]
**For CentOS 7.0**
**对于 CentOS 7.0**
- [CentOS 7.0 Installation Procedure][3]
- [CentOS 7.0 安装过程][3]
### Step 1: Install Apache Server with Basic Configurations ###
### 第一步: 使用基本配置安装apache ###
**1. After performing a minimal system installation and configure your server network interface with a [Static IP Address on RHEL/CentOS 7.0][4], go ahead and install Apache 2.4 httpd service binary package provided form official repositories using the following command.**
**1. 在执行最小系统安装并配置[在RHEL/CentOS 7.0中配置静态ip][4]**就可以从使用下面的命令从官方仓库安装最新的Apache 2.4 httpd服务。
# yum install httpd
![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png)
Install Apache Web Server
安装apache服务
**2. After yum manager finish installation, use the following commands to manage Apache daemon, since RHEL and CentOS 7.0 both migrated their init scripts from SysV to systemd you can also use SysV and Apache scripts the same time to manage the service.**
**2. 安装安城后使用下面的命令来管理apache守护进程因为RHEL and CentOS 7.0都将init脚本从SysV升级到了systemd - 你也可以同事使用SysV和Apache脚本来管理服务。**
# systemctl status|start|stop|restart|reload httpd
OR
或者
# service httpd status|start|stop|restart|reload
OR
或者
# apachectl configtest| graceful
![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png)
Start Apache Web Server
启动apache服务
**3. On the next step start Apache service using systemd init script and open RHEL/CentOS 7.0 Firewall rules using firewall-cmd, which is the default command to manage iptables through firewalld daemon.**
**3. 下一步使用systemd初始化脚本来启动apache服务并用firewall-cmd打开RHEL/CentOS 7.0防火墙规则, 这是通过firewalld守护进程管理iptables的默认命令。**
# firewall-cmd --add-service=http
**NOTE**: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart, because it opens on-fly rules, which are not applied permanently. To apply consistency iptables rules on firewall use permanent option and restart firewalld service to take effect.
**注意**上面的命令会在系统重启或者firewalld服务重启后失效因为它是即时的规则它不会永久生效。要使iptables规则在fiewwall中持久化使用-permanent选项并重启firewalld服务来生效。
# firewall-cmd --permanent --add-service=http
# systemctl restart firewalld
![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png)
Enable Firewall in CentOS 7
在CentOS 7中启用Firewall
Other important Firewalld options are presented below:
下面是firewalld其他的重要选项
# firewall-cmd --state
# firewall-cmd --list-all
@ -67,37 +67,38 @@ Other important Firewalld options are presented below:
# firewall-cmd --query-service service_name
# firewall-cmd --add-port=8080/tcp
**4. To verify Apache functionality open a remote browser and type your server IP Address using HTTP protocol on URL (http://server_IP), and a default page should appear like in the screenshot below.**
**4. 要验证apache的功能打开一个远程浏览器并使用http协议输入你服务器的ip地址(http://server_IP), 应该会显示下图中的默认页面。**
![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png)
Apache Default Page
Apache默认页
**5. For now, Apache DocumentRoot path its set to /var/www/html system path, which by default doesnt provide any index file. If you want to see a directory list of your DocumentRoot path open Apache welcome configuration file and set Indexes statement from to + on <LocationMach> directive, using the below screenshot as an example.**
**5. 现在apache的根地址在/var/www/html该目录中没有提供任何index文件。如果你想要看见根目录下的文件夹列表打开apache欢迎配置文件并设置 <LocationMach>下Indexes前的状态从-到+,下面的截图就是一个例子。**
# nano /etc/httpd/conf.d/welcome.conf
![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png)
Apache Directory Listing
Apache目录列出
**6. Close the file, restart Apache service to reflect changes and reload your browser page to see the final result.**
**6. 关闭文件重启apache服务来使设置生效重载页面来看最终效果。**
# systemctl restart httpd
![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png)
Apache Index File
Apache Index 文件
### Step 2: Install PHP5 Support for Apache ###
### 第二步: 为Apache安装php5支持 ###
**7. Before installing PHP5 dynamic language support for Apache, get a full list of available PHP modules and extensions using the following command.**
**7. 在为apache安装php支持之前使用下面的命令的得到所有可用的php模块和扩展。**
# yum search php
![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png)
Install PHP in CentOS 7
**8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.**
@ -140,22 +141,22 @@ Set Timezone in PHP
![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png)
Install MariaDB in CentOS 7
在CentOS 7中安装PHP
**12. After MariaDB package is installed, start database daemon and use mysql_secure_installation script to secure database (set root password, disable remotely logon from root, remove test database and remove anonymous users).**
***12. 安装MariaDB后开启数据库守护进程并使用mysql_secure_installation脚本来保护数据库设置root密码、禁止远程root登录、移除测试数据库、移除匿名用户**
# systemctl start mariadb
# mysql_secure_installation
![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png)
Start MariaDB Database
启动MariaDB数据库
![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png)
Secure MySQL Installation
MySQL安全设置
**13. To test database functionality login to MariaDB using its root account and exit using quit statement.**
**13. 要测试数据库功能使用root账户登录MariaDB并用quit退出。**
mysql -u root -p
MariaDB > SHOW VARIABLES;
@ -163,27 +164,27 @@ Secure MySQL Installation
![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png)
Connect MySQL Database
连接MySQL数据库
### Step 4: Install PhpMyAdmin ###
### 第四步: 安装PhpMyAdmin ###
**14. By default official RHEL 7.0 or CentOS 7.0 repositories doesnt provide any binary package for PhpMyAdmin Web Interface. If you are uncomfortable using MySQL command line to manage your database you can install PhpMyAdmin package by enabling CentOS 7.0 rpmforge repositories using the following command.**
**14. RHEL 7.0 或者 CentOS 7.0仓库默认没有提供PhpMyAdmin二进制安装包。如果你不适应使用MySQL命令行来管理你的数据库你可以通过下面的命令启用CentOS 7.0 rpmforge仓库来安装PhpMyAdmin。**
# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
After enabling rpmforge repository, next install PhpMyAdmin.
启用rpmforge仓库后下面安装PhpMyAdmin。
# yum install phpmyadmin
![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png)
Enable RPMForge Repository
启用RPMForge仓库
**15. Next configure PhpMyAdmin to allow connections from remote hosts by editing phpmyadmin.conf file, located on Apache conf.d directory, commenting the following lines.**
**15. 下面配置PhpMyAdmin的phpmyadmin.conf来允许远程连接它位于Apache conf.d目录下并注释掉下面的行。**
# nano /etc/httpd/conf.d/phpmyadmin.conf
Use a # and comment this lines.
使用#来注释掉行。
# Order Deny,Allow
# Deny from all
@ -191,40 +192,40 @@ Use a # and comment this lines.
![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png)
Allow Remote PhpMyAdmin Access
允许远程PhpMyAdmin访问
**16. To be able to login to PhpMyAdmin Web interface using cookie authentication method add a blowfish string to phpmyadmin config.inc.php file like in the screenshot below using the [generate a secret string][6], restart Apache Web service and direct your browser to the URL address http://server_IP/phpmyadmin/.**
**16. 要使用cookie验证来登录PhpMyAdmin像下面的截图那样使用[生成字符串][6]添加一个blowfish字符串到config.inc.php文件下重启apache服务并打开URLhttp://server_IP/phpmyadmin/。**
# nano /etc/httpd/conf.d/phpmyadmin.conf
# systemctl restart httpd
![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png)
Add Blowfish in PhpMyAdmin
在PhpMyAdmin中添加Blowfish
![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png)
PhpMyAdmin Dashboard
PhpMyAdmin面板
### Step 5: Enable LAMP System-wide ###
### 第五步: 系统范围启用LAMP ###
**17. If you need MariaDB and Apache services to be automatically started after reboot issue the following commands to enable them system-wide.**
**17. 如果你需要在重启后自动运行MariaDB和Apache服务你需要系统级地启用它们。**
# systemctl enable mariadb
# systemctl enable httpd
![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png)
Enable Services System Wide
系统级启用服务
Thats all it takes for a basic LAMP installation on Red Hat Enterprise 7.0 or CentOS 7.0. The next series of articles related to LAMP stack on CentOS/RHEL 7.0 will discuss how to create Virtual Hosts, generate SSL Certificates and Keys and add SSL transaction support for Apache HTTP Server.
这就是在Red Hat Enterprise 7.0或者CentOS 7.0中安装LAMP的过程。CentOS/RHEL 7.0上关于LAMP洗系列文章将会讨论在Apache中创建虚拟主机生成SSL证书、密钥和添加SSL事物支持。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-lamp-in-centos-7/
作者:[Matei Cezar][a]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
@ -235,4 +236,4 @@ via: http://www.tecmint.com/install-lamp-in-centos-7/
[3]:http://www.tecmint.com/centos-7-installation/
[4]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/
[5]:http://php.net/manual/en/timezones.php
[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator

View File

@ -0,0 +1,264 @@
在Ubuntu下用不同方式安装Node.JS
================================================================================
如果你要在Ubuntu 15.04上安装Node.js的话这篇教程对你来说肯定很重要。Node.js根本上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的event loop来处理异步IO。同时它在平台层面上面向系统拥有非常实用的文件读写网络操作功能。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。
### 安装Node.JS 的方法###
有许多不同的方法安装Node.JS我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js在此之前请卸载旧版本的包以免发生包冲突。
- 从源代码安装Node.JS
- 用包管理器安装Node.JS
- 从Github远程库安装Node.JS
- 用NVM安装Node.JS
### 1) 从源代码安装Node.JS ###
让我们开始从从源代码安装Node.JS之前请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装
#### 步骤1: 升级系统 ####
用以下命令来升级系统并且安装一些Node.JS必要的包。
root@ubuntu-15:~# apt-get update
root@ubuntu-15:~# apt-get install python gcc make g++
#### 步骤2: 获取Node.JS的源代码 ####
安装好依赖包之后我们可以从官方网站上下载Node.JS的源代码。下载以及解压的命令如下
root@ubuntu-15:~# wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
root@ubuntu-15:~# tar zxvf node-v0.12.4.tar.gz
#### 步骤3: 开始安装 ####
现在我们进入源代码的目录然后运行.configuration文件
![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png)
root@ubuntu-15:~# ls
node-v0.12.4 node-v0.12.4.tar.gz
root@ubuntu-15:~# cd node-v0.12.4/
root@ubuntu-15:~/node-v0.12.4# ./configure
root@ubuntu-15:~/node-v0.12.4# make install
### 安装后测试 ###
只要运行一次上面的命令就顺利安装好了Node.JS现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。
root@ubuntu-15:~/node-v0.12.4# node -v
v0.12.4
![Node.Js Test](http://blog.linoxide.com/wp-content/uploads/2015/06/21.png)
创建一个以.js为扩展名的文件然后用Node的命令运行
root@ubuntu-15:~/node-v0.12.4# touch helo_test.js
root@ubuntu-15:~/node-v0.12.4# vim helo_test.js
console.log('Hello World');
现在我们用Node的命令运行文件
root@ubuntu-15:~/node-v0.12.4# node helo_test.js
Hello World
输出的结果证明我们已经成功的在Ubuntu 15.04安装好了Node.JS同时我们也能运行JavaScript文件。
### 2) 利用包管理器安装Node.JS ###
在Ubuntu下用包管理器安装Node.JS是非常简单的只要增加NodeSource的个人软件包档案PPA即可。
我们将下面通过PPA安装Node.JS
#### 步骤1: 用curl获取源代码 ####
在我们用curl获取源代码之前我们必须先升级操作系统然后用curl命令获取NodeSource添加到本地仓库。
root@ubuntu-15:~#apt-get update
root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash -
curl将运行以下任务
## Installing the NodeSource Node.js 0.10 repo...
## Populating apt-get cache...
## Confirming "vivid" is supported...
## Adding the NodeSource signing key to your keyring...
## Creating apt sources list file for the NodeSource Node.js 0.10 repo...
## Running `apt-get update` for you...
Fetched 6,411 B in 5s (1,077 B/s)
Reading package lists... Done
## Run `apt-get install nodejs` (as root) to install Node.js 0.10 and npm
#### 步骤2: 安装NodeJS和NPM ####
运行以上命令之后如果输出如上所示我们可以用apt-get命令来安装NodeJS和NPM包。
root@ubuntu-15:~# apt-get install nodejs
![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png)
#### STEP 3: Installing Build Essentials Tool ####
#### 步骤3: 安装一些必备的工具 ####
通过以下命令来安装编译安装一些我们必需的本地插件。
root@ubuntu-15:~# apt-get install -y build-essential
### 通过Node.JS Shell来测试 ###
测试Node.JS的步骤与之前使用源代码安装相似通过以下node命令来确认Node.JS是否完全安装好:
root@ubuntu-15:~# node
> console.log('Node.js Installed Using Package Manager');
Node.js Installed Using Package Manager
----------
root@ubuntu-15:~# node
> a = [1,2,3,4,5]
[ 1, 2, 3, 4, 5 ]
> typeof a
'object'
> 5 + 2
7
>
(^C again to quit)
>
root@ubuntu-15:~#
### 使用NodeJS应用进行简单的测试 ###
REPL是一个Node.js的shell任何有效的JavaScript代码都能在REPL下运行通过。所以让我们看看在Node.JS下的REPL是什么样子吧。
root@ubuntu-15:~# node
> var repl = require("repl");
undefined
> repl.start("> ");
Press Enter and it will show out put like this:
> { domain: null,
_events: {},
_maxListeners: 10,
useGlobal: false,
ignoreUndefined: false,
eval: [Function],
inputStream:
{ _connecting: false,
_handle:
{ fd: 0,
writeQueueSize: 0,
owner: [Circular],
onread: [Function: onread],
reading: true },
_readableState:
{ highWaterMark: 0,
buffer: [],
length: 0,
pipes: null,
...
...
以下是可以在REPL下使用的命令列表
![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png)
### 使用NodeJS的包管理器 ###
NPM是一个提供给node脚本连续运行的命令行工具它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始
root@ubuntu-15:~# npm init
![NPM starting](http://blog.linoxide.com/wp-content/uploads/2015/06/51.png)
### 3) 从Github远程库安装Node.JS ###
在这个方法中我们需要一些步骤来把Node.JS从Github的远程的仓库克隆到本地仓库目录
在开始克隆clone包到本地并且配制之前我们要先安装以下依赖包
root@ubuntu-15:~# apt-get install g++ curl make libssl-dev apache2-utils git-core
现在我们开始用git命令克隆到本地并且转到配制目录
root@ubuntu-15:~# git clone git://github.com/ry/node.git
root@ubuntu-15:~# cd node/
![Git Clone NodeJS](http://blog.linoxide.com/wp-content/uploads/2015/06/61.png)
clone仓库之后通过运行.config命令来编译生成完整的安装包。
root@ubuntu-15:~# ./configure
![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png)
运行make install命令之后耐心等待几分钟程序将会安装好Node.JS
root@ubuntu-15:~/node# make install
root@ubuntu-15:~/node# node -v
v0.13.0-pre
### 测试Node.JS ###
root@ubuntu-15:~/node# node
> a = [1,2,3,4,5,6,7]
[ 1, 2, 3, 4, 5, 6, 7 ]
> typeof a
'object'
> 6 + 5
11
>
(^C again to quit)
>
root@ubuntu-15:~/node#
### 4) 通过NVM安装Node.JS ###
在最后一种方法中我们我们将用NVM来比较容易安装Node.JS。安装和配制Node.JS这是最好的方法之一它可以供我们选择要安装的版本。
在安装之前,请确认本机以前的安装包已经被卸载
#### 步骤1: 安装依赖包 ####
首先升级Ubuntu Server系统然后安装以下安装Node.JS和使用NVM所要依赖的包。用curl命令从git上下载NVM到本地仓库
root@ubuntu-15:~# apt-get install build-essential libssl-dev
root@ubuntu-15:~# curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
![NVM Curl](http://blog.linoxide.com/wp-content/uploads/2015/06/81.png)
#### 步骤2: 修改Home环境 ####
用curl从NVM下载必需的包到用户的home目录之后我们需要修改bash的配制文件添加NVM之后只要重新登录中断或者用如下命令更新即可
root@ubuntu-15:~# source ~/.profile
现在我们可以用NVM来设置默认的NVM的版本或者用如下命令来指定之前版本
root@ubuntu-15:~# nvm ls
root@ubuntu-15:~# nvm alias default 0.12.4
![NVM Default](http://blog.linoxide.com/wp-content/uploads/2015/06/91.png)
#### 步骤3: 使用NVM ####
我们已经通过NVM成功的安装了Node.JS所以我们现在可以使用各种有用的命令。
![NVM Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/101.png)
### 总结 ###
现在我们已经准备好了在服务端安装Node.JS你可以从我们说的四种方式中选择最合适你的方式在最新的Ubuntu 15.04上来安装Node.JS安装好之后你就可以利用Node.JS来编写你的代码。
--------------------------------------------------------------------------------
via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-methods/
作者:[Kashif Siddique][a]
译者:[NearTan](https://github.com/NearTan)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/kashifs/