Merge pull request #6 from LCTT/master

更新
This commit is contained in:
Lv Feng 2016-11-22 18:53:02 +08:00 committed by GitHub
commit c31c8dcc64
25 changed files with 1222 additions and 1222 deletions

View File

@ -0,0 +1,98 @@
完整指南:在 Linux 上使用 Calibre 创建电子书
====
[![Guide to create an eBoook in Linux with Calibre](https://itsfoss.com/wp-content/uploads/2016/10/Create-an-eBook-in-Linux.jpg)][8]
摘要:这份初学者指南是告诉你如何在 Linux 上用 Calibre 工具快速创建一本电子书。
自从 Amazon亚马逊在多年前开始销售电子书电子书已经有了质的飞跃发展并且变得越来越流行。好消息是电子书非常容易使用自由开源的工具来被创建。
在这个教程中,我会告诉你如何在 Linux 上创建一本电子书。
### 在 Linux 上创建一本电子书
要创建一本电子书,你可能需要两个软件:一个文本处理器(当然,我使用的是 [LibreOffice][7])和 Calibre 。[Calibre][6] 是一个非常优秀的电子书阅读器,也是一个电子书库的程序。你可以使用它来[在 Linux 上打开 ePub 文件][5]或者管理你收集的电子书。LCTT 译注LibreOffice 是 Linux 上用来处理文本的软件,类似于 Windows 的 Office 软件)
除了这些软件之外你还需要准备一个电子书封面1410×2250和你的原稿。
### 第一步
首先,你需要用你的文本处理器程序打开你的原稿。 Calibre 可以自动的为你创建一个书籍目录。要使用到这个功能,你需要在你的原稿中设置每一章的标题样式为 Heading 1在 LibreOffice 中要做到这个只需要高亮标题并且在段落样式下拉框中选择“Heading 1”即可。
![ebook creation with Calibre](https://itsfoss.com/wp-content/uploads/2016/10/header1.png)
如果你想要有子章节,并且希望他们也被加入到目录中,只需要设置这些子章节的标题为 Heading 2。
做完这些之后,保存你的文档为 HTML 格式文件。
### 第二步
在 Calibre 程序里面点击“添加书籍Add books”按钮。在对话框出现后你可以打开你刚刚存储的 HTML 格式文件,将它加入到 Calibre 中。
![create ebooks with Calibre](https://itsfoss.com/wp-content/uploads/2016/10/calibre1.png)
### 第三步
一旦这个 HTML 文件加入到 Calibre 库中选择这个新文件并且点击“编辑元数据Edit Metadata”按钮。在这里你可以添加下面的这些信息标题Title)、 作者Author、封面图片cover image、 描述description和其它的一些信息。当你填完之后点击“Ok”。
![creating ebooks with Calibre in Linux](https://itsfoss.com/wp-content/uploads/2016/10/calibre2.png)
### 第四步
现在点击“转换书籍Covert books”按钮。
在新的窗口中,这里会有一些可选项,但是你不会需要使用它们。
![creating ebooks with Calibre in Linux -2](https://itsfoss.com/wp-content/uploads/2016/10/calibre3.png)
在新窗口的右上部选择框中,选择 epub 文件格式。Calibre 也有创建 mobi 文件格式的其它选项,但是我发现创建那些文件之后经常出现我意料之外的事情。
![creating ebooks with Calibre in Linux -3](https://itsfoss.com/wp-content/uploads/2016/10/calibre4.png)
### 第五步
在左边新的对话框中点击“外观Look & Feel”。然后勾选中“移除段落间空白Remove spacing between paragraphs
![creating ebooks with Calibre in Linux - 4](https://itsfoss.com/wp-content/uploads/2016/10/calibre5.png)
接下来,我们会创建一个内容目录。如果不打算在你的书中使用目录,你可以跳过这个步骤。选中“内容目录(Table of Contents”标签。接下来点击“一级目录Level 1 TOC (XPath expression”右边的魔术棒图标。
![creating ebooks with Calibre in Linux - 5](https://itsfoss.com/wp-content/uploads/2016/10/calibre6.png)
在这个新的窗口中,在“匹配 HTML 标签Match HTML tags with tag name”下的下拉菜单中选择“h1”。点击“OK” 来关闭这个窗口。如果你有子章节在“二级目录Level 2 TOC (XPath expression)”下选择“h2”。
![creating ebooks with Calibre in Linux - 6](https://itsfoss.com/wp-content/uploads/2016/10/calibre7.png)
在我们开始生成电子书前,选择输出 EPUB 文件。在这个新的页面选择“插入目录Insert inline Table of Contents”选项。
![creating ebooks with Calibre in Linux - 7](https://itsfoss.com/wp-content/uploads/2016/10/calibre8.png)
现在你需要做的是点击“OK”来开始生成电子书。除非你的是一个大文件否则生成电子书的过程一般都完成的很快。
到此为止,你就已经创建一本电子书了。
对一些特别的用户比如他们知道如何写 CSS 样式文件LCTT 译注CSS 文件可以用来美化 HTML 页面)Calibre 给了这类用户一个选项来为文章增加 CSS 样式。只需要回到“外观Look & Feel”部分选择“风格styling”标签选项。但如果你想创建一个 mobi 格式的文件,因为一些原因,它是不能接受 CSS 样式文件的。
![creating ebooks with Calibre in Linux - 8](https://itsfoss.com/wp-content/uploads/2016/10/calibre9.png)
好了,是不是感到非常容易?我希望这个教程可以帮助你在 Linux 上创建电子书。
--------------------------------------------------------------------------------
via: https://itsfoss.com/create-ebook-calibre-linux/
作者:[John Paul][a]
译者:[chenzhijun](https://github.com/chenzhijun)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[1]:http://pinterest.com/pin/create/button/?url=https://itsfoss.com/create-ebook-calibre-linux/&description=How+To+Create+An+Ebook+With+Calibre+In+Linux+%5BComplete+Guide%5D&media=https://itsfoss.com/wp-content/uploads/2016/10/Create-an-eBook-in-Linux.jpg
[2]:https://www.linkedin.com/cws/share?url=https://itsfoss.com/create-ebook-calibre-linux/
[3]:https://twitter.com/share?original_referer=https%3A%2F%2Fitsfoss.com%2F&source=tweetbutton&text=How+To+Create+An+Ebook+With+Calibre+In+Linux+%5BComplete+Guide%5D&url=https%3A%2F%2Fitsfoss.com%2Fcreate-ebook-calibre-linux%2F&via=%40itsfoss
[4]:https://itsfoss.com/fix-updater-issue-pear-os-8/
[5]:https://itsfoss.com/open-epub-books-ubuntu-linux/
[6]:http://calibre-ebook.com/
[7]:https://www.libreoffice.org/
[8]:https://itsfoss.com/wp-content/uploads/2016/10/Create-an-eBook-in-Linux.jpg

View File

@ -0,0 +1,106 @@
如何在 Linux 中恢复一个删除了的文件
==============
你曾经是否遇到这样的事?当你发现的时候,你已经通过删除键,或者在命令行中使用 `rm` 命令,错误的删除了一个不该删除的文件。
在第一种情况下,你可以到垃圾箱,[搜索那个文件][6]然后把它复原到原始位置。但是第二种情况又该怎么办呢你可能知道Linux 命令行不会把删除的文件转移到任何位置而是直接把它们移除了biu~,它们就不复存在了。
在这篇文章里,将分享一个很有用的技巧来避免此事发生。同时,也会分享一个工具,不小心删除了某些不该删除的文件时,也许用得上。
### 把删除创建为 `rm -i` 的别名
`-i` 选项配合 `rm` 命令(也包括其他[文件处理命令比如 `cp` 或者 `mv`][5])使用时,在删除文件前会出现一个提示。
这同样也可以运用到当[复制,移动或重命名一个文件][4],当所在位置已经存在一个和目标文件同名的文件时。
这个提示会给你第二次机会来考虑是否真的要删除该文件 - 如果你在这个提示上选择确定,那么文件就被删除了。这种情况下,很抱歉,这个技巧并不能防止你的粗心大意。
为了 `rm -i` 别名替代 `rm` ,这样做:
```
alias rm='rm -i'
```
运行 `alias` 命令可以确定 `rm` 现在已经被别名了:
![增加 rm 别名的命令](http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-rm-Command.png)
*为 rm 增加别名*
然而,这只能在当前用户的当前 shell 上有效。为了永久改变,你必须像下面展示的这样把它保存到 `~/.bashrc` 一些版本的 Linux 系统可能是 `~/.profile`)。
![在 Linux 中永久增添别名](http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-Permanently-in-Linux.png)
*在 Linux 中永久增添别名*
为了让 `~/.bashrc`(或 `~/.profile`)中所做的改变立即生效,从当前 shell 中运行文件:
```
. ~/.bashrc
```
![在 Linux 中激活别名](http://www.tecmint.com/wp-content/uploads/2016/11/Active-Alias-in-Linux.png)
*在 Linux 中激活别名*
### 取证工具  Foremost
但愿你对于你的文件足够小心,当你要从外部磁盘或 USB 设备中恢复丢失的文件时,你只需使用这个工具即可。
然而,当你意识到你意外的删除了系统中的一个文件并感到恐慌时-不用担心。让我们来看一看 `foremost`,一个用来处理这种状况的取证工具。
要在 CentOS/RHEL 7 中安装 Foremost需要首先启用 Repoforge
```
# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# yum install foremost
```
然而在 Debian 及其衍生系统中,需这样做:
```
# aptitude install foremost
```
安装完成后,我们做一个简单的测试吧。首先删除 `/boot/images` 目录下一个名为 `nosdos.jpg` 的图像文件:
```
# cd images
# rm nosdos.jpg
```
要恢复这个文件,如下所示使用 `foremost`(要先确认所在分区 - 本例中, `/boot` 位于 `/dev/sda1` 分区中)。
```
# foremost -t jpg -i /dev/sda1 -o /home/gacanepa/rescued
```
其中,`/home/gacanepa/rescued` 是另外一个磁盘中的目录 请记住,把文件恢复到被删除文件所在的磁盘中不是一个明智的做法。
如果在恢复过程中,占用了被删除文件之前所在的磁盘分区,就可能无法恢复文件。另外,进行文件恢复操作前不要做任何其他操作。
`foremost` 执行完成以后,恢复的文件(如果可以恢复)将能够在目录 ·/home/gacanepa/rescue/jpg` 中找到。
##### 总结
在这篇文章中,我们阐述了如何避免意外删除一个不该删除的文件,以及万一这类事情发生,如何恢复文件。还要警告一下, `foremost` 可能运行很长时间,时间长短取决于分区的大小。
如果您有什么问题或想法,和往常一样,不要犹豫,告诉我们。可以给我们留言。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/recover-deleted-file-in-linux/
作者:[Gabriel Cánepa][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/gacanepa/
[1]:http://www.tecmint.com/wp-content/uploads/2016/11/Active-Alias-in-Linux.png
[2]:http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-Permanently-in-Linux.png
[3]:http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-rm-Command.png
[4]:http://www.tecmint.com/rename-multiple-files-in-linux/
[5]:http://www.tecmint.com/progress-monitor-check-progress-of-linux-commands/
[6]:http://www.tecmint.com/linux-find-command-to-search-multiple-filenames-extensions/

View File

@ -0,0 +1,84 @@
通过安装扩展让 KDE Plasma 5 桌面看起来感觉就像 Windows 10 桌面
============================================================
![kde-plasma-to-windows-10](https://iwf1.com/wordpress/wp-content/uploads/2016/11/KDE-Plasma-to-Windows-10.jpg)
通过一些步骤,我将告诉你如何把 KDE Plasma 5 桌面变成 Windows 10 桌面。
除了菜单, KDE Plasma 桌面的许多地方已经和 Win 10 桌面非常像了。因此,只需要一点点改动就可以使二者看起来几乎是一样。
### 开始菜单
让 KDE Plasma 桌面看起来像 Win 10 桌面的首要以及可能最有标志性的环节是实现 Win 10 的 ‘开始’ 菜单。
通过安装 [Zren's Tiled Menu][1],这很容易实现。
#### 安装
1、 在 KDE Plasma 桌面上单击右键 -> 解锁窗口部件Unlock Widgets
2、 在 KDE Plasma 桌面上单击右键 -> 增添窗口部件( Add Widgets
3、 获取新窗口部件 -> 下载新的 Plasma 窗口部件Download New Plasma Widgets
4、 搜索“Tiled Menu” -> 安装Install
#### 激活
1、 在你当前的菜单按钮上单击右键 -> 替代……Alternatives…
2、 选择 "TIled Mune" ->点击切换Switch
![KDE Tiled Menu extension.](http://iwf1.com/wordpress/wp-content/uploads/2016/11/KDE-Tiled-Menu-extension-730x619.jpg)
*KDE Tiled 菜单扩展*
### 主题
弄好菜单以后,下一个你可能需要的就是主题。幸运的是, [K10ne][3] 提供了一个 WIn 10 主题体验。
#### 安装:
1、 从 Plasma 桌面菜单打开“系统设置System Settings” -> 工作空间主题Workspace Theme
2、 从侧边栏选择“桌面主题Desktop Theme” -> 获取新主题Get new Theme
3、 搜索“K10ne” -> 安装Install
#### 激活
1、 从 Plasma 桌面菜单选择“系统设置System Settings” -> 工作空间主题Workspace Theme
2、 从侧边栏选择“桌面主题Desktop Theme” -> "K10ne"
3、 应用Apply
### 任务栏
最后,为了有一个更加完整的体验,你可能也想拥有一个更加 Win 10 风格的任务栏,
这次你需要的安装包叫做“Icons-only Task Manager” 在大多数 Linux 发行版中,通常会默认安装。如果没有安装,需要通过你的系统的合适通道来获取它。
#### 激活
1、 在 Plasma 桌面上单击右键 -> 打开窗口部件Unlock Widgets
2、 在 Plasma 桌面上单击右键 -> 增添部件Add Widgets
3、 把“Icons-only Task Manager”拖放到你的桌面面板的合适位置。
--------------------------------------------------------------------------------
via: https://iwf1.com/make-kde-plasma-5-desktop-look-feel-like-windows-10-using-these-extensions/
作者:[Liron][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://iwf1.com/tag/linux
[1]:https://github.com/Zren/plasma-applets/tree/master/tiledmenu
[2]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/KDE-Tiled-Menu-extension.jpg
[3]:https://store.kde.org/p/1153465/

View File

@ -1,27 +1,26 @@
How to Check Which Apache Modules are Enabled/Loaded in Linux
如何使用 Apache 控制命令检查它的模块是否已经启用或加载
============================================================
In this guide, we will briefly talk about the Apache web server front-end and how to list or check which Apache modules have been enabled on your server.
本篇中,我们会简要地讨论 Apache 服务器前端以及如何列出或查看已经启用的 Apache 模块。
Apache is built, based on the principle of modularity, this way, it enables web server administrators to add different modules to extend its primary functionalities and [enhance apache performance][5] as well.
Apache 基于模块化的理念而构建,这样就可以让 web 管理员添加不同的模块来扩展主要的功能及[增强性能][5]。
Some of the common Apache modules include:
常见的 Apache 模块有:
1. mod_ssl  which offers [HTTPS for Apache][1].
2. mod_rewrite  which allows for matching url patterns with regular expressions, and perform a transparent redirect using [.htaccess tricks][2], or apply a HTTP status code response.
3. mod_security  which offers you to [protect Apache against Brute Force or DDoS attacks][3].
4. mod_status  that allows you to [monitor Apache web server load and page statics][4].
1. mod_ssl  提供了 [HTTPS 功能][1]。
2. mod_rewrite  可以用正则表达式匹配 url 样式,并且使用 [.htaccess 技巧][2]来进行透明转发,或者提供 HTTP 状态码回应。
3. mod_security  用于[保护 Apache 免于暴力破解或者 DDoS 攻击][3]。
4. mod_status - 用于[监测 Apache 的负载及页面统计][4]。
In Linux, the apachectl or apache2ctl command is used to control Apache HTTP server interface, it is a front-end to Apache.
在 Linux 中 `apachectl` 或者 `apache2ctl`用于控制 Apache 服务器,是 Apache 的前端。
You can display the usage information for apache2ctl as below:
你可以用下面的命令显示 `apache2ctl` 的使用信息:
```
$ apache2ctl help
OR
或者
$ apachectl help
```
apachectl help
```
Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
@ -46,22 +45,20 @@ Options:
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files
```
apache2ctl can function in two possible modes, a Sys V init mode and pass-through mode. In the SysV init mode, apache2ctl takes simple, one-word commands in the form below:
`apache2ctl` 可以工作在两种模式下SysV init 模式和直通模式。在 SysV init 模式下,`apache2ctl` 用如下的简单的单命令形式:
```
$ apachectl command
OR
或者
$ apache2ctl command
```
For instance, to start Apache and check its status, run these two commands with root user privileges by employing the [sudo command][6], in case you are a normal user:
比如要启动并检查它的状态,运行这两个命令。如果你是普通用户,使用 [sudo 命令][6]来以 root 用户权限来运行:
```
$ sudo apache2ctl start
$ sudo apache2ctl status
```
Check Apache Status
```
tecmint@TecMint ~ $ sudo apache2ctl start
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1\. Set the 'ServerName' directive globally to suppress this message
@ -97,39 +94,39 @@ Scoreboard Key:
"I" Idle cleanup of worker, "." Open slot with no current process
```
And when operating in pass-through mode, apache2ctl can take all the Apache arguments in the following syntax:
当在直通模式下,`apache2ctl` 可以用下面的语法带上所有 Apache 的参数:
```
$ apachectl [apache-argument]
$ apache2ctl [apache-argument]
```
All the Apache-arguments can be listed as follows:
可以用下面的命令列出所有的 Apache 参数:
```
$ apache2 help [On Debian based systems]
$ httpd help [On RHEL based systems]
$ apache2 help [在基于Debian的系统中]
$ httpd help [在RHEL的系统中]
```
#### Check Enabled Apache Modules
### 检查启用的 Apache 模块
Therefore, in order to check which modules are enabled on your Apache web server, run the applicable command below for your distribution, where `-t -D DUMP_MODULES` is a Apache-argument to show all enabled/loaded modules:
因此,为了检测你的 Apache 服务器启动了哪些模块,在你的发行版中运行适当的命令,`-t -D DUMP_MODULES` 是一个用于显示所有启用的模块的 Apache 参数:
```
--------------- On Debian based systems ---------------
--------------- 在基于 Debian 的系统中 ---------------
$ apache2ctl -t -D DUMP_MODULES
OR
或者
$ apache2ctl -M
```
```
--------------- On RHEL based systems ---------------
--------------- 在 RHEL 的系统中 ---------------
$ apachectl -t -D DUMP_MODULES
OR
或者
$ httpd -M
$ apache2ctl -M
```
List Apache Enabled Loaded Modules
```
[root@tecmint httpd]# apachectl -M
Loaded Modules:
@ -156,15 +153,15 @@ Loaded Modules:
....
```
Thats all! in this simple tutorial, we explained how to use the Apache front-end tools to list enabled/loaded apache modules. Keep in mind that you can get in touch using the feedback form below to send us your questions or comments concerning this guide.
就是这样!在这篇简单的教程中,我们解释了如何使用 Apache 前端工具来列出启动的 apache 模块。记住你可以在下面的反馈表中给我们留下你的问题或者留言。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/check-apache-modules-enabled
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -175,3 +172,5 @@ via: http://www.tecmint.com/check-apache-modules-enabled
[4]:http://www.tecmint.com/monitor-apache-web-server-load-and-page-statistics/
[5]:http://www.tecmint.com/apache-performance-tuning/
[6]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/

View File

@ -0,0 +1,85 @@
Ubuntu 14.04/16.04 与 Windows 10 周年版 Ubuntu Bash 性能对比
===========================
今年初,当 Microsoft 和 Canonical 发布 [Windows 10 Bash 和 Ubuntu 用户空间][1],我尝试做了一些初步性能测试 [Ubuntu on Windows 10 对比 原生 Ubuntu][2],这次我发布更多的,关于原生纯净的 Ubuntu 和基于 Windows 10 的基准对比。
![Windows 的 Linux 子系统](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_1_med)
Windows 的 Linux 子系统测试完成了所有测试,并随着 Windows 10周年更新放出。 默认的 Ubuntu 用户空间还是 Ubuntu 14.04,但是已经可以升级到 16.04。所以测试首先在 14.04 测试,完成后将系统升级升级到 16.04 版本并重复所有测试。完成所有基于 Windows 的 Ubuntu 子系统测试后,我在同样的系统上干净地安装了 Ubuntu 14.04.5 和 Ubuntu 16.04 LTS 来做性能对比。
![Ubuntu](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_2_med)
配置为 Intel i5 6600K Skylake16G 内存和 256G 东芝 ssd测试过程中每个操作系统都采用其原生默认配置和软件包。
![Phoronix 测试套件](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=09989b3&p=2)
这次 Ubuntu/Bash on Windows 和原生 Ubuntu 对比测试,采用开源软件 [Phoronix 测试套件](http://www.phoronix-test-suite.com/),完全自动化并可重复测试。
![SQLite 嵌入式数据库基准测试](https//openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=186c4d0&c=a8c914bf9b64cf67abc65e319f8e71c7951fb1aa&p=0)
首先是 SQLite 嵌入式数据库基准测试。这方面开箱即用的 Ubuntu/Bash on Windows 性能是相当的慢,但是如果将环境从 14.04 升级到 16.04 LTS性能会快很多。然而对于繁重磁盘操作的任务原生 Ubuntu Linux 几乎比 Windows 的子系统 Linux 快了近 2 倍。
![编译测试:编译](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=fa40825&c=0912dc3f6d6a9f36da09fdd4c0cf4e330fa40f90&p=0)
![编译测试:初始创建](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=8419652&c=9b9f6b0822ed5b9dc2977a7f2faf499fce4fba23&p=0)
编译测试作为额外的繁重磁盘操作测试显示,定制的 Windows 子系统真的成倍的限制了 Ubuntu 性能。
接下来,是一些使用 Stream 的基本的系统内存速度测试:
![Stream复制](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=9560e6f&c=ebbc6937fa8daf0540e0df353432a29f938cf7ed&p=0)
![Stream缩放](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=63fa8d6&c=88cd58f9eca6d3a09699d60d9f877529113fb1bc&p=0)
![Stream添加](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=5a2e9d2&c=d37eee4c9394fa8104e7e49e26c964af70ec326b&p=0)
奇怪的是,这些 Stream 内存的基准测试显示 Ubuntu on Windows 的性能比原生的 Ubuntu 好!这个现象同时发生在基于同样的 Windows 却环境不同的 14.04 和 16.04 LTS 上。
接下来,是一些繁重 CPU 操作测试。
![Dolfyn 科学测试](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=ee1f01f&c=3e9a67230e0e081b99ee3237e702c0b40ee73d60&p=0)
通过 Dolfyn 科学测试Ubuntu On Windows 和原生 Ubuntu 之间的性能其实是相当接近的。 对于 Ubuntu 16.04,由于较新的 GCC 编译器性能衰减,两个平台上的性能都较慢。
![Fhourstones 测试](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=dd69257&c=0e31babb8b96be1ae38ea739fbb1346bf9bc4b07&p=0)
![John The Ripper 测试](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=a02416b&c=c8abb70dee982dd494fb1891bd9dc154fa7a7f47&p=0)
透过 Fhourstones 测试和 John The Ripper 测试表明,通过在 Windows 的 Linux 子系统运行的 Ubuntu 的性能可以非常接近裸机 Ubuntu Linux 性能!
![x264 测试H264视频编码](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=3140e3c&c=f4bf6330a7d58b5939c61cbd91fe5db379c1592a&p=0)
类似于 Stream 测试x264 结果是另一个奇怪的情况,其中最好的性能实际上是使用 Linux 子系统的 Ubuntu On Windows
![Linux 内核编译时间](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=ad12f0b&c=f50c829c97d731f6926c5a874cf83f8fc5440067&p=0)
![PHP 编译时间](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=8b7a7ca&c=3de3e8537d08665e8a41380b6b2298c09f408fa0&p=0)
计时编译基准测试非常利于裸机 Ubuntu Linux。这是应该是由于大型程序编译需要大量读写磁盘在先前测试已经发现了这是基于 Windows 的 Linux 子系统缓慢的一大领域。
![Crafty](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=25892d8&c=f6cd3fa4a3497e3d2663106e0bf3fcd227f9b9a3&p=0)
![FLAC 音频编码](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=2ea1062&c=fbbec58a6aa1f3fb8dbc55e3de612afc99c666f7&p=0)
![OpenSSL](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=4899bb2&c=80df0e1e749910ebd84b0d6c2688316e5cfb8cda&p=0)
许多其他的通用开源基准测试表明,严格的针对 CPU 的测试Windows 子系统的 Ubuntu 的性能是很接近的,甚至是与原生安装在实际硬件中的 Ubuntu Linux 相等。
最新的 Windows 的 Linux 子系统,测试结果实际上相当令人印象深刻。让人沮丧的仅仅只是持续缓慢的磁盘/文件系统性能,但是对于受 CPU 限制的工作负载,结果是非常引人注目的。还有很罕见的情况, x264 和 Stream 测试Ubuntu On Windows 上的性能看起来明显优于运行在实际硬件上 的Ubuntu Linux。
总的来说,体验是十分愉快的,并且在 Ubuntu/Bash on Windows 也没有遇到任何其他的 bug。如果你有还兴趣了解更多关于 Windows 和 Linux 的基准测试,欢迎留言讨论。
--------------------------------------------------------------------------------
via: https://www.phoronix.com/scan.php?page=article&item=windows10-anv-wsl&num=1
作者:[Michael Larabel][a]
译者:[VicYu/Vic020](http://vicyu.net)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: http://www.michaellarabel.com/
[1]: http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-User-Space-On-Win10
[2]: http://www.phoronix.com/scan.php?page=article&item=windows-10-lxcore&num=1

View File

@ -1,58 +0,0 @@
Rusking Translating...
# Arch Linux: In a world of polish, DIY never felt so good
![Tripple Renault photo by Gilles Paire via Shutterstock ](https://regmedia.co.uk/2016/10/31/tripple_renault_photo_by_gilles_paire_via_shutterstock.jpg?x=648&y=348&crop=1)
Dig through the annals of Linux journalism and you'll find a surprising amount of coverage of some pretty obscure distros. Flashy new distros like Elementary OS and Solus garner attention for their slick interfaces, and anything shipping with a MATE desktop gets coverage by simple virtue of using MATE.
Thanks to television shows like _Mr Robot_, I fully expect coverage of even Kali Linux to be on the uptick soon.
In all that coverage, though, there's one very widely used distro that's almost totally ignored: Arch Linux.
Arch gets very little coverage for a several reasons, not the least of which is that it's somewhat difficult to install and requires you feel comfortable with the command line to get it working. Worse, from the point of view of anyone trying to appeal to mainstream users, that difficulty is by design - nothing keeps the noobs out like a daunting install process.
It's a shame, though, because once the installation is complete, Arch is actually - in my experience - far easier to use than any other Linux distro I've tried.
But yes, installation is a pain. Hand-partitioning, hand-mounting and generating your own `fstab` files takes more time and effort than clicking "install" and merrily heading off to do something else. But the process of installing Arch teaches you a lot. It pulls back the curtain so you can see what's behind it. In fact it makes the curtain disappear entirely. In Arch, _you_ are the person behind the curtain.
In addition to its reputation for being difficult to install, Arch is justly revered for its customizability, though this is somewhat misunderstood. There is no "default" desktop in Arch. What you want installed on top of the base set of Arch packages is entirely up to you.
![ARCH "DESKTOP" SCREENSHOT LINUX - OBVS VARIES DEPENDING ON USER ](https://regmedia.co.uk/2016/11/01/arch.jpg?x=648&y=364&infer_y=1 "ARCH "DESKTOP" SCREENSHOT LINUX - OBVS VARIES DEPENDING ON USER ")
While you can see this as infinite customizability, you can also see it as totally lacking in customization. For example, unlike - say - Ubuntu there is almost no patching or customization happening in Arch. Arch developers simply pass on what upstream developers have released, end of story. For some this good; you can run "pure" GNOME, for instance. But in other cases, some custom patching can take care of bugs that upstream devs might not prioritize.
The lack of a default set of applications and desktop system also does not make for tidy reviews - or reviews at all really, since what I install will no doubt be different to what you choose. I happened to select a very minimal setup of bare Openbox, tint2 and dmenu. You might prefer the latest release of GNOME. We'd both be running Arch, but our experiences of it would be totally different. This is of course true of any distro, but most others have a default desktop at least.
Still there are common elements that together can make the basis of an Arch review. There is, for example, the primary reason I switched - Arch is a rolling release distro. This means two things. First, the latest kernels are delivered as soon as they're available and reasonably stable. This means I can test things that are difficult to test with other distros. The other big win for a rolling distro is that all updates are delivered when they're ready. Not only does this mean newer software sooner, it means there's no massive system updates that might break things.
Many people feel that Arch is less stable because it's rolling, but in my experience over the last nine months I would argue the opposite.
I have yet to break anything with an update. I did once have to rollback because my /boot partition wasn't mounted when I updated and changes weren't written, but that was pure user error. Bugs that do surface (like some regressions related to the trackpad on a Dell XPS laptop I was testing) are fixed and updates are available much faster than they would be with a non-rolling distro. In short, I've found Arch's rolling release updates to be far more stable than anything else I've been using along side it. The only caveat I have to add to that is read the wiki and pay close attention to what you're updating.
This brings us to the main reason I suspect that Arch's appeal is limited - you have to pay attention to what you're doing. Blindly updating Arch is risky - but it's risky with any distro; you've just been conditioned to think it's not because you have no choice.
All of which leads me to the other major reason I embraced Arch - the [Arch Philosophy][1]. The part in particular that I find appealing is this bit: "[Arch] is targeted at the proficient GNU/Linux user, or anyone with a do-it-yourself attitude who is willing to read the documentation, and solve their own problems."
As Linux moves further into the mainstream developers seem to feel a greater need to smooth over all the rough areas - as if mirroring the opaque user experience of proprietary software were somehow the apex of functionality.
Strange though it sounds in this day and age, there are many of us who actually prefer to configure things ourselves. In this sense Arch may well be the last refuge of the DIY Linux user. ®
--------------------------------------------------------------------------------
via: http://www.theregister.co.uk/2016/11/02/arch_linux_taster/
作者:[Scott Gilbertson][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.theregister.co.uk/Author/1785
[1]:https://wiki.archlinux.org/index.php/Arch_Linux
[2]:http://www.theregister.co.uk/Author/1785
[3]:https://www.linkedin.com/shareArticle?mini=true&url=http://www.theregister.co.uk/2016/11/02/arch_linux_taster/&title=Arch%20Linux%3A%20In%20a%20world%20of%20polish%2C%20DIY%20never%20felt%20so%20good&summary=Last%20refuge%20for%20purists
[4]:http://twitter.com/share?text=Arch%20Linux%3A%20In%20a%20world%20of%20polish%2C%20DIY%20never%20felt%20so%20good&url=http://www.theregister.co.uk/2016/11/02/arch_linux_taster/&via=theregister
[5]:http://www.reddit.com/submit?url=http://www.theregister.co.uk/2016/11/02/arch_linux_taster/&title=Arch%20Linux%3A%20In%20a%20world%20of%20polish%2C%20DIY%20never%20felt%20so%20good

View File

@ -1,3 +1,5 @@
Martin translating
[
![open source vs closed source](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/open-source-vs-closed-source_orig.jpg)
][2]There are many differences between **open source operating system** and **closed source operating system**. Here we have written few of them.

View File

@ -1,87 +0,0 @@
LINUX NOW RUNS ON 99.6% OF TOP 500 SUPERCOMPUTERS
============================================================
[
![Linux rules the world of supercomputers](https://itsfoss.com/wp-content/uploads/2016/11/Linux-King-Supercomputer-world-min.jpg)
][12]
_Brief: Linux may have just 2% in the desktop market share, but when it comes to supercomputers, Linux is simply ruling it with over 99% of the share._
Linux running on more than 99% of the top 500 fastest supercomputers in the world is no surprise. If you followed our previous reports, in the year 2015, [Linux was running on more than 97% of the top 500 supercomputers][13]. This year, it just got better.
[#Linux now runs on more than 99% of top 500 #supercomputers in the world][4]
[CLICK TO TWEET][5]
This information is collected by an independent organization [Top500][14] that publishes the details about the top 500 fastest supercomputers known to them, twice a year. You can [go the website and filter out the list][15] based on country, OS type used, vendors etc. Dont worry, Ill do it for you to present some of the most interesting facts from this years list.
### LINUX GOT 498 OUT OF 500
If I have to break it down in numbers, 498 out of the top 500 supercomputers run Linux. Rest of the two supercomputers run Unix-based OS. Windows, which was running on 1 supercomputer until last year, is nowhere in the list this year. Perhaps, none of the supercomputers can run Windows 10 (pun intended).
To summarize the list of top 500 supercomputers based on OS this year:
* Linux: 498
* Unix: 2
* Windows: 0
To give you a year wise summary of Linux shares on the top 500 supercomputers:
* In 2012: 94%
* In [2013][6]: 95%
* In [2014][7]: 97%
* In [2015][8]: 97.2%
* In 2016: 99.6%
* In 2017: ???
In addition to that, first 380 fastest supercomputers run Linux, including of course the fastest supercomputer based in China. Unix is used by the 386th and 387th ranked supercomputers also based in China.
### SOME OTHER INTERESTING STATS ABOUT FASTEST SUPERCOMPUTERS
[
![List of top 10 fastest supercomputers in the world in 2016](https://itsfoss.com/wp-content/uploads/2016/11/fastest-supercomputers.png)
][16]
Moving Linux aside, I was looking at the list and thought of sharing some other interesting stats with you.
* Worlds fastest supercomputer is [Sunway TaihuLight][9]. It based in [National Supercomputing Center in Wuxi][10], China. It has a speed of 93PFLOPS.
* Worlds second fastest supercomputer is also based in China ([Tianhe-2][11]) while the third spot is taken by US based Titan.
* Out of the top 10 fastest supercomputers, USA has 5, Japan and China have 2 each while Switzerland has 1.
* US and China both have 171 supercomputers each in the list of the top 500 supercomputers.
* Japan has 27, France has 20, while India, Russia and Saudi Arabia has 5 supercomputers in the list.
[Suggested ReaddigiKam 5.0 Released! Install It In Ubuntu Linux][17]
Some interesting facts, isnt it? You can filter out your own list [here][18] to further details. For the moment I am happy to brag about Linux running on 99% of the top 500 supercomputers and look forward to a perfect score of 100% next year.
While you are reading it, do share this article on social media. Its an achievement for Linux and we got to show off :P
--------------------------------------------------------------------------------
via: https://itsfoss.com/linux-99-percent-top-500-supercomputers
作者:[Abhishek Prakash ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://itsfoss.com/author/abhishek/
[1]:https://twitter.com/share?original_referer=https%3A%2F%2Fitsfoss.com%2F&source=tweetbutton&text=Linux+Now+Runs+On+99.6%25+Of+Top+500+Supercomputers&url=https%3A%2F%2Fitsfoss.com%2Flinux-99-percent-top-500-supercomputers%2F&via=%40itsfoss
[2]:https://www.linkedin.com/cws/share?url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/
[3]:http://pinterest.com/pin/create/button/?url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/&description=Linux+Now+Runs+On+99.6%25+Of+Top+500+Supercomputers&media=https://itsfoss.com/wp-content/uploads/2016/11/Linux-King-Supercomputer-world-min.jpg
[4]:https://twitter.com/share?text=%23Linux+now+runs+on+more+than+99%25+of+top+500+%23supercomputers+in+the+world&via=itsfoss&related=itsfoss&url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/
[5]:https://twitter.com/share?text=%23Linux+now+runs+on+more+than+99%25+of+top+500+%23supercomputers+in+the+world&via=itsfoss&related=itsfoss&url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/
[6]:https://itsfoss.com/95-percent-worlds-top-500-supercomputers-run-linux/
[7]:https://itsfoss.com/97-percent-worlds-top-500-supercomputers-run-linux/
[8]:https://itsfoss.com/linux-runs-97-percent-worlds-top-500-supercomputers/
[9]:https://en.wikipedia.org/wiki/Sunway_TaihuLight
[10]:https://www.top500.org/site/50623
[11]:https://en.wikipedia.org/wiki/Tianhe-2
[12]:https://itsfoss.com/wp-content/uploads/2016/11/Linux-King-Supercomputer-world-min.jpg
[13]:https://itsfoss.com/linux-runs-97-percent-worlds-top-500-supercomputers/
[14]:https://www.top500.org/
[15]:https://www.top500.org/statistics/sublist/
[16]:https://itsfoss.com/wp-content/uploads/2016/11/fastest-supercomputers.png
[17]:https://itsfoss.com/digikam-5-0-released-install-it-in-ubuntu-linux/
[18]:https://www.top500.org/statistics/sublist/

View File

@ -1,455 +0,0 @@
GitFuture get translating
DTrace for Linux 2016
===========
![](https://raw.githubusercontent.com/brendangregg/bcc/master/images/bcc_tracing_tools_2016.png)
With the final major capability for BPF tracing (timed sampling) merging in Linux 4.9-rc1, the Linux kernel now has raw capabilities similar to those provided by DTrace, the advanced tracer from Solaris. As a long time DTrace user and expert, this is an exciting milestone! On Linux, you can now analyze the performance of applications and the kernel using production-safe low-overhead custom tracing, with latency histograms, frequency counts, and more.
There have been many tracing projects for Linux, but the technology that finally merged didnt start out as a tracing project at all: it began as enhancements to Berkeley Packet Filter (BPF). At first, these enhancements allowed BPF to redirect packets to create software-defined networks. Later on, support for tracing events was added, enabling programmatic tracing in Linux.
While BPF currently lacks a high-level language like DTrace, the front-ends available have been enough for me to create many BPF tools, some based on my older [DTraceToolkit][37]. In this post I'll describe how you can use these tools, the front-ends available, and discuss where the technology is going next.
### Screenshots
I've been adding BPF-based tracing tools to the open source [bcc][36] project (thanks to Brenden Blanco, of PLUMgrid, for leading bcc development). See the [bcc install][35] instructions. It will add a collection of tools under /usr/share/bcc/tools, including the following.
Tracing new processes:
```
# **execsnoop**
PCOMM PID RET ARGS
bash 15887 0 /usr/bin/man ls
preconv 15894 0 /usr/bin/preconv -e UTF-8
man 15896 0 /usr/bin/tbl
man 15897 0 /usr/bin/nroff -mandoc -rLL=169n -rLT=169n -Tutf8
man 15898 0 /usr/bin/pager -s
nroff 15900 0 /usr/bin/locale charmap
nroff 15901 0 /usr/bin/groff -mtty-char -Tutf8 -mandoc -rLL=169n -rLT=169n
groff 15902 0 /usr/bin/troff -mtty-char -mandoc -rLL=169n -rLT=169n -Tutf8
groff 15903 0 /usr/bin/grotty
```
Histogram of disk I/O latency:
```
# **biolatency -m**
Tracing block device I/O... Hit Ctrl-C to end.
^C
msecs : count distribution
0 -> 1 : 96 |************************************ |
2 -> 3 : 25 |********* |
4 -> 7 : 29 |*********** |
8 -> 15 : 62 |*********************** |
16 -> 31 : 100 |**************************************|
32 -> 63 : 62 |*********************** |
64 -> 127 : 18 |****** |
```
Tracing common ext4 operations slower than 5 milliseconds:
```
# **ext4slower 5**
Tracing ext4 operations slower than 5 ms
TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME
21:49:45 supervise 3570 W 18 0 5.48 status.new
21:49:48 supervise 12770 R 128 0 7.55 run
21:49:48 run 12770 R 497 0 16.46 nsswitch.conf
21:49:48 run 12770 R 1680 0 17.42 netflix_environment.sh
21:49:48 run 12770 R 1079 0 9.53 service_functions.sh
21:49:48 run 12772 R 128 0 17.74 svstat
21:49:48 svstat 12772 R 18 0 8.67 status
21:49:48 run 12774 R 128 0 15.76 stat
21:49:48 run 12777 R 128 0 7.89 grep
21:49:48 run 12776 R 128 0 8.25 ps
21:49:48 run 12780 R 128 0 11.07 xargs
21:49:48 ps 12776 R 832 0 12.02 libprocps.so.4.0.0
21:49:48 run 12779 R 128 0 13.21 cut
[...]
```
Tracing new active TCP connections (connect()):
```
# **tcpconnect**
PID COMM IP SADDR DADDR DPORT
1479 telnet 4 127.0.0.1 127.0.0.1 23
1469 curl 4 10.201.219.236 54.245.105.25 80
1469 curl 4 10.201.219.236 54.67.101.145 80
1991 telnet 6 ::1 ::1 23
2015 ssh 6 fe80::2000:bff:fe82:3ac fe80::2000:bff:fe82:3ac 22
```
Tracing DNS latency by tracing getaddrinfo()/gethostbyname() library calls:
```
# **gethostlatency**
TIME PID COMM LATms HOST
06:10:24 28011 wget 90.00 www.iovisor.org
06:10:28 28127 wget 0.00 www.iovisor.org
06:10:41 28404 wget 9.00 www.netflix.com
06:10:48 28544 curl 35.00 www.netflix.com.au
06:11:10 29054 curl 31.00 www.plumgrid.com
06:11:16 29195 curl 3.00 www.facebook.com
06:11:25 29404 curl 72.00 foo
06:11:28 29475 curl 1.00 foo
```
Interval summaries of VFS operations by type:
```
# **vfsstat**
TIME READ/s WRITE/s CREATE/s OPEN/s FSYNC/s
18:35:32: 231 12 4 98 0
18:35:33: 274 13 4 106 0
18:35:34: 586 86 4 251 0
18:35:35: 241 15 4 99 0
```
Tracing off-CPU time with kernel and user stack traces (summarized in kernel), for a given PID:
```
# **offcputime -d -p 24347**
Tracing off-CPU time (us) of PID 24347 by user + kernel stack... Hit Ctrl-C to end.
^C
[...]
ffffffff810a9581 finish_task_switch
ffffffff8185d385 schedule
ffffffff81085672 do_wait
ffffffff8108687b sys_wait4
ffffffff81861bf6 entry_SYSCALL_64_fastpath
--
00007f6733a6b64a waitpid
- bash (24347)
4952
ffffffff810a9581 finish_task_switch
ffffffff8185d385 schedule
ffffffff81860c48 schedule_timeout
ffffffff810c5672 wait_woken
ffffffff8150715a n_tty_read
ffffffff815010f2 tty_read
ffffffff8122cd67 __vfs_read
ffffffff8122df65 vfs_read
ffffffff8122f465 sys_read
ffffffff81861bf6 entry_SYSCALL_64_fastpath
--
00007f6733a969b0 read
- bash (24347)
1450908
```
Tracing MySQL query latency (via a USDT probe):
```
# **mysqld_qslower `pgrep -n mysqld`**
Tracing MySQL server queries for PID 14371 slower than 1 ms...
TIME(s) PID MS QUERY
0.000000 18608 130.751 SELECT * FROM words WHERE word REGEXP '^bre.*n$'
2.921535 18608 130.590 SELECT * FROM words WHERE word REGEXP '^alex.*$'
4.603549 18608 24.164 SELECT COUNT(*) FROM words
9.733847 18608 130.936 SELECT count(*) AS count FROM words WHERE word REGEXP '^bre.*n$'
17.864776 18608 130.298 SELECT * FROM words WHERE word REGEXP '^bre.*n$' ORDER BY word
```
Using the trace multi-tool to watch login requests, by instrumenting the pam library:
```
# **trace 'pam:pam_start "%s: %s", arg1, arg2'**
TIME PID COMM FUNC -
17:49:45 5558 sshd pam_start sshd: root
17:49:47 5662 sudo pam_start sudo: root
17:49:49 5727 login pam_start login: bgregg
```
Many tools have usage messages (-h), and all should have man pages and text files of example output in the bcc project.
### Out of necessity
In 2014, Linux tracing had some kernel summary features (from ftrace and perf_events), but outside those we still had to dump-and-post-process data a decades old technique that has high overhead at scale. You couldn't frequency count process names, function names, stack traces, or other arbitrary data in the kernel. You couldn't save variables in one probe event, and then retrieve them in another, which meant that you couldn't measure latency (or time deltas) in custom places, and you couldn't create in-kernel latency histograms. You couldn't trace USDT probes. You couldn't even write custom programs. DTrace could do all these, but only on Solaris or BSD. On Linux, some out-of-tree tracers like SystemTap could serve these needs, but brought their own challenges. (For the sake of completeness: yes, you _could_ write kprobe-based kernel modules but practically no one did.)
In 2014 I joined the Netflix cloud performance team. Having spent years as a DTrace expert, it might have seemed crazy for me to move to Linux. But I had some motivations, in particular seeking a greater challenge: performance tuning the Netflix cloud, with its rapid application changes, microservice architecture, and distributed systems. Sometimes this job involves systems tracing, for which I'd previously used DTrace. Without DTrace on Linux, I began by using what was built in to the Linux kernel, ftrace and perf_events, and from them made a toolkit of tracing tools ([perf-tools][34]). They have been invaluable. But I couldn't do some tasks, particularly latency histograms and stack trace counting. We needed kernel tracing to be programmatic.
### What happened?
BPF adds programmatic capabilities to the existing kernel tracing facilities (tracepoints, kprobes, uprobes). It has been enhanced rapidly in the Linux 4.x series.
Timed sampling was the final major piece, and it landed in Linux 4.9-rc1 ([patchset][33]). Many thanks to Alexei Starovoitov (now working on BPF at Facebook), the lead developer behind these BPF enhancements.
The Linux kernel now has the following features built in (added between 2.6 and 4.9):
* Dynamic tracing, kernel-level (BPF support for kprobes)
* Dynamic tracing, user-level (BPF support for uprobes)
* Static tracing, kernel-level (BPF support for tracepoints)
* Timed sampling events (BPF with perf_event_open)
* PMC events (BPF with perf_event_open)
* Filtering (via BPF programs)
* Debug output (bpf_trace_printk())
* Per-event output (bpf_perf_event_output())
* Basic variables (global & per-thread variables, via BPF maps)
* Associative arrays (via BPF maps)
* Frequency counting (via BPF maps)
* Histograms (power-of-2, linear, and custom, via BPF maps)
* Timestamps and time deltas (bpf_ktime_get_ns(), and BPF programs)
* Stack traces, kernel (BPF stackmap)
* Stack traces, user (BPF stackmap)
* Overwrite ring buffers (perf_event_attr.write_backward)
The front-end we are using is bcc, which provides both Python and lua interfaces. bcc adds:
* Static tracing, user-level (USDT probes via uprobes)
* Debug output (Python with BPF.trace_pipe() and BPF.trace_fields())
* Per-event output (BPF_PERF_OUTPUT macro and BPF.open_perf_buffer())
* Interval output (BPF.get_table() and table.clear())
* Histogram printing (table.print_log2_hist())
* C struct navigation, kernel-level (bcc rewriter maps to bpf_probe_read())
* Symbol resolution, kernel-level (ksym(), ksymaddr())
* Symbol resolution, user-level (usymaddr())
* BPF tracepoint support (via TRACEPOINT_PROBE)
* BPF stack trace support (incl. walk method for stack frames)
* Various other helper macros and functions
* Examples (under /examples)
* Many tools (under /tools)
* Tutorials (/docs/tutorial*.md)
* Reference guide (/docs/reference_guide.md)
I'd been holding off on this post until the last major feature was integrated, and now it has been in 4.9-rc1\. There are still some minor missing things we have workarounds for, and additional things we might do, but what we have right now is worth celebrating. Linux now has advanced tracing capabilities built in.
### Safety
BPF and its enhancements are designed to be production safe, and it is used today in large scale production environments. But if you're determined, you may be able to still find a way to hang the kernel. That experience should be the exception rather than the rule, and such bugs will be fixed fast, especially since BPF is part of Linux. All eyes are on Linux.
We did hit a couple of non-BPF bugs during development that needed to be fixed: rcu not reentrant, which could cause kernel hangs for funccount and was fixed by the "bpf: map pre-alloc" patchset in 4.6, and with a workaround in bcc for older kernels. And a uprobe memory accounting issue, which failed uprobe allocations, and was fixed by the "uprobes: Fix the memcg accounting" patch in 4.8 and backported to earlier kernels (eg, it's in the current 4.4.27 and 4.4.0-45.66).
### Why did Linux tracing take so long?
Prior work had been split among several other tracers: there was never a consolidated effort on any single one. For more about this and other issues, see my 2014 [tracing summit talk][32]. One thing I didn't note there was the counter effect of partial solutions: some companies had found another tracer (SystemTap or LTTng) was sufficient for their specific needs, and while they have been happy to hear about BPF, contributing to its development wasn't a priority given their existing solution.
BPF has only been enhanced to do tracing in the last two years. This process could have gone faster, but early on there were zero full-time engineers working on BPF tracing. Alexei Starovoitov (BPF lead), Brenden Blanco (bcc lead), myself, and others, all had other priorities. I tracked my hours on this at Netflix (voluntarily), and I've spent around 7% of my time on BPF/bcc. It wasn't that much of a priority, in part because we had our own workarounds (including my perf-tools, which work on older kernels).
Now that BPF tracing has arrived, there's already tech companies on the lookout for BPF skills. I can still highly recommend [Netflix][31]. (If you're trying to hire _me_ for BPF skills, then I'm still very happy at Netflix!.)
### Ease of use
What might appear to be the largest remaining difference between DTrace and bcc/BPF is ease of use. But it depends on what you're doing with BPF tracing. Either you are:
* **Using BPF tools/metrics**: There should be no difference. Tools behave the same, GUIs can access similar metrics. Most people will use BPF in this way.
* **Developing tools/metrics**: bcc right now is much harder. DTrace has its own concise language, D, similar to awk, whereas bcc uses existing languages (C and Python or lua) with libraries. A bcc tool in C+Python may be a _lot_ more code than a D-only tool: 10x the lines, or more. However, many DTrace tools used shell wrapping to provide arguments and error checking, inflating the code to a much bigger size. The coding difficulty is also different: the rewriter in bcc can get fiddly, which makes some scripts much more complicated to develop (extra bpf_probe_read()s, requiring more knowledge of BPF internals). This situation should improve over time as improvements are planned.
* **Running common one-liners**: Fairly similar. DTrace could do many with the "dtrace" command, whereas bcc has a variety of multitools: trace, argdist, funccount, funclatency, etc.
* **Writing custom ad hoc one-liners**: With DTrace this was trivial, and accelerated advanced analysis by allowing rapid custom questions to be posed and answered by the system. bcc is currently limited by its multitools and their scope.
In short, if you're an end user of BPF tools, you shouldn't notice these differences. If you're an advanced user and tool developer (like me), bcc is a lot more difficult right now.
To show a current example of the bcc Python front-end, here's the code for tracing disk I/O and printing I/O size as a histogram:
```
from bcc import BPF
from time import sleep
# load BPF program
b = BPF(text="""
#include <uapi/linux/ptrace.h>
#include <linux/blkdev.h>
BPF_HISTOGRAM(dist);
int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req)
{
dist.increment(bpf_log2l(req->__data_len / 1024));
return 0;
}
""")
# header
print("Tracing... Hit Ctrl-C to end.")
# trace until Ctrl-C
try:
sleep(99999999)
except KeyboardInterrupt:
print
# output
b["dist"].print_log2_hist("kbytes")
```
Note the embedded C (text=) in the Python code.
This gets the job done, but there's also room for improvement. Fortunately, we have time to do so: it will take many months before people are on Linux 4.9 and can use BPF, so we have time to create tools and front-ends.
### A higher-level language
An easier front-end, such as a higher-level language, may not improve adoption as much as you might imagine. Most people will use the canned tools (and GUIs), and only some of us will actually write them. But I'm not opposed to a higher-level language either, and some already exist, like SystemTap:
```
#!/usr/bin/stap
/*
* opensnoop.stp Trace file open()s. Basic version of opensnoop.
*/
probe begin
{
printf("\n%6s %6s %16s %s\n", "UID", "PID", "COMM", "PATH");
}
probe syscall.open
{
printf("%6d %6d %16s %s\n", uid(), pid(), execname(), filename);
}
```
Wouldn't it be nice if we could have the SystemTap front-end with all its language integration and tapsets, with the high-performance kernel built in BPF back-end? Richard Henderson of Red Hat has already begun work on this, and has released an [initial version][30]!
There's also [ply][29], an entirely new higher-level language for BPF:
```
#!/usr/bin/env ply
kprobe:SyS_*
{
$syscalls[func].count()
}
```
This is also promising.
Although, I think the real challenge for tool developers won't be the language: it will be knowing what to do with these new superpowers.
### How you can contribute
* **Promotion**: There are currently no marketing efforts for BPF tracing. Some companies know it and are using it (Facebook, Netflix, Github, and more), but it'll take years to become widely known. You can help by sharing articles and resources with others in the industry.
* **Education**: You can write articles, give meetup talks, and contribute to bcc documentation. Share case studies of how BPF has solved real issues, and provided value to your company.
* **Fix bcc issues**: See the [bcc issue list][19], which includes bugs and feature requests.
* **File bugs**: Use bcc/BPF, and file bugs as you find them.
* **New tools**: There are more observability tools to develop, but please don't be hasty: people are going to spend hours learning and using your tool, so make it as intuitive and excellent as possible (see my [docs][18]). As Mike Muuss has said about his [ping][17] program: "If I'd known then that it would be my most famous accomplishment in life, I might have worked on it another day or two and added some more options."
* **High-level language**: If the existing bcc front-end languages really bother you, maybe you can come up with something much better. If you build it in bcc you can leverage libbcc. Or, you could help the SystemTap BPF or ply efforts.
* **GUI integration**: Apart from the bcc CLI observability tools, how can this new information be visualized? Latency heat maps, flame graphs, and more.
### Other Tracers
What about SystemTap, ktap, sysdig, LTTng, etc? It's possible that they all have a future, either by using BPF, or by becoming better at what they specifically do. Explaining each will be a blog post by itself.
And DTrace itself? We're still using it at Netflix, on our FreeBSD-based CDN.
### Further bcc/BPF Reading
I've written a [bcc/BPF Tool End-User Tutorial][28], a [bcc Python Developer's Tutorial][27], a [bcc/BPF Reference Guide][26], and contributed useful [/tools][25], each with an [example.txt][24] file and [man page][23]. My prior posts about bcc & BPF include:
* [eBPF: One Small Step][16] (we later just called it BPF)
* [bcc: Taming Linux 4.3+ Tracing Superpowers][15]
* [Linux eBPF Stack Trace Hack][14] (stack traces are now officially supported)
* [Linux eBPF Off-CPU Flame Graph][13] (" " ")
* [Linux Wakeup and Off-Wake Profiling][12] (" " ")
* [Linux Chain Graph Prototype][11] (" " ")
* [Linux eBPF/bcc uprobes][10]
* [Linux BPF Superpowers][9]
* [Ubuntu Xenial bcc/BPF][8]
* [Linux bcc Tracing Security Capabilities][7]
* [Linux MySQL Slow Query Tracing with bcc/BPF][6]
* [Linux bcc ext4 Latency Tracing][5]
* [Linux bcc/BPF Run Queue (Scheduler) Latency][4]
* [Linux bcc/BPF Node.js USDT Tracing][3]
* [Linux bcc tcptop][2]
* [Linux 4.9's Efficient BPF-based Profiler][1]
I've also given a talk about bcc/BPF, at Facebook's Performance@Scale event: [Linux BPF Superpowers][22]. In December, I'm giving a tutorial and talk on BPF/bcc at [USENIX LISA][21] in Boston.
### Acknowledgements
* Van Jacobson and Steve McCanne, who created the original BPF as a packet filter.
* Barton P. Miller, Jeffrey K. Hollingsworth, and Jon Cargille, for inventing dynamic tracing, and publishing the paper: "Dynamic Program Instrumentation for Scalable Performance Tools", Scalable High-performance Conputing Conference (SHPCC), Knoxville, Tennessee, May 1994.
* kerninst (ParaDyn, UW-Madison), an early dynamic tracing tool that showed the value of dynamic tracing (late 1990's).
* Mathieu Desnoyers (of LTTng), the lead developer of kernel markers that led to tracepoints.
* IBM developed kprobes as part of DProbes. DProbes was combined with LTT to provide Linux dynamic tracing in 2000, but wasn't integrated.
* Bryan Cantrill, Mike Shapiro, and Adam Leventhal (Sun Microsystems), the core developers of DTrace, an awesome tool which proved that dynamic tracing could be production safe and easy to use (2004). Given the mechanics of dynamic tracing, this was a crucial turning point for the technology: that it became safe enough to be shipped _by default in Solaris_, an OS known for reliability.
* The many Sun Microsystems staff in marketing, sales, training, and other roles, for promoting DTrace and creating the awareness and desire for advanced system tracing.
* Roland McGrath (at Red Hat), the lead developer of utrace, which became uprobes.
* Alexei Starovoitov (PLUMgrid, then Facebook), the lead developer of enhanced BPF: the programmatic kernel components necessary.
* Many other Linux kernel engineers who contributed feedback, code, testing, and their own patchsets for the development of enhanced BPF (search lkml for BPF): Wang Nan, Daniel Borkmann, David S. Miller, Peter Zijlstra, and many others.
* Brenden Blanco (PLUMgrid), the lead developer of bcc.
* Sasha Goldshtein (Sela) developed tracepoint support in bcc, developed the most powerful bcc multitools trace and argdist, and contributed to USDT support.
* Vicent Martí and others at Github engineering, for developing the lua front-end for bcc, and contributing parts of USDT.
* Allan McAleavy, Mark Drayton, and other bcc contributors for various improvements.
Thanks to Netflix for providing the environment and support where I've been able to contribute to BPF and bcc tracing, and help get them done. I've also contributed to tracing in general over the years by developing tracing tools (using TNF/prex, DTrace, SystemTap, ktap, ftrace, perf, and now bcc/BPF), and books, blogs, and talks.
Finally, thanks to [Deirdré][20] for editing another post.
### Conclusion
Linux doesn't have DTrace (the language), but it now does, in a way, have the DTraceToolkit (the tools).
The Linux 4.9 kernel has the final capabilities needed to support modern tracing, via enhancments to its built-in BPF engine. The hardest part is now done: kernel support. Future work now includes more performance CLI tools, alternate higher-level languages, and GUIs.
For customers of performance analysis products, this is also good news: you can now ask for latency histograms and heatmaps, CPU and off-CPU flame graphs, better latency breakdowns, and lower-cost instrumentation. Per-packet tracing and processing in user space is now the old inefficient way.
So when are you going to upgrade to Linux 4.9? Once it is officially released, new performance tools await: apt-get install bcc-tools.
Enjoy!
Brendan
--------------------------------------------------------------------------------
via: http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html
作者:[Brendan Gregg][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.brendangregg.com/
[1]:http://www.brendangregg.com/blog/2016-10-21/linux-efficient-profiler.html
[2]:http://www.brendangregg.com/blog/2016-10-15/linux-bcc-tcptop.html
[3]:http://www.brendangregg.com/blog/2016-10-12/linux-bcc-nodejs-usdt.html
[4]:http://www.brendangregg.com/blog/2016-10-08/linux-bcc-runqlat.html
[5]:http://www.brendangregg.com/blog/2016-10-06/linux-bcc-ext4dist-ext4slower.html
[6]:http://www.brendangregg.com/blog/2016-10-04/linux-bcc-mysqld-qslower.html
[7]:http://www.brendangregg.com/blog/2016-10-01/linux-bcc-security-capabilities.html
[8]:http://www.brendangregg.com/blog/2016-06-14/ubuntu-xenial-bcc-bpf.html
[9]:http://www.brendangregg.com/blog/2016-03-05/linux-bpf-superpowers.html
[10]:http://www.brendangregg.com/blog/2016-02-08/linux-ebpf-bcc-uprobes.html
[11]:http://www.brendangregg.com/blog/2016-02-05/ebpf-chaingraph-prototype.html
[12]:http://www.brendangregg.com/blog/2016-02-01/linux-wakeup-offwake-profiling.html
[13]:http://www.brendangregg.com/blog/2016-01-20/ebpf-offcpu-flame-graph.html
[14]:http://www.brendangregg.com/blog/2016-01-18/ebpf-stack-trace-hack.html
[15]:http://www.brendangregg.com/blog/2015-09-22/bcc-linux-4.3-tracing.html
[16]:http://www.brendangregg.com/blog/2015-05-15/ebpf-one-small-step.html
[17]:http://ftp.arl.army.mil/~mike/ping.html
[18]:https://github.com/iovisor/bcc/blob/master/CONTRIBUTING-SCRIPTS.md
[19]:https://github.com/iovisor/bcc/issues
[20]:http://www.brendangregg.com/blog/2016-07-23/deirdre.html
[21]:https://www.usenix.org/conference/lisa16
[22]:http://www.brendangregg.com/blog/2016-03-05/linux-bpf-superpowers.html
[23]:https://github.com/iovisor/bcc/tree/master/man/man8
[24]:https://github.com/iovisor/bcc/tree/master/tools
[25]:https://github.com/iovisor/bcc/tree/master/tools
[26]:https://github.com/iovisor/bcc/blob/master/docs/reference_guide.md
[27]:https://github.com/iovisor/bcc/blob/master/docs/tutorial_bcc_python_developer.md
[28]:https://github.com/iovisor/bcc/blob/master/docs/tutorial.md
[29]:https://wkz.github.io/ply/
[30]:https://lkml.org/lkml/2016/6/14/749
[31]:http://www.brendangregg.com/blog/2016-03-30/working-at-netflix-2016.html
[32]:http://www.slideshare.net/brendangregg/from-dtrace-to-linux
[33]:https://lkml.org/lkml/2016/9/1/831
[34]:https://github.com/brendangregg/perf-tools
[35]:https://github.com/iovisor/bcc/blob/master/INSTALL.md
[36]:https://github.com/iovisor/bcc
[37]:https://github.com/opendtrace/toolkit
[38]:https://raw.githubusercontent.com/brendangregg/bcc/master/images/bcc_tracing_tools_2016.png

View File

@ -1,106 +0,0 @@
translating by chenzhijun
HOW TO CREATE AN EBOOK WITH CALIBRE IN LINUX [COMPLETE GUIDE]
====
[![Guide to create an eBoook in Linux with Calibre](https://itsfoss.com/wp-content/uploads/2016/10/Create-an-eBook-in-Linux.jpg)][8]
_Brief: This beginners guide shows you how to quickly create an ebook with Calibre tool in Linux._
Ebooks have been growing by leaps and bounds in popularity since Amazon started selling them several years ago. The good news is that they are very easy to create with Free and Open Source tools.
In this tutorial, Ill show you how to create an eBook in Linux.
### CREATING AN EBOOK IN LINUX
To create an ebook youll need two pieces of software: a word processor (Ill be using [LibreOffice][7], of course) and Calibre. [Calibre][6]is a great ebook reader and library program. You can use it to [open ePub files in Linux][5] or to manage your collection of eBooks.
Besides this software, you also need an ebook cover (1410×2250) and your manuscript.
### STEP 1
First, you need to open your manuscript with your word processor. Calibre can automatically create a table of contents for you. In order to do so, you need to set the chapter titles into your manuscript to Heading 1\. Just highlight the chapter titles and selection “Heading 1” from the paragraph style drop down box.
![ebook creation with Calibre](https://itsfoss.com/wp-content/uploads/2016/10/header1.png)
If you plan to have sub-chapters and want them to be added to the TOC, then make all those titles Heading 2.
Now, save your document as an HTML file.
### STEP 2
In Calibre, click the “Add books” button. After the dialog box appears, you can browse to where your HTML file is located and add it to the program.
![create ebooks with Calibre](https://itsfoss.com/wp-content/uploads/2016/10/calibre1.png)
### STEP 3
Once the new HTML file is added to the Calibre library, select the new file and click the “Edit metadata” button. From here you can add the following information: Title, Author, cover image, description and more. When youre done, click “OK”.
![creating ebooks with Calibre in Linux](https://itsfoss.com/wp-content/uploads/2016/10/calibre2.png)
### STEP 4
Now click the “Convert books” button.
In the new windows, there are quite a few options available, but you dont need to use them all.
[Suggested ReadFix Pear Updater Issue In Pear OS 8][4]
![creating ebooks with Calibre in Linux -2](https://itsfoss.com/wp-content/uploads/2016/10/calibre3.png)
From the top right of the new screen, you select epub. Calibre also gives your the option to create a mobi file, but I found that those files didnt always work the way I wanted them to.
![creating ebooks with Calibre in Linux -3](https://itsfoss.com/wp-content/uploads/2016/10/calibre4.png)
### STEP 5
Click the “Look & Feel” tab from the left side of the new dialog box. Now, select the “Remove spacing between paragraphs”.
![creating ebooks with Calibre in Linux - 4](https://itsfoss.com/wp-content/uploads/2016/10/calibre5.png)
Next, we will create the table of contents. If dont plan to use a table of contents in your book, you skip this step. Select the Table of Contents tab. From there, click on the select the wand icon to the right of “Level 1 TOC (XPath expression)”.
![creating ebooks with Calibre in Linux - 5](https://itsfoss.com/wp-content/uploads/2016/10/calibre6.png)
In the new window, select “h1” from the drop down menu under “Match HTML tags with tag name”. Click “OK” to close the window. If you set up sub-chapters, set the “Level 2 TOC (XPath expression)” to h2.
![creating ebooks with Calibre in Linux - 6](https://itsfoss.com/wp-content/uploads/2016/10/calibre7.png)
Before we start the conversion, select EPUB Output. On the new page, select the “Insert inline Table of Contents” option.
![creating ebooks with Calibre in Linux - 7](https://itsfoss.com/wp-content/uploads/2016/10/calibre8.png)
Now all you have to do is click “OK” to start the conversion process. Unless you have a huge file, the conversion should finish fairly quickly.
There you go, you just created a quick ebook
For the more advanced users who know how to write CSS, Calibre gives your the option to add CSS styling to your text. Just go to the “Look & Feel” section and select the styling tab. If you try to do this with mobi, it wont accept all of the styling for some reason.
![creating ebooks with Calibre in Linux - 8](https://itsfoss.com/wp-content/uploads/2016/10/calibre9.png)
Well, that was fairly easy, isnt it? I hope this tutorial helped you to create eBooks in Linux.
--------------------------------------------------------------------------------
via: https://itsfoss.com/create-ebook-calibre-linux/
作者:[John Paul ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[1]:http://pinterest.com/pin/create/button/?url=https://itsfoss.com/create-ebook-calibre-linux/&description=How+To+Create+An+Ebook+With+Calibre+In+Linux+%5BComplete+Guide%5D&media=https://itsfoss.com/wp-content/uploads/2016/10/Create-an-eBook-in-Linux.jpg
[2]:https://www.linkedin.com/cws/share?url=https://itsfoss.com/create-ebook-calibre-linux/
[3]:https://twitter.com/share?original_referer=https%3A%2F%2Fitsfoss.com%2F&source=tweetbutton&text=How+To+Create+An+Ebook+With+Calibre+In+Linux+%5BComplete+Guide%5D&url=https%3A%2F%2Fitsfoss.com%2Fcreate-ebook-calibre-linux%2F&via=%40itsfoss
[4]:https://itsfoss.com/fix-updater-issue-pear-os-8/
[5]:https://itsfoss.com/open-epub-books-ubuntu-linux/
[6]:http://calibre-ebook.com/
[7]:https://www.libreoffice.org/
[8]:https://itsfoss.com/wp-content/uploads/2016/10/Create-an-eBook-in-Linux.jpg

View File

@ -1,3 +1,5 @@
【翻译中】 by jayjay823
# 5 Best FPS Games For Linux
![best FPS games for linux](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/fps-games-for-linux.jpg?581)

View File

@ -1,113 +0,0 @@
Vic020
# How to design and add your own font on Linux with Glyphr
LibreOffice already offers a galore of fonts, and users can always download and add more. However, if you want to create your own custom font, you can do it easily by using Glyphr. Glyphr is a new open source vector font designer with an intuitive and easy to use graphical interface and a rich set of features that will take care every aspect of the font design. Although the application is still in early development, it is already pretty good. Heres a quick guide showing how to design your own custom fonts on Glyphr, and how to add them on LibreOffice once youre done.
First of all, we need to download Glyphr from the official git repository ([https://github.com/glyphr-studio/Glyphr-Studio-Desktop][14]). It is available in binary form, in both 32 and 64 bits. Once the file is downloaded, navigate to the destination, unzip the file, enter the newly created folder, right click on the “Glyphr Studio” binary file and select “Run”.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_1.png)
][13]
This will launch the application giving you three options. One is to create a new font set from scratch. The second is to load an existing project that can be of a Glyphr Studio Project form, and Open or True Type font, or an SVG font. The third is to load one of the two example sets so that you can modify these instead of working on a new set from the ground up. I will select the first option to showcase a few basic design concepts.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_2.png)
][12]
Once you enter the editor screen, you may select the letter that you want to design from the panel on the left side of the screen, and then indulge in the design work on the drawing area that is on the right. I will start with the letter “A” by clicking on its icon.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_3.png)
][11]
To design something on the drawing board, we can select either the “shapes” tools from the top left of the board which are a rectangle, an oval, and a path share, or use the first item of the second row of the tools that is the path editing tool. Click on that and start putting points on the board to create shapes. The more points you add, the greater the shaping options that youll have on the next step.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_4.png)
][10]
To move the points and thus share the path differently, you will need to select the path edit tool that is to the right of the path editing tool and click on the shape to reveal the points. Then you may drag them into position as you like.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_5.png)
][9]
Finally, the shape edit tool lets you select a shape and drag it into position, change its dimension or even rotate it.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_6.png)
][8]
Another useful set of design actions are the copy-paste, flip-rotate options that are offered on the left panel after you enter the letter design phase. For example, lets suppose that I am creating the “B” letter of my font set, and that I want to mirror the upper side of what Ive done to the bottom so as to keep a good level of coherence in the design.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_7.png)
][7]
Now, to do this, I must choose the shape editing tool to select the part that I want to mirror, click on the copy action, then click on the past right above it, drag the pasted shape where I want it to be and then click on the flip horizontally or vertically depending on what I am trying to achieve.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_8.png)
][6]
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_9.png)
][5]
There are tons of more things that I could showcase in the design aspect of the application, but theres really no point in doing so. If youre interested you can dive in and discover the numerical-based editing, the curving, the guiding, and many more.
Fonts however arent only about individual letters design, and you can discover other aspects of the font design by clicking on the “Navigate” menu on the top left of the application and adjust the kerning between specific pairs of characters, add ligatures, add components, and set general font settings.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_10.png)
][4]
You may even give your new font a “test drive” so that you can get the idea of how well your font settings and kerning works and what to do in order to optimize them.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_11.png)
][3]
After the design and optimization are done, you may export your new font set on either a true type font format, or an svg.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_12.png)
][2]
To add the font on your system, open it with the font viewer and click on the “Install” option. If that doesnt work, create a new folder in your home directory named as “.fonts” and place the font file inside it. Alternatively, you may open the file manager as root, navigate to /usr/share/fonts/opentype, create a new folder there and paste the font file inside. Then open a terminal and run this command to clear the cache: “sudo fc-cache -f -v”
This should add the new font on LibreOffice, and also to any other text application in your system like Gedit for example.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_13.png)
][1]
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/how-to-design-and-add-your-own-font-on-linux-with-glyphr/
作者:[Bill Toulas][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://twitter.com/howtoforgecom
[1]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_13.png
[2]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_12.png
[3]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_11.png
[4]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_10.png
[5]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_9.png
[6]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_8.png
[7]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_7.png
[8]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_6.png
[9]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_5.png
[10]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_4.png
[11]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_3.png
[12]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_2.png
[13]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_1.png
[14]:https://github.com/glyphr-studio/Glyphr-Studio-Desktop

View File

@ -1,58 +0,0 @@
OneNewLife translating
When to use NGINX instead of Apache
=====
>They're both popular open-source web servers but, according to NGINX CEO Gus Robertson, they have different use cases. And Microsoft? Its web server has dropped below 10 percent of all active websites for the first time in 20 years.
![web-server-popularity-october-2016.png](http://zdnet1.cbsistatic.com/hub/i/r/2016/11/07/f38d190e-046c-49e6-b451-096ee0776a04/resize/770xauto/b009f53417e9a4af207eff6271b90c43/web-server-popularity-october-2016.png)
Apache is the top web server, but NGINX continues to gain and Microsoft IIS falls below 10 percent for the first time in decades.
[NGINX][4] has risen to become the number two web server. It surpassed [Microsoft Internet Information Services (IIS)][5] long ago and has been creeping up on long-time top web server [Apache][6]. But, NGINX CEO Gus Roberston said in an interview, Apache and NGINX are not after the same audiences.
"I think Apache is a great web server. NGINX is different use case," said Robertson. "We don't see Apache as a rival. Our customers use NGINX to replace hardware load balancers and build micro-services neither of which is Apache."
Indeed, Robertson finds that many customers use both open-source web services. "Customers will use NGINX in front of Apache for load balancing and applications. Our architecture is quite different and we can do better concurrent web services." He also said NGINX works better in cloud configurations.
He concluded, "We're the only web server still growing, everyone else is still shrinking."
These gains, coupled with Microsoft's loss of 1.2 million active sites, led to Microsoft's share of active sites dropping to 9.27 percent, the first time that it has fallen below 10 percent. Apache increased its market share by 0.19 percentage points and continues to dominate, now with 46.30 percent of active sites. Still, it is true that over the years Apache has been slowly declining, while NGINX is now at 19 percent.That's not quite true. According to the [October Netcraft web server survey][7], Apache saw the largest increase of active sites this month, gaining 1.8 million, while NGINX gained 400,000, the second-largest growth.
NGINX's developers are seeking to make their open-core commercial web server, [NGINX Plus][8], more competitive by continuing to improve it. With the latest release, [NGINX Plus Release 11 (R11][9]), the server is both easier to extend and customize, and support a broader range of deployments.
The biggest addition is binary compatibility for [dynamic modules][10]. This means that dynamic modules that have been compiled against the [open-source NGINX software][11] can be loaded into NGINX Plus.
This means you can leverage the large number of [thirdparty NGINX modules][12] to extend and add functionality to NGINX Plus, drawing from a range of open-source and commercially produced modules. Developers can create custom extensions, addons, and new products based on the supported NGINX Plus core.
NGINX Plus R11 also added other enhancements:
* [Improved TCP/UDP load balancing][1] -- New features include SSL server name routing, new logging functionality, additional variables, and improved PROXY protocol support. These new features enhance debugging capabilities and enable you to support a broader range of enterprise applications.
* [Better geolocation by IP address][2] -- The thirdparty GeoIP2 module is now certified and provided to NGINX Plus customers. This new version provides localized and richer location detail than the original GeoIP module.
* [Enhanced nginScript module][3] -- nginScript is the nextgeneration configuration language for NGINX Plus, based on JavaScript. New features enable you to modify request and response data on the fly in the Stream (TCP/UDP) module.
The end result? NGINX is poised to continue to make the race for the top web server a two-horse race. Microsoft IIS? It continues to slowly fade away.
--------------------------------------------------------------------------------
via: http://www.zdnet.com/article/when-to-use-nginx-instead-of-apache/
作者:[ Steven J. Vaughan-Nichols][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/
[1]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-tcp-udp-lb
[2]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-geoip2
[3]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-nginScript
[4]:https://www.nginx.com/
[5]:https://www.iis.net/
[6]:https://httpd.apache.org/
[7]:https://news.netcraft.com/archives/2016/10/21/october-2016-web-server-survey.html
[8]:https://www.nginx.com/products/
[9]:https://www.nginx.com/blog/nginx-plus-r11-released/
[10]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-dynamic-modules
[11]:https://www.nginx.com/products/download-oss/
[12]:https://www.nginx.com/resources/wiki/modules/index.html?utm_source=nginx-plus-r11-released&utm_medium=blog

View File

@ -1,3 +1,5 @@
OneNewLife translating
Apache Vs Nginx Vs Node.js And What It Means About The Performance Of WordPress Vs Ghost
============================================================
@ -44,7 +46,7 @@ In addition, stress test to measure server function under high load was also iss
As for the content, the main focus was about a static file containing a number of Lorem Ipsum verses with headings and an image.
[
![Lorem Ipsum and ApacheBenchmark](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Lorem-Ipsum-and-ApacheBenchmark-730x411.jpg)
![Lorem Ipsum and ApacheBenchmark](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Lorem-Ipsum-and-ApacheBenchmark-730x411.jpg)
][3]
Lorem Ipsum and ApacheBenchmark
@ -60,7 +62,7 @@ That aside, I also wanted to test a more real case scenario where I benchmarked
As Im running Gentoo Linux, you could say that either one of my HTTP servers is starting from an optimized state to begin with, since I built them using only the use-flags I actually needed. I.e there shouldnt be any unnecessary code or module loading or running in the background while I ran my tests.
[
![Apache vs Nginx vs Node.js use-flags](http://iwf1.com/wordpress/wp-content/uploads/2016/10/Apache-vs-Nginx-vs-Node.js-use-flags-730x241.jpg)
![Apache vs Nginx vs Node.js use-flags](http://iwf1.com/wordpress/wp-content/uploads/2016/10/Apache-vs-Nginx-vs-Node.js-use-flags-730x241.jpg)
][4]
Apache vs Nginx vs Node.js use-flags
@ -116,13 +118,13 @@ The Node.js server used in the static tests was custom built from scratch, tailo
Click on the images to enlarge:
[
![Apache vs Nginx vs Node: performance under requests load (per 100 concurrent users)](http://iwf1.com/wordpress/wp-content/uploads/2016/11/requests-730x234.jpg)
![Apache vs Nginx vs Node: performance under requests load (per 100 concurrent users)](http://iwf1.com/wordpress/wp-content/uploads/2016/11/requests-730x234.jpg)
][5]
Apache vs Nginx vs Node: performance under requests load (per 100 concurrent users)
[
![Apache vs Nginx vs Node: performance under concurrent users load](http://iwf1.com/wordpress/wp-content/uploads/2016/11/concurrency-730x234.jpg)
![Apache vs Nginx vs Node: performance under concurrent users load](http://iwf1.com/wordpress/wp-content/uploads/2016/11/concurrency-730x234.jpg)
][6]
Apache vs Nginx vs Node: performance under concurrent users load (per 1,000 requests)
@ -130,7 +132,7 @@ Apache vs Nginx vs Node: performance under concurrent users load (per 1,000 requ
### Stress Testing
[
![Apache vs Nginx vs Node: time to complete 100,000 requests with concurrency of 1,000](http://iwf1.com/wordpress/wp-content/uploads/2016/11/stress.jpg)
![Apache vs Nginx vs Node: time to complete 100,000 requests with concurrency of 1,000](http://iwf1.com/wordpress/wp-content/uploads/2016/11/stress.jpg)
][7]
Apache vs Nginx vs Node: time to complete 100,000 requests with concurrency of 1,000
@ -192,7 +194,7 @@ Indeed, a scientific lab-conditioned test would be hard to devise. However, in t
Since the results were measured against different criteria and most importantly not exact same sizes, it wouldnt be fair to display them side by side in a chart. Hence a table is used instead:
[
![Node vs Nginx vs Apache comparison table](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Nginx-vs-Apache-comparison-table-730x185.jpg)
![Node vs Nginx vs Apache comparison table](http://iwf1.com/wordpress/wp-content/uploads/2016/11/Node-vs-Nginx-vs-Apache-comparison-table-730x185.jpg)
][8]
Node vs Nginx vs Apache running WordPress & Ghost. Top 2 rows are WordPress, bottom 2 are Ghost

View File

@ -1,3 +1,5 @@
Vic020
Introduction to Eclipse Che, a next-generation, web-based IDE
============================================================
![Introduction to Eclipse Che, a next-generation, web-based IDE](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDU_OSDC_OpenClass_520x292_FINAL_JD.png?itok=ETOrrpcP "Introduction to Eclipse Che, a next-generation, web-based IDE")

View File

@ -1,53 +1,54 @@
谁需要 GUI——L[inux 终端生存之道
谁需要 GUI——Linux 终端生存之道
=================================================
完全在 Linux 终端中生存并不容易,但这绝对是可行的。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-1-100669790-orig.jpg)
### 处理常见功能的最佳 Linux shell 应用
你是否曾想像过完完全全在 Linux 终端里生存?即没有图形桌面。没有现代的 GUI 软件,仅有的就是文本——在 Linux shell 中,除了文本还是文本。这对于大部分人来说可能并不容易,但这是绝对可以逐渐做到的。[我最近在曾是在 30 天内只在 Linux shell 中生存][1]。下边提到的就是我最喜欢用的 shell 应用,它们可以用来处理多数的常用电脑功能(网页浏览、文字处理等)。这些显然有些不足,因为存文本实在是有些艰难。
你是否曾想像过完完全全在 Linux 终端里生存?没有图形桌面,没有现代的 GUI 软件,只有文本 —— 在 Linux shell 中,除了文本还是文本。这可能并不容易,但这是绝对可行的。[我最近尝试完全在 Linux shell 中生存30天][1]。下边提到的就是我最喜欢用的 shell 应用,可以用来处理大部分的常用电脑功能(网页浏览、文字处理等)。这些显然有些不足,因为纯文本操作实在是有些艰难。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-2-100669791-orig.png)
### 在 Linux 终端里发邮件
为了能在 终端里边发送邮件,我们对可选择性有极度的渴望。很多人会推荐 mutt 和 notmuch这两个软件都功能强大并且表现非凡但是我却更喜欢 alpine。为何不仅是因为它的高效性而且如果你习惯了像 Thunderbird 之类的 GUI 邮件客户端,你会发现 alpine 的界面与它们非常相似。
要在终端里发邮件,选择有很多。很多人会推荐 mutt 和 notmuch这两个软件都功能强大并且表现非凡但是我却更喜欢 alpine。为何不仅是因为它的高效性还因为如果你习惯了像 Thunderbird 之类的 GUI 邮件客户端,你会发现 alpine 的界面与它们非常相似。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-3-100669837-orig.jpg)
### 在 Linux 终端里浏览网页
我有句号要给你说:[w3m][5]。好吧,我承认这并不是一句话。但 w3m 的确是我在 Linux 终端想的作为 web 浏览器的选择。它能够柔和的将网页呈现出了,并且它也足够强大,让你在像 Google+ 之类的网站上发布消息(尽管方法并不有趣)。实际上 Lynx 可能才是那个基于文本的 Web 浏览器,但 w3m 还是我最想用的
我有一个词要告诉你:[w3m][5]。好吧,我承认这并不是一个真实的词。但 w3m 的确是我在 Linux 终端的 web 浏览器选择。它能够很好的呈现网页,并且它也足够强大,可以用来在像 Google+ 之类的网站上发布消息(尽管方法并不有趣)。 Lynx 可能是事实上的基于文本的 Web 浏览器,但 w3m 还是我的最爱
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-4-100669838-orig.jpg)
### 在 Linux 终端里编辑文本
对于编辑简单的文本文件,有那么一个应用是我最爱用的。不!不!不是 emacs同样也绝对不是 vim。对于编辑文本文件或者简要记下笔记我喜欢使用 nano。对就是 nano。它非常简单易于学习并且使用方便。当然还有更多的软件富含其他特性,但 nano 的使用则是最令人愉快的。
对于编辑简单的文本文件,有一个应用是我最的最爱。不!不!不是 emacs同样也绝对不是 vim。对于编辑文本文件或者简要记下笔记我喜欢使用 nano。对就是 nano。它非常简单易于学习并且使用方便。当然还有更多的软件具有更多功能,但 nano 的使用是最令人愉快的。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-5-100669839-orig.jpg)
### 在 Linux 终端里处理文字
在一个只有文本的 shell 之中,对于“文本编辑器”和“文字处理程序”实在没有什么大的区别。但是像我这样需要大量写作的,如果有一些内置应用来长期协同则是非常必要的。而我最爱的就是 wordgrinder。它由足够的工具让我愉快工作——一个菜单驱动的界面使用快捷键控制并且支持开放文档、HTML或其他等多种文件格式。
在一个只有文本的 shell 之中,“文本编辑器” “文字处理程序” 实在没有什么大的区别。但是像我这样需要大量写作的,有一个专门用于长期写作的软件是非常必要的。而我最爱的就是 wordgrinder。它由足够的工具让我愉快工作——一个菜单驱动的界面使用快捷键控制并且支持OpenDocument、HTML或其他等多种文件格式。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-6-100669795-orig.jpg)
### 在 Linux 终端里听音乐
当谈到在 shell 中播放音乐(比如 mp3ogg 等),有一个软件绝对是卫冕之王:[cmus][7]。它支持所有你想得到的文件格式。它的使用超级简单,运行速度超级快,并且只使用系统少量的资源。如此清洁,如此流畅。这才是一个好的应用播发器的样子。
当谈到在 shell 中播放音乐(比如 mp3ogg 等),有一个软件绝对是卫冕之王:[cmus][7]。它支持所有你想得到的文件格式。它的使用超级简单,运行速度超级快,并且只使用系统少量的资源。如此清洁,如此流畅。这才是一个好的音乐播放器的样子。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-7-100669796-orig.jpg)
### 在 Linux 终端里发送即时消息
When I realized how will I could instant message from the terminal, my head exploded. You know Pidgin, the multi-protocol IM client? Well, it has a version for the terminal, called “finch,” that allows you to connect to multiple networks and chat with multiple people at once. The interface is even similar to Pidgin. Just amazing. Use Google Hangouts? Try hangups. It has a nice tabbed interface and works amazingly well. Seriously. Other than needing perhaps some emoji and inline pictures, instant messaging from the shell is a great experience.
当我在想如果可以在终端里发送即时消息会是什么样子的时候,我的思绪瞬间爆发了。你可能知道 Pidgin——一个支持多种协议的 IM 客户端,它也有一个终端版,叫做“[finch][8]”,你可以使用它来同时链接多个网络、同时和几个人聊天。而且,它的界面也和 Pidgin 极为相似。多么令人惊叹啊!想要使用 Google 环聊Google Hangouts就试试 [hangups][9]。它有一个非常漂亮的分页式界面,并且效果非常好。认真来说,除了一些可能需要的 emoji 表情和嵌入式图片外,在终端里发送即时消息真的是一个很好的体验。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-8-100669797-orig.jpg)
### 在 Linux 终端里发布推文
这不是开玩笑!由于 [rainbowstream][10] 的存在,我们已经在终端里发布推文了。尽管我经常遇到一些错误信息,但体验一番之后,它确实可以很好的工作。虽然不能像在网页版 Twitter也不能像其移动版那样但这是一个终端版的,来试一试吧。尽管它的功能还未完善,但是用起来还是很酷,不是吗?
这不是开玩笑!由于 [rainbowstream][10] 的存在,我们已经可以在终端里发布推文了。尽管我时不时遇到一些bug但整体上它工作得很好。虽然没有网页版 Twitter 或官方移动客户端那么好用但这是一个终端版的Twitter,来试一试吧。尽管它的功能还未完善,但是用起来还是很酷,不是吗?
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-9-100669798-orig.jpg)
@ -59,25 +60,25 @@
### 在 Linux 终端里管理进程
可以 [htop][12]。与 top 相似,但更好用、更美观。有时候,我打开 htop 之后就让它一直运行。这样做是因为,它就是一个音乐视察器——当然,这里显示的是 RAM 和 CPU 使用情况。
可以使用 [htop][12]。与 top 相似,但更好用、更美观。有时候,我打开 htop 之后就让它一直运行。没有愿意,就是喜欢!从某方面说,它就像将音乐可视化——当然,这里显示的是 RAM 和 CPU 的使用情况。
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-11-100669800-orig.png)
### 在 Linux 终端管理文件
### 在 Linux 终端管理文件
在一个纯文本终端里并不意味着你不能享受生活的美好之物。比方说一个出色的文件浏览和管理器。基于这样的场景,[Midnight Commander][13] 则是极其好用的一个
在一个纯文本终端里并不意味着你不能享受生活的美好之物。比方说一个出色的文件浏览和管理器。这方面,[Midnight Commander][13] 是很好用的
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-12-100669801-orig.png)
### 在 Linux 终端里管理终端窗口
如果你需要在终端里工作很长时间,你就需要一个多窗口终端了。基本上,它就是这样一个软件——可以让你将终端回话分割成一个自定义网格,让你同时使用和查看多个终端应用。对于 shell它相当于一个瓦片时窗口管理器。我最喜欢用的就是 [tmux][14]。但 [GNU Screen][15] 也是很好用的。你可能需要花一些时间来学习怎么使用,但你会用之后,你就会迷上这样的用法
如果要在终端里工作很长时间,就需要一个多窗口终端了。它是这样一个软件 —— 可以将用户终端会话分割成一个自定义网格,从而可以同时使用和查看多个终端应用。对于 shell它相当于一个平铺式窗口管理器。我最喜欢用的是 [tmux][14]。不过 [GNU Screen][15] 也很好用。学习怎么使用它们可能要花点时间,但一旦会用,就会很方便
![](http://core0.staticworld.net/images/article/2016/07/linux-terminal-13-100669802-orig.jpg)
### 在 Linux 终端里进行讲稿演示
不管是 LibreOffice、Google slides、gasp 或者 PowerPoint。我都会在讲稿演示软件花费很多时间。如果这类软件有一个终端版的就美妙了。它应该叫做“[文本演示程序][16]”。很显然,没有图片,只是一个使用简单标记语言将幻灯片放在一起的简单程序。它不可能让你在其中插入猫的图片,但它却可以让你在终端里进行完整的演示。
这类软件有 LibreOffice、Google slides、gasp 或者 PowerPoint。我在讲稿演示软件花费很多时间很高兴有一个终端版的软件。它称做“[文本演示程序][16]”。很显然,没有图片,只是一个使用简单标记语言将放在一起的幻灯片展示出来的简单程序。它不可能让你在其中插入猫的图片,但可以让你在终端里进行完整的演示。
--------------------------------------------------------------------------------
@ -85,7 +86,7 @@ via: http://www.networkworld.com/article/3091139/linux/who-needs-a-gui-how-to-li
作者:[Bryan Lunduke][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -2,25 +2,26 @@
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/10/Writers-Opinion-Driverless-Car-Featured.jpg "你会考虑乘坐无人驾驶汽车吗?")
技术经历了多次重大运动。最近我们经历的是如苹果手表及克隆FitBits 谷歌眼镜等可穿戴设备。看起来下一个就是人们研究了很长时间的无人驾驶汽车了。
科技在经历重大进展。最近我们经历的是如苹果手表及各种克隆FitBit活动智能设备 谷歌眼镜等可穿戴设备。看起来下一个就是人们研究了很长时间的无人驾驶汽车了。
这些汽车,有时叫做自动汽车,自动驾驶汽车,或机器人汽车,确实可以依靠技术自己驾驶。它们能探测周边环境,如障碍物和标志,并使用 GPS 找到自己的路线。但是它们驾驶起来安全吗?我们请教我们的技术编辑,“你会考虑乘坐无人驾驶汽车吗?
这些汽车,有时叫做自动汽车,自动驾驶汽车,或机器人汽车,确实可以依靠技术自己驾驶。它们能探测周边环境,如障碍物和标志,并使用 GPS 找到自己的路线。但是它们驾驶起来安全吗?我们请教我们的科技作者,“你会考虑乘坐无人驾驶汽车吗?”
### 我们的观点
**Derrik** 说他会乘坐无人驾驶汽车,因为 “_技术就在那里,而且很多聪明能干的人研究了很长时间。_” 他承认它们还是有些问题但他相信很多事故的发生是因为有人的参与。如果不考虑人他认为乘坐无人驾驶汽车会“_难以置信的安全_。”
**Derrik** 说他会乘坐无人驾驶汽车,因为 “_技术而且很多聪明能干的人研究了很长时间。_” 他承认它们还是有些问题但他相信很多事故的发生是因为有人的参与。如果不考虑人他认为乘坐无人驾驶汽车会“_难以置信的安全_。”
对 **Phil**来说,这些汽车让他“发毛”,但他也承认这是他想象出的,因为他从没乘坐过。他同意 Derrik 这些技术是高度发达的观点也知道它的原理但仍然认为“_ 做为勒德主义者很难接受_” 他甚至坦白说很少使用巡航定速。他认为依赖它太多的司机会让他感到不安全。
对 **Phil**来说,这些汽车让他“紧张”,但他也承认这是他想象出的,因为他从没乘坐过。他同意 Derrik 这些技术是高度发达的观点也知道它的原理但仍然认为“_ 自己新技术接受缓慢不会购买这类车_” 他甚至坦白说平时很少使用定速巡航。他认为依赖它太多的司机会让他感到不安全。
![writers-opinion-driverless-car](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2016/10/Writers-Opinion-Driverless-Car.jpg "编辑对无人驾驶汽车的观点")
**Robert** 认为“_这个概念确实有点怪_”但原则上他看不到汽车不向那个方向发展的理由。 他指出飞机已经走了那条路,而且变得更加安全, 他认为事故发生的主因是“_人们过于依赖科技,而当科技出现故障时因不知所措而产生的错误。_”
**Robert** 认为“_这个概念确实有点怪_”但原则上他看不到汽车不向那个方向发展的理由。 他指出飞机已经走了那条路,而且变得更加安全, 他认为事故发生的主因是“_人们过于依赖科技手段,而当科技出现故障时不知所措而导致。_”
他是一个“焦虑乘客”, 更喜欢控制整个局面, 即对他来说就是他的车子在向哪里开。如果是以低速在城市中驾驶他感觉还好,但如果是在“宽不够两辆车交叉通过的绕来绕去的英国乡村道路”上,则决不可以。他和 Phil 都认为英国道路与美国不同。他建议让别人去做小白鼠, 等到确定安全了再乘坐。
他是一个“焦虑型乘客”, 更喜欢控制整个局面。 对他来说,他的车子在哪里开很重要。如果是以低速在城市中驾驶他感觉还好,但如果是在“宽度不足两车道的弯弯曲曲的英国乡村道路”上,则绝不可以。他和 Phil 都认为英国道路与美国道路大大不同。他建议让别人去做小白鼠, 等到确定安全了再乘坐。
对 **Mahesh**来说, 他绝对会乘坐无人驾驶汽车,因为他知道这些汽车公司“ 拥有安全技术,决不会让他们的顾客去冒险。 ” 他承认安全与否还与车辆行驶的道路有关。
对 **Mahesh**来说, 他绝对会乘坐无人驾驶汽车,因为他知道这些汽车公司“ 拥有坚实的安全技术,决不会让他们的顾客去冒险。 ” 他承认安全与否还与车辆行驶的道路有关。
我的观点有些像这些观点的折中。虽然平时我会快速地投入到新科技中,但如果要拿生命去冒险,我不会那么做。我承认这些汽车发展了很久,应该很安全。而且坦率地说,很多司机比无人驾驶汽车危险得多。但和 Robert 一样,我想我会让其他人去做小白鼠,等到它更普遍了再去乘坐。
我的观点有些像这些观点的折中。虽然平时我会快速地投入到新科技中,但如果要拿生命去冒险,我不会那么做。我承认这些汽车发展了很久,所以很安全。而且诚恳地说,路上有很多司机比无人驾驶汽车还要危险得多。但像 Robert 一样,我想我会让其他人去做小白鼠,等到它更普遍了再去乘坐。
### 你的观点
@ -36,7 +37,7 @@ via: https://www.maketecheasier.com/riding-driverless-car/?utm_medium=feed&utm_s
译者:[willcoderwang](https://github.com/willcoderwang)
校对:[校对者ID](https://github.com/校对者ID)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,86 @@
现在Linux运行在99.6%的TOP500超级计算机上
============================================================
[
![Linux rules the world of supercomputers](https://itsfoss.com/wp-content/uploads/2016/11/Linux-King-Supercomputer-world-min.jpg)
][12]
_简介虽然Linux在桌面操作系统只有2%的市场占有率但是对于超级计算机来说Linux用99%的市场占有率轻松地获取了统治地位。_
**Linux运行在超过99%的TOP500超级计算机上**这并不会让人感到惊讶。2015年我们报道过[《Linux正运行在超过97%的TOP500超级计算机上》][13]今年Linux表现得更好。
[#Linux now runs on more than 99% of top 500 #supercomputers in the world][4]
[点击到twitter][5]
这些信息是由独立组织[Top500][4]收集的每两年他们会公布已知的最快的500台超级计算机的细节。你可以[打开这个网站,用以下条件筛选所需要的信息][15]:国家、使用的操作系统类型、所有者等。别担心,我将会从这份表格中筛选整理出今年几个有趣的事实。
### Linux运行在500台超级计算机中的498台
如果要将上面的百分比细化到具体数量的话500台超级计算机中的498台运行着Linux。剩余的两台超级计算机运行着基于Unix的操作系统。直到去年还有一台超级计算机上在运行Windows今年的列表中没有出现Windows的身影。或许这些超级计算机没一台能运行Windows 10一语双关
总结一下今年表单上TOP500超级计算机所运行操作系统情况
* Linux: 498
* Unix: 2
* Windows: 0
还有一份总结它清晰展现了每年Linux在TOP500超级计算机的份额的变化情况。
* 2012年: 94%
* [2013][6]年: 95%
* [2014][7]年: 97%
* [2015][8]年: 97.2%
* 2016年: 99.6%
* 2017年: ???
另外最快的前380台超级计算机运行着Linux包括在中国的那台最快的超级计算机。排名第386和第387的超级计算机运行着Unix它们同样来自中国。
### 其他关于最快的超级计算机的有趣数据
[
![List of top 10 fastest supercomputers in the world in 2016](https://itsfoss.com/wp-content/uploads/2016/11/fastest-supercomputers.png)
][16]
除去Linux我在表单中还找到了几个有趣的数据想跟你分享。
* 全球最快的超级计算机是[神威太湖一号][9]. 它位于[国家超级计算无锡中心][10]。它有着93PFlops的速度.
* 全球第二快的超级计算机是中国的[天河二号][11]第三的位置则属于美国的Titan。
* 在速度前十的超级计算机中美国占据了5台日本和中国各有4台瑞士有1台。
* 美国和中国都各有171台超级计算机进入了TOP500的榜单中。
* 日本有27台法国有20台印度、俄罗斯和沙特阿拉伯各有5台进入了榜单中。
有趣的事实,不是吗?你能点击[这里][18]筛选出属于自己的榜单来获得更多信息。现在我很开心来宣传Linux运行在99%的TOP500超级计算机上期待下一年能有100%的更好成绩。
当你在阅读这篇文章时请在社交平台上分享这篇文章这是Linux的一个成就我们引以为豪~:P
--------------------------------------------------------------------------------
via: https://itsfoss.com/linux-99-percent-top-500-supercomputers
作者:[Abhishek Prakash ][a]
译者:[ypingcn](https://github.com/ypingcn)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[1]: https://twitter.com/share?original_referer=https%3A%2F%2Fitsfoss.com%2F&amp;source=tweetbutton&amp;text=Linux+Now+Runs+On+99.6%25+Of+Top+500+Supercomputers&amp;url=https%3A%2F%2Fitsfoss.com%2Flinux-99-percent-top-500-supercomputers%2F&amp;via=%40itsfoss
[2]: https://www.linkedin.com/cws/share?url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/
[3]: http://pinterest.com/pin/create/button/?url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/&amp;description=Linux+Now+Runs+On+99.6%25+Of+Top+500+Supercomputers&amp;media=https://itsfoss.com/wp-content/uploads/2016/11/Linux-King-Supercomputer-world-min.jpg
[4]: https://twitter.com/share?text=%23Linux+now+runs+on+more+than+99%25+of+top+500+%23supercomputers+in+the+world&amp;via=itsfoss&amp;related=itsfoss&amp;url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/
[5]: https://twitter.com/share?text=%23Linux+now+runs+on+more+than+99%25+of+top+500+%23supercomputers+in+the+world&amp;via=itsfoss&amp;related=itsfoss&amp;url=https://itsfoss.com/linux-99-percent-top-500-supercomputers/
[6]: https://itsfoss.com/95-percent-worlds-top-500-supercomputers-run-linux/
[7]: https://itsfoss.com/97-percent-worlds-top-500-supercomputers-run-linux/
[8]: https://itsfoss.com/linux-runs-97-percent-worlds-top-500-supercomputers/
[9]: https://en.wikipedia.org/wiki/Sunway_TaihuLight
[10]: https://www.top500.org/site/50623
[11]: https://en.wikipedia.org/wiki/Tianhe-2
[12]: https://itsfoss.com/wp-content/uploads/2016/11/Linux-King-Supercomputer-world-min.jpg
[13]: https://itsfoss.com/linux-runs-97-percent-worlds-top-500-supercomputers/
[14]: https://www.top500.org/
[15]: https://www.top500.org/statistics/sublist/
[16]: https://itsfoss.com/wp-content/uploads/2016/11/fastest-supercomputers.png
[17]: https://itsfoss.com/digikam-5-0-released-install-it-in-ubuntu-linux/
[18]: https://www.top500.org/statistics/sublist/

View File

@ -0,0 +1,68 @@
Arch Linux: DIY用户的终结圣地
![Tripple Renault photo by Gilles Paire via
Shutterstock ](https://regmedia.co.uk/2016/10/31/tripple_renault_photo_by_gilles_paire_via_shutterstock.jpg?x=648&y=348&crop=1)
深入研究下Linux系统的新闻史你会发现其中有一些鲜为人知的Linux发行版而且关于这些操作系统的新闻报道的数量也十分惊人。
新发行版中的佼佼者比如Elementary
OS和Solus操作系统因其华丽的界面而被大家所关注并且任何搭载MATE桌面环境的操作系统都因其简洁性而被广泛报道。
感谢像《黑客军团》这样的电视节目我确信关于Kali Linux系统的报道将会飙升。
尽管有很多关于Linux系统的报道然而仍然有一个被广泛使用的Linux发行版几乎被大家完全遗忘了Arch Linux系统。
关于Arch的新闻报道很少的原因有很多其中最主要的原因是它很难安装而且你还得熟练地在命令行下完成各种配置以使其正常运行。更可怕的是大多数的用户认为最难的是配置系统复杂的安装过程令无数的菜鸟们望而怯步。
这的确很遗憾在我看来实际上一旦安装完成后Arch比我用过的其它Linux发行版更容易得多。
确实如此Arch的安装过程很让人蛋疼。有些发行版的安装过程只需要点击“安装”后就可以放手地去干其它事了。Arch相对来说要花费更多的时间和精力去完成硬盘分区手动挂载生成fstab文件等。但是从Arch的安装过程中我们学到很多。它掀开帷幕让我们弄明白很多背后的东西。事实上这个帷幕已经彻底消失了在Arch的世界里你就是帷幕背后的主宰。
除了大家所熟知的难安装外Arch甚至没有自己默认的桌面环境虽然这有些让人难以理解但是Arch也因其可定制化而被广泛推崇。你可以自行决定在Arch的基础软件包上安装任何东西。
 ![ARCH "DESKTOP" SCREENSHOT LINUX -
OBVS VARIES DEPENDING ON USER ](https://regmedia.co.uk/2016/11/01/arch.jpg?x=648&y=364&infer_y=1
"ARCH "DESKTOP" SCREENSHOT LINUX - OBVS VARIES DEPENDING ON USER
")
你可以认为Arch是高度可定制化的或者说它完全没有定制化。比如不像Ubuntu系统那样Arch几乎没有修改过或是定制开发后的软件包。Arch的开发者从始至终都使用上游开发者提供的软件包。对于部分用户来说这种情况非常棒。比如你可以使用纯粹的未定制化开发过的GNOME桌面环境。但是在某些情况下一些上游开发者未更新过的定制化软件包可能存在很多的缺陷。 
由于Arch缺乏一些默认的应用程序和桌面系统这完全不利于用户管理自己的桌面环境。我曾经使用最小化安装配置Openboxtint2和dmenu桌面管理工具但是安装后的效果却跟我很失望。因此我更倾向于使用最新版的GNOME桌面系统。在使用Arch的过程中我们会同时安装一个桌面环境但是这给我们的体验是完全不一样的。对于任何发行版来说这种做法是正确的但是大多数的Linux系统都至少会使用一个默认的桌面环境。
然而Arch还是有很多共性的元素一起构成这个基本系统。比如说我使用Arch系统的主要原因是因为它是一个滚动更新的发行版。这意味着两件事情。首先Arch使用最新的稳定版内核。这就意味着我可以在Arch系统里完成在其它Linux发行版中很难完成的测试。滚动版最大的一个好处就是所有可用的软件更新包会被即时发布出来。这不只是说明软件包更新速度快而且也没有太多的系统升级包会被拆分。
由于Arch是一个滚动更新的发行版因此很多用户认为它是不稳定的。但是在我使用了9个多月之后我并不赞同这种观点。
我在每一次升级系统的过程中,从未损坏过任何软件。有一次升级系统之后我不得不回滚,因为系统启动分区/boot无法挂载成功但是后来我发现那完全是自己操作上的失误。一些基本的系统缺陷比如我关于戴尔XPS笔记本触摸板相关的回归测试方面的问题已经被修复并且可用的软件包更新速度要比其它非滚动发行版快得多。总的来说我认为Arch滚动更新的发布模式比其它我在用的发行版要稳定得多。唯一一点我要强调的是查阅维基上的资料多关注你要更新的内容。
你必须要小心你正在做的操作因为Arch也不是任你肆意胡来的。盲目的更新Arch系统是极其危险的。但是任何一个发行版的更新都有风险。在你别无选择的时候你得根据实际情况三思而后行。
Arch的哲学理念是我支持它的另外一个最主要的原因。我认为Arch最吸引用户的一点就是Arch面向的是专业的Linux用户或者是有“自己动手”的态度并愿意查资料解决问题的任何人。
随着Linux逐渐成为主流的操作系统开发者们更需要顺利地渡过每一个艰难的技术领域。那些晦涩难懂的专有软件方面的经验恰恰能反映出用户高深的技术能力。
尽管在这个时代听起来有些怪怪的但是事实上我们大多数的用户更愿意自己动手装配一些东西。在这种情形下Arch将会是Linux DIY用户的终结圣地。
--------------------------------------------------------------------------------
via: http://www.theregister.co.uk/2016/11/02/arch_linux_taster/
作者:[Scott
Gilbertson][a]
译者:[rusking](https://github.com/rusking)
校对:[校对者ID](https://github.com/校对者ID)
本文由
[LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.theregister.co.uk/Author/1785
[1]:https://wiki.archlinux.org/index.php/Arch_Linux
[2]:http://www.theregister.co.uk/Author/1785
[3]:https://www.linkedin.com/shareArticle?mini=true&url=http://www.theregister.co.uk/2016/11/02/arch_linux_taster/&title=Arch%20Linux%3A%20In%20a%20world%20of%20polish%2C%20DIY%20never%20felt%20so%20good&summary=Last%20refuge%20for%20purists
[4]:http://twitter.com/share?text=Arch%20Linux%3A%20In%20a%20world%20of%20polish%2C%20DIY%20never%20felt%20so%20good&url=http://www.theregister.co.uk/2016/11/02/arch_linux_taster/&via=theregister
[5]:http://www.reddit.com/submit?url=http://www.theregister.co.uk/2016/11/02/arch_linux_taster/&title=Arch%20Linux%3A%20In%20a%20world%20of%20polish%2C%20DIY%20never%20felt%20so%20good

View File

@ -0,0 +1,455 @@
Linux 中的 DTrace
===========
![](https://raw.githubusercontent.com/brendangregg/bcc/master/images/bcc_tracing_tools_2016.png)
随着 BPF 追踪系统(基于时间采样)最后一个主要功能被合并至 Linux 4.9-rc1 版本的内核中,现在 Linux 内核拥有类似 DTrace 的原生追踪功能。DTrace 是 Solaris 系统中的高级追踪器。对于长期使用 DTrace 的用户和专家,这将是一个振奋人心的里程碑!在 Linux 系统上,现在你可以使用用安全的、低负载的定制追踪系统,通过执行时间的柱状图和频率统计等信息,分析应用的性能以及内核。
用于 Linux 的追踪工程有很多,但是最终被合并进 Linux 内核的技术从一开始就根本不是一个追踪项目:它是最开始是用于 Berkeley Packet FilterBPF的补丁。这些补丁允许 BPF 将软件包重定向,创建软件定义的网络。久而久之,支持追踪事件就被添加进来了,使得程序追踪可用于 Linux 系统。
尽管目前 BPF 没有像 DTrace 一样的高级语言,它所提供的前端已经足够让我创建很多 BPF 工具了,其中有些是基于我以前的 [DTraceToolkit][37]。这个帖子将告诉你怎么去用这些工具BPF 提供的前端,以及畅谈这项技术将会何去何从。
### 截图
我已经将基于 BPF 的追踪工具添加到了开源的 [bcc][36] 项目里(感谢 PLUMgrid 公司的 Brenden Blanco 带领 bcc 项目的发展)。详见 [bcc 安装][35] 手册。它会在 /usr/share/bcc/tools 目录下添加一系列工具,包括接下来的那些工具。
捕获新进程:
```
# **execsnoop**
PCOMM PID RET ARGS
bash 15887 0 /usr/bin/man ls
preconv 15894 0 /usr/bin/preconv -e UTF-8
man 15896 0 /usr/bin/tbl
man 15897 0 /usr/bin/nroff -mandoc -rLL=169n -rLT=169n -Tutf8
man 15898 0 /usr/bin/pager -s
nroff 15900 0 /usr/bin/locale charmap
nroff 15901 0 /usr/bin/groff -mtty-char -Tutf8 -mandoc -rLL=169n -rLT=169n
groff 15902 0 /usr/bin/troff -mtty-char -mandoc -rLL=169n -rLT=169n -Tutf8
groff 15903 0 /usr/bin/grotty
```
硬盘 I/O 延迟的柱状图:
```
# **biolatency -m**
Tracing block device I/O... Hit Ctrl-C to end.
^C
msecs : count distribution
0 -> 1 : 96 |************************************ |
2 -> 3 : 25 |********* |
4 -> 7 : 29 |*********** |
8 -> 15 : 62 |*********************** |
16 -> 31 : 100 |**************************************|
32 -> 63 : 62 |*********************** |
64 -> 127 : 18 |****** |
```
追踪常见的 ext4 操作,稍慢于 5ms
```
# **ext4slower 5**
Tracing ext4 operations slower than 5 ms
TIME COMM PID T BYTES OFF_KB LAT(ms) FILENAME
21:49:45 supervise 3570 W 18 0 5.48 status.new
21:49:48 supervise 12770 R 128 0 7.55 run
21:49:48 run 12770 R 497 0 16.46 nsswitch.conf
21:49:48 run 12770 R 1680 0 17.42 netflix_environment.sh
21:49:48 run 12770 R 1079 0 9.53 service_functions.sh
21:49:48 run 12772 R 128 0 17.74 svstat
21:49:48 svstat 12772 R 18 0 8.67 status
21:49:48 run 12774 R 128 0 15.76 stat
21:49:48 run 12777 R 128 0 7.89 grep
21:49:48 run 12776 R 128 0 8.25 ps
21:49:48 run 12780 R 128 0 11.07 xargs
21:49:48 ps 12776 R 832 0 12.02 libprocps.so.4.0.0
21:49:48 run 12779 R 128 0 13.21 cut
[...]
```
追踪新建的 TCP 活跃连接connect():
```
# **tcpconnect**
PID COMM IP SADDR DADDR DPORT
1479 telnet 4 127.0.0.1 127.0.0.1 23
1469 curl 4 10.201.219.236 54.245.105.25 80
1469 curl 4 10.201.219.236 54.67.101.145 80
1991 telnet 6 ::1 ::1 23
2015 ssh 6 fe80::2000:bff:fe82:3ac fe80::2000:bff:fe82:3ac 22
```
通过捕获 getaddrinfo()/gethostbyname() 库的调用来追踪 DNS 延迟:
```
# **gethostlatency**
TIME PID COMM LATms HOST
06:10:24 28011 wget 90.00 www.iovisor.org
06:10:28 28127 wget 0.00 www.iovisor.org
06:10:41 28404 wget 9.00 www.netflix.com
06:10:48 28544 curl 35.00 www.netflix.com.au
06:11:10 29054 curl 31.00 www.plumgrid.com
06:11:16 29195 curl 3.00 www.facebook.com
06:11:25 29404 curl 72.00 foo
06:11:28 29475 curl 1.00 foo
```
按类别划分 VFS 操作的时间间隔统计:
```
# **vfsstat**
TIME READ/s WRITE/s CREATE/s OPEN/s FSYNC/s
18:35:32: 231 12 4 98 0
18:35:33: 274 13 4 106 0
18:35:34: 586 86 4 251 0
18:35:35: 241 15 4 99 0
```
对一个给定的 PID通过内核和用户堆栈轨迹来追踪 CPU 外的时间(由内核进行统计):
```
# **offcputime -d -p 24347**
Tracing off-CPU time (us) of PID 24347 by user + kernel stack... Hit Ctrl-C to end.
^C
[...]
ffffffff810a9581 finish_task_switch
ffffffff8185d385 schedule
ffffffff81085672 do_wait
ffffffff8108687b sys_wait4
ffffffff81861bf6 entry_SYSCALL_64_fastpath
--
00007f6733a6b64a waitpid
- bash (24347)
4952
ffffffff810a9581 finish_task_switch
ffffffff8185d385 schedule
ffffffff81860c48 schedule_timeout
ffffffff810c5672 wait_woken
ffffffff8150715a n_tty_read
ffffffff815010f2 tty_read
ffffffff8122cd67 __vfs_read
ffffffff8122df65 vfs_read
ffffffff8122f465 sys_read
ffffffff81861bf6 entry_SYSCALL_64_fastpath
--
00007f6733a969b0 read
- bash (24347)
1450908
```
追踪 MySQL 查询延迟(通过 USDT 探针):
```
# **mysqld_qslower `pgrep -n mysqld`**
Tracing MySQL server queries for PID 14371 slower than 1 ms...
TIME(s) PID MS QUERY
0.000000 18608 130.751 SELECT * FROM words WHERE word REGEXP '^bre.*n$'
2.921535 18608 130.590 SELECT * FROM words WHERE word REGEXP '^alex.*$'
4.603549 18608 24.164 SELECT COUNT(*) FROM words
9.733847 18608 130.936 SELECT count(*) AS count FROM words WHERE word REGEXP '^bre.*n$'
17.864776 18608 130.298 SELECT * FROM words WHERE word REGEXP '^bre.*n$' ORDER BY word
```
<!--Using the trace multi-tool to watch login requests, by instrumenting the pam library: -->
检测 pam 库并使用多种追踪工具观察登陆请求:
```
# **trace 'pam:pam_start "%s: %s", arg1, arg2'**
TIME PID COMM FUNC -
17:49:45 5558 sshd pam_start sshd: root
17:49:47 5662 sudo pam_start sudo: root
17:49:49 5727 login pam_start login: bgregg
```
bcc 项目里的很多工具都有帮助信息(-h 选项),并且都应该包含有示例的 man 页面和文本文件。
### 必要的
2014 年Linux 追踪程序就有一些内核相关的特性(自 ftrace 和 pref_events但是我们仍然要转储并报告进程数据因为数十年的老技术会有很大规模的开销。你不能频繁地访问进程名函数名堆栈轨迹或内核中的其它任何数据。你不能在将变量保存到一个监测事件里又在另一个事件里访问它们这意味着你不能在自定义的地方计算延迟或者说时间参数。你也不能创建一个内核之内的延迟柱状图也不能追踪 USDT 探针甚至不能写自定义的程序。DTrace 可以做到这些,但仅限于 Solaris 或 BSD 系统。在 Linux 系统中,有些基于树的追踪器,像 SystemTap 就可以满足你的这些需求,但它也有自身的不足。(你可以写一个基于探针的内核模块来满足需求-但实际上没人这么做。)
2014 年我加入了 Netflix cloud performance 团队。做了这么久的 DTrace 方面的专家,转到 Linux 对我来说简直不可思议。但我确实这么做了尤其是发现了严重的问题Netflix cloud 会随着应用,微服务架构和分布式系统的快速变化,性能受到影响。有时要用到系统追踪,而我之前是用的 DTrace。在 Linux 系统上可没有 DTrace我就开始用 Linux 内核内建的 ftrace 和 perf_events 工具,构建了一个追踪工具([perf-tools][34])。这些工具很有用,但有些工作还是没法完成,尤其是延迟柱状图图以及计算堆栈踪迹。我们需要的是内核追踪程序化。
### 发生了什么?
BPF 将程序化的功能添加到现有的内核追踪工具中tracepoints, kprobes, uprobes。在 Linux 4.x 系列的内核里,这些功能大大加强了。
时间采样是最主要的部分,它被 Linux 4.9-rc1 所采用([patchset][33])。十分感谢 Alexei Starovoitov致力于 Facebook 中的 BPF 开发),改进 BPF 的主要开发者。
Linux 内核现在内建有以下这些特性(添加自 2.6 版本到 4.9 版本):
* 内核级的动态追踪BPF 对 kprobes 的支持)
* 用户级的动态追踪BPF 对 uprobes 的支持)
* 内核级的静态追踪BPF 对 tracepoints 的支持)
* 时间采样事件BPF 的 pref_event_open
* PMC 事件BPF 的 pref_event_open
* 过滤器(通过 BPF 程序)
* 调试输出bpf_trace_printk()
* 事件输出bpf_perf_event_output()
* 基础变量(全局的和每个线程的变量,基于 BPF 映射)
* 关联数组(通过 BPF 映射)
* 频率计数(基于 BPF 映射)
* 柱状图power-of-2, 线性及自定义,基于 BPF 映射)
* Timestamps and time deltas (bpf_ktime_get_ns(), and BPF programs)
* 时间戳和时间参数bpf_ktime_get_ns(),和 BPF 程序)
* 内核态的堆栈轨迹BPF stackmap 栈映射)
* 用户态的堆栈轨迹 (BPF stackmap 栈映射)
* 重写 ring 缓存pref_event_attr.write_backward
我们采用的前端是 bcc它同时提供 Python 和 lua 接口。bcc 添加了:
* 用户级静态追踪(基于 uprobes 的 USDT 探针)
* 调试输出(调用 BPF.trace_pipe() 和 BPF.trace_fields() 函数的 Python
* 所有事件输出BPF_PERF_OUTPUT 宏和 BPF.open_perf_buffer()
* 间隔输出BPF.get_table() 和 table.clear()
* 打印柱状图table.print_log2_hist()
* 内核级的 C 结构体导航bcc 重写 bpf_probe_read() 函数的映射)
* 内核级的符号解析ksym(), ksymaddr()
* 用户级的符号解析usymaddr()
* BPF tracepoint 支持(通过 TRACEPOINT_PROBE
* BPF 堆栈轨迹支持(包括针对堆栈框架的 walk 方法)
* 其它各种助手宏和方法
* 例子(位于 /examples 目录)
* 工具(位于 /tools 目录)
* 教程(/docs/tutorial*.md
* 参考手册(/docs/reference_guide.md
直到最新也是最主要的特性被整合进来,我才开始写这篇文章,现在它在 4.9-rc1 内核中。我们还需要去完成一些次要的东西,还有另外一些事情要做,但是现在我们所拥有的已经值得欢呼了。现在 Linux 拥有内建的高级追踪能力。
### 安全性
设计 BPF 以及改进版时就考虑到产品安全,它被用在大范围的生产环境里。确信的话,你应该能找到一个挂起内核的方法。这个例子是偶然而不是必然,类似的漏洞会被快速修复,尤其是当 BPF 合并入了 Linux。因为 Linux 可是公众的焦点。
在开发过程中我们碰到了一些非 BPF 的漏洞它们需要被修复rcu 不可重入,这可能导致内核由于 funccount 挂起,在 4.6 内核版本中这个漏洞被 “bpf: map pre-alloc” 所修复,旧版本内核的漏洞暂时由 bcc 处理。还有一个是 uprobe 的内存计算问题,这导致 uprobe 分配内存失败,在 4.8 内核版本这个漏洞由 “uprobes: Fix the memcg accounting” 补丁所修复,并且该补丁还将被移植到之前版本的内核中(例如,它现在被移植到了 4.4.27 和 4.4.0-45.66 版本中)。
### 为什么 Linux 追踪很耗时?
首要任务被分到了若干追踪器中间:只有联合使用这些追踪器才能有作用。想要了解更多关于这个或其它方面的问题,可以看一看我在 2014 年写的 [tracing summit talk][32]。我忽视了计数器在部分方案中的效率有些公司发现其它追踪器SystemTap 和 LTTng能满足他们的需求尽管他们乐于听到 BPF 的开发进程,考虑到他们现有的解决方案,帮助 BPF 的开发就不那么重要了。
近两年里 BPF 仅在追踪领域得到加强。这一过程原本可以更快的,但早期缺少全职工作于 BPF 追踪的工程师。Alexei Starovoitov (BPF 领导者)Brenden Blanco (bcc 领导者),我还有其它一些开发者,都有其它的事情要做。我在 Netflix 公司花了大量时间(自由工作地),大概有 7% 的时间是花在 BPF 和 bcc 上。某种程度上这不是我的首要任务,因为我还有自己的工作(包括我的 perf-tools一个工作在旧版本内核上的程序
BPF 追踪已经推出了,已经有科技公司开始关注 BPF 的特点了。但我还是推荐 [Netflix 公司][31]。(如果你为了 BPF 而要聘请我,那我还是十分乐于待在 Netflix 公司的!)
### 使用简单
DTrace 和 bcc/BPF 现在的最大区别就是哪个更好使用。这取决于你要用 BPF 追踪做什么了。如果你要
*  **使用 BPF tools/metrics**:应该是没什么区别的。工具的表现都差不多,图形用户界面的访问也类似。大部分用户通过这种方式使用 BPF。
*  **开发 tools/metrics**bcc 的开发可难多了。DTrace 有一套自己的简单语言D 语音,和 awk 语言相似,而 bcc 使用已有的带有库的语言C 语言Python 和 lua。一个用 C 和 Python 写的 bcc 工具与仅仅用 D 语言写出来的工具相比,可能要多十多倍行数的代码,或者更多。但是很多 DTrace 工具用 shell 包装来提供参数和差错,会让代码变得十分臃肿。编程的难处是不同的:重写 bcc 更需要巧妙性,这导致某些脚本更加难开发。(尤其是 bpf_probe_read() 这类的函数,需要了解更多 BPF 的内涵知识)。当计划改进 bcc 时,这一情形将得到改善。
*  **运行常见的命令**:十分相近。用 “dtrace” 命令DTrace 能做很多事,但 bcc 有各种工具traceargdistfunccountfunclatency 等等。
*  **编写自定义的特殊命令**:使用 DTrace 的话这就没有必要了。允许定制消息快速传递和系统快速响应DTrace 的高级分析很快。而 bcc 现在受限于它的多种工具以及它们的适用范围。
简单来说,如果你只使用 BPF 工具的话,就不必关注这些差异了。如果你经验丰富,是个开发者(像我一样),目前 bcc 的使用是比较困难的。
举一个 bcc 的 Python 前端的例子,下面是追踪硬盘 I/O 和 打印 I/O 容量柱状图的代码:
```
from bcc import BPF
from time import sleep
# load BPF program
b = BPF(text="""
#include <uapi/linux/ptrace.h>
#include <linux/blkdev.h>
BPF_HISTOGRAM(dist);
int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req)
{
dist.increment(bpf_log2l(req->__data_len / 1024));
return 0;
}
""")
# header
print("Tracing... Hit Ctrl-C to end.")
# trace until Ctrl-C
try:
sleep(99999999)
except KeyboardInterrupt:
print
# output
b["dist"].print_log2_hist("kbytes")
```
注意 Python 代码中嵌入的 C 语句text=)。
这就完成了任务,但仍有改进的空间。好在我们有时间去做:人们使用 Linux 4.9 并能用上 BPF 还得好几个月呢,所以我们有时间来制造工具和前端。
### 高级语言
前端越简单,比如高级语言,所改进的可能就越不如你所期望的。绝大多数人使用封装好的工具(和 GUI仅有少部分人能写出这些工具。但我不反对使用高级语言比如 SystemTap毕竟已经开发出来了。
```
#!/usr/bin/stap
/*
* opensnoop.stp Trace file open()s. Basic version of opensnoop.
*/
probe begin
{
printf("\n%6s %6s %16s %s\n", "UID", "PID", "COMM", "PATH");
}
probe syscall.open
{
printf("%6d %6d %16s %s\n", uid(), pid(), execname(), filename);
}
```
如果拥有整合了语言和脚本的 SystemTap 前端与高性能内核内建的 BPF 后端会不会令人满意呢RedHat 公司的 Richard Henderson 已经在进行相关工作了,并且发布了 [初代版本][30]
这是 [ply][29],一个完全新颖的 BPF 高级语言:
```
#!/usr/bin/env ply
kprobe:SyS_*
{
$syscalls[func].count()
}
```
这也是一份承诺。
尽管如此,我认为工具开发者的实际难题不是使用什么语言:而是要了解要用这些强大的工具做什么?
### 如何帮助我们
*  **推广**BPF 追踪目前还没有什么市场方面的进展。尽管有公司了解并在使用它FacebookNetflixGithub 和其它公司),但要广为人知尚需时日。分享关于 BPF 产业的文章和资源来帮助我们。
*  **教育**:你可以撰写文章,发表演讲,甚至参与 bcc 文档的编写。分享 BPF 如何解决实际问题以及为公司带来收益的实例。
*  **解决 bcc 的问题**:参考 [bcc issue list][19],这包含了错误和需要的特性。
*  **提交错误**:使用 bcc/BPF提交你发现的错误。
*  **创造工具**:有很多可视化的工具需要开发,请不要太草率,因为大家会先花几个小时学习使用你做的工具,所以请尽量把工具做的直观好用(参考我的 [文档][18])。就像 Mike Muuss 提及到他自己的 [ping][17] 程序:“要是我早知道这是我一生中最出名的成就,我就多开发一两天,添加更多选项。”
*  **高级语言**:如果现有的 bcc 前端语言让你很困扰,或者你能弄门更好的语言。要是你想将这门语言内建到 bcc 里面,你需要使用 libbcc。或者你可以帮助进行 SystemTap BPF 或 ply 的工作。
*  **整合图形界面**:除了 bcc 可以使用的 CLI 命令行工具,怎么让这些信息可视呢?延迟关系,火焰图等等。
### 其它追踪器
那么 SystemTapktapsysdigLTTng 等追踪器怎么样呢?它们有个共同点,要么使用了 BPF要么在自己的领域做得更好。会有单独的文章介绍它们自己。
至于 DTrace ?我们公司目前还在基于 FreeBSD 系统的 CDN 中使用它。
### 更多 bcc/BPF 的信息
我已经写了一篇 [bcc/BPF Tool End-User Tutorial][28],一篇 [bcc Python Developer's Tutorial][27],一篇 [bcc/BPF Reference Guide][26],和已经写好的有用的 [/tools][25],每一个工具都有一个 [example.txt][24] 文件和 [man page][23]。我之前写过的关于 bcc 和 BPF 的文章有:
*   [eBPF: One Small Step][16] (以后就叫做 BPF
* [bcc: Taming Linux 4.3+ Tracing Superpowers][15]
*   [Linux eBPF Stack Trace Hack][14] (现在官方支持追踪堆栈了)
* [Linux eBPF Off-CPU Flame Graph][13] (" " ")
* [Linux Wakeup and Off-Wake Profiling][12] (" " ")
* [Linux Chain Graph Prototype][11] (" " ")
* [Linux eBPF/bcc uprobes][10]
* [Linux BPF Superpowers][9]
* [Ubuntu Xenial bcc/BPF][8]
* [Linux bcc Tracing Security Capabilities][7]
* [Linux MySQL Slow Query Tracing with bcc/BPF][6]
* [Linux bcc ext4 Latency Tracing][5]
* [Linux bcc/BPF Run Queue (Scheduler) Latency][4]
* [Linux bcc/BPF Node.js USDT Tracing][3]
* [Linux bcc tcptop][2]
* [Linux 4.9's Efficient BPF-based Profiler][1]
我在 Facebook 的 Performance@Scale [Linux BPF Superpowers][22] 大会上发表过一次演讲。十二月份,我将在 Boston 发表关于 BPF/bcc 在 [USENIX LISA][21] 方面的演讲和教程。
### 致谢
*   Van Jacobson and Steve McCanne他是最早将 BPF 应用到包过滤的。
*   Barton P. MillerJeffrey K. Hollingsworthand Jon Cargille发明了动态追踪并发表文章《Dynamic Program Instrumentation for Scalable Performance Tools》可扩展高性能计算协议 SHPCC于田纳西州诺克斯维尔市1994 年 5 月发表。
*   kerninst (ParaDyn, UW-Madison), an early dynamic tracing tool that showed the value of dynamic tracing (late 1990's).(早期的能够显示动态追踪数值的动态追踪工具,稍晚于 1990 年)
*   Mathieu Desnoyers (of LTTng),内核的主要开发者,主导 tracepoints 项目。
*   IBM 开发的作为 DProbes 一部分的 kprobesDProbes 在 2000 年时曾与 LTT 一起提供 Linux 动态追踪,但没有整合到一起。
*   Bryan Cantrill, Mike Shapiro, and Adam Leventhal (Sun Microsystems)DTrace 的核心成员DTrace 是一款很棒的动态追踪工具安全而且简单2004 年。考虑到动态追踪的技术DTrace 是科技的重要转折点:它很安全,默认安装在 Solaris 以及其它以可靠性著称的系统里。
*   来自 Sun Microsystems 的各部门的许多员工,促进了 DTrace为我们带来了高级系统追踪的意识。
*   Roland McGrath (at Red Hat)utrace 项目的主要开发者utrace 变成了后来的 uprobes。
*   Alexei Starovoitov (PLUMgrid, then Facebook), 加强版 BPF可编程内核容器的主要开发者。
*   那些帮助反馈,提交代码、测试以及针对增强版 BPF 补丁(搜索 BPF 的 lkml的 Linux 内核工程师: Wang Nan, Daniel Borkmann, David S. Miller, Peter Zijlstra, 以及其它很多人。
*   Brenden Blanco (PLUMgrid)bcc 的主要开发者。
*   Sasha Goldshtein (Sela) 开发了 bcc 中可用的 tracepoint和功能最强大的 bcc 工具 trace 及 argdist帮助 USDT 项目的开发。
*   Vicent Martí 和其它 Github 上的工程师,为 bcc 编写了基于 lua 的前端,帮助 USDT 部分项目的开发。
*   Allan McAleavy, Mark Drayton和其他的改进 bcc 的贡献者。
感觉 Netflix 提供环的境和支持,让我能够编写 BPF 和 bcc tracing 并完成它们。开发追踪工具(使用 TNF/prex, DTrace, SystemTap, ktap, ftrace, perf, and now bcc/BPF和写书、博客以及评论我已经编写了多年的追踪工具。
最后,感谢 [Deirdré][20] 编辑了另外一篇文章。
### 总结
Linux 没有 DTrace语言但它现在有了或者说拥有了 DTraceTookit工具
通过内核构建的 BPF 引擎补丁Linux 4.9 内核有用来支持现代化追踪的最后一项功能。内核支持这一最难的部分已经做完了。今后的任务包括更多的命令行执行工具,可选的高级语言和图形用户界面。
对于性能分析产品的客户这也是一件好事你能查看延迟柱状图和热点图CPU 运行和休眠的火焰图,拥有更好的时延断点和更低耗的工具。我们现在用的追踪和处理程序是没有效率的方式。
那么你什么时候会升级到 Linux 4.9 呢?一旦官方发布,新的性能测试工具就来了:`apt-get install bcc-tools` 。
开始享受它吧!
Brendan
--------------------------------------------------------------------------------
via: http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html
作者:[Brendan Gregg][a]
译者:[GitFuture](https://github.com/GitFuture)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.brendangregg.com/
[1]:http://www.brendangregg.com/blog/2016-10-21/linux-efficient-profiler.html
[2]:http://www.brendangregg.com/blog/2016-10-15/linux-bcc-tcptop.html
[3]:http://www.brendangregg.com/blog/2016-10-12/linux-bcc-nodejs-usdt.html
[4]:http://www.brendangregg.com/blog/2016-10-08/linux-bcc-runqlat.html
[5]:http://www.brendangregg.com/blog/2016-10-06/linux-bcc-ext4dist-ext4slower.html
[6]:http://www.brendangregg.com/blog/2016-10-04/linux-bcc-mysqld-qslower.html
[7]:http://www.brendangregg.com/blog/2016-10-01/linux-bcc-security-capabilities.html
[8]:http://www.brendangregg.com/blog/2016-06-14/ubuntu-xenial-bcc-bpf.html
[9]:http://www.brendangregg.com/blog/2016-03-05/linux-bpf-superpowers.html
[10]:http://www.brendangregg.com/blog/2016-02-08/linux-ebpf-bcc-uprobes.html
[11]:http://www.brendangregg.com/blog/2016-02-05/ebpf-chaingraph-prototype.html
[12]:http://www.brendangregg.com/blog/2016-02-01/linux-wakeup-offwake-profiling.html
[13]:http://www.brendangregg.com/blog/2016-01-20/ebpf-offcpu-flame-graph.html
[14]:http://www.brendangregg.com/blog/2016-01-18/ebpf-stack-trace-hack.html
[15]:http://www.brendangregg.com/blog/2015-09-22/bcc-linux-4.3-tracing.html
[16]:http://www.brendangregg.com/blog/2015-05-15/ebpf-one-small-step.html
[17]:http://ftp.arl.army.mil/~mike/ping.html
[18]:https://github.com/iovisor/bcc/blob/master/CONTRIBUTING-SCRIPTS.md
[19]:https://github.com/iovisor/bcc/issues
[20]:http://www.brendangregg.com/blog/2016-07-23/deirdre.html
[21]:https://www.usenix.org/conference/lisa16
[22]:http://www.brendangregg.com/blog/2016-03-05/linux-bpf-superpowers.html
[23]:https://github.com/iovisor/bcc/tree/master/man/man8
[24]:https://github.com/iovisor/bcc/tree/master/tools
[25]:https://github.com/iovisor/bcc/tree/master/tools
[26]:https://github.com/iovisor/bcc/blob/master/docs/reference_guide.md
[27]:https://github.com/iovisor/bcc/blob/master/docs/tutorial_bcc_python_developer.md
[28]:https://github.com/iovisor/bcc/blob/master/docs/tutorial.md
[29]:https://wkz.github.io/ply/
[30]:https://lkml.org/lkml/2016/6/14/749
[31]:http://www.brendangregg.com/blog/2016-03-30/working-at-netflix-2016.html
[32]:http://www.slideshare.net/brendangregg/from-dtrace-to-linux
[33]:https://lkml.org/lkml/2016/9/1/831
[34]:https://github.com/brendangregg/perf-tools
[35]:https://github.com/iovisor/bcc/blob/master/INSTALL.md
[36]:https://github.com/iovisor/bcc
[37]:https://github.com/opendtrace/toolkit
[38]:https://raw.githubusercontent.com/brendangregg/bcc/master/images/bcc_tracing_tools_2016.png

View File

@ -0,0 +1,111 @@
# 在Linux上使用Glyphr设计自己的字体
LibreOffice 提供了丰富的字体, 并且用户可以自由选择和下载增加自己的字体.即使你想创造自己的字体, 同样也可以非常简单的使用Glyphr创建.Glyphr可以直观的新开源字体设计器, 使用简单的交互界面和覆盖字体设计每一部分的强大功能集.虽然应用还在早起开发阶段, 但是这已经很强大了. 下面将会有一个简短的快速入门教你如何使用Glyphr创建字体并加入LibreOffice.
首先, 从官方Git库下载Glyphr([https://github.com/glyphr-studio/Glyphr-Studio-Desktop][14]). 它提供32位和64位版本.完成下载后, 进入下载文件夹, 解压文件, 进入解压文件, 右键点击Glyphr Studio, 选择"Run".
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_1.png)
][13]
启动应用后会给你三个选项.一个是从头创建一个新的字体集. 第二个是读取已经存在的项目,可以是Glyphr Studio项目文件, 也可以是其他开源或ttf, 甚至是SVG字体.第三个是读取已有示例,然后可以在示例上修改创建.我将会选择第一个选项,并教你一些简单的设计概念.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_2.png)
][12]
完成进入编辑界面后, 你可以从左边的面板中选择字母,然后在右边的区域设计. 我选择A字母开始编辑.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_3.png)
][11]
要在绘图板上设计一些东西,我们可以从板的左上角选择矩形,椭圆形或者路径共享的“形状”工具,也可以使用工具的第二行的第一项的路径编辑工具。使用任意工具,开始在板上放点来创建形状。添加的点数越多, 接下来设计的形状选项就越大。
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_4.png)
][10]
点移动到不同位置可以获得不同的路径, 可以使用路径编辑工具右边的路径编辑,点击会出现可编辑点.然后拖到任意点到你喜欢的位置.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_5.png)
][9]
最后,形状编辑工具帮助选择形状并将其拖动到位置,更改其尺寸以及旋转。
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_6.png)
][8]
在进入了字母设计阶段,其他有用的设计动作集合是左侧面板提供的复制-粘贴, 翻转-旋转操作.来看个例子,假设我现在正在创作B字母, 我要下部分镜像已经创建好的上部分一样,保持良好的水平和一致性.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_7.png)
][7]
现在, 为了达到这个目的, 选择形状编辑工具, 选中欲编辑部分, 点击复制操作, 然后点击图形以外的地方, 在需要的位置粘贴,加上水平翻转或者垂直翻转到达目的.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_8.png)
][6]
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_9.png)
][5]
这款应用在太多地方可以讲述.如果有兴趣深入,可以深入了解数字话编辑,弯曲和引导等等.
然而,字体并不是仅仅是单个字体的设计, 还需要发现字体设计的其他方面.通过应用左上角菜单栏上的"导航"还可以设置字间距, 斜体, 常规字体设置等.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_10.png)
][4]
最棒的是你可以使用"测试驱动"来使用你的新字体, 帮助你判断字体设计如何, 间距对不对, 最大化来优化你的字体.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_11.png)
][3]
完成设计和优化后, 我们还可以导出ttf和svg格式.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_12.png)
][2]
将新的字体加入到系统中, 打开字体浏览器并点击"安装"按钮. 如果它没有任何反应, 可以在主目录下创建一个新的文件夹叫做".fonts",并将字体复制进去.也可以使用root用户打开文件管理器, 进入/usr/share/fonts/opentype, 穿件一个新的文件夹并粘贴新的文件.然后打开终端,输入命令重建字体缓存"sudo fc-cache -f -v"
在LibreOffice中已经可以看见新的字体咯, 同样也可以使用Gedit来测试新字体.
[
![](https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/pic_13.png)
][1]
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/how-to-design-and-add-your-own-font-on-linux-with-glyphr/
作者:[Bill Toulas][a]
译者:[VicYu/Vic020](http://vicyu.net)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://twitter.com/howtoforgecom
[1]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_13.png
[2]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_12.png
[3]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_11.png
[4]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_10.png
[5]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_9.png
[6]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_8.png
[7]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_7.png
[8]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_6.png
[9]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_5.png
[10]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_4.png
[11]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_3.png
[12]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_2.png
[13]:https://www.howtoforge.com/images/how-to-design-and-add-your-own-font-on-linux-with-glyphr/big/pic_1.png
[14]:https://github.com/glyphr-studio/Glyphr-Studio-Desktop

View File

@ -0,0 +1,59 @@
OneNewLife translated
什么时候用 NGINX 来取代 Apache
=====
>两者都是主流的开源网络服务器,但是据 NGINX 的首席执行官 Gus Robertson 所言,他们有不同的使用场景。还有微软呢?他们家的服务器的活跃网站份额在 20 年间首次跌破 10%。
![web 服务器热度2016 年 10 月](http://zdnet1.cbsistatic.com/hub/i/r/2016/11/07/f38d190e-046c-49e6-b451-096ee0776a04/resize/770xauto/b009f53417e9a4af207eff6271b90c43/web-server-popularity-october-2016.png)
Apache 是最受欢迎的网络服务器,不过 NGINX 正迎头直上,而微软的 IIS 几十年来首次跌破 10%。
[NGINX][4] 已经成为第二大网络服务器。它在很久以前就已经超越了[微软因特网信息服务IIS][5],并且一直在老大 [Apache][6] 的身后穷追不舍。但是NGINX 的首席执行官在接受采访时表示Apache 和 NGINX 的用户群体不一样。
“我认为 Apache 是一个伟大的网络服务器。NGINX 和它的使用场景不同”Robertson 说。“我们没有把 Apache 当成竞争对手。我们的用户使用 NGINX 来取代硬件负载均衡器和构建微服务,这两个都不是 Apache 的长处。”
事实上Robertson 发现许多用户同时使用了两种开源的网络服务。“用户会在 Apache 的上层使用 NGINX 来实现负载均衡。我们的架构是完全不同的,我们可以做更好的并发网络服务。”他还表示 NGINX 在云配置方面的表现更优秀。
他总结说,“我们是唯一一个仍然在持续增长的网络服务器,其它的网络服务器都在慢慢成为明日黄花。”
这些增长,加上微软损失的 120 万个活跃站点,导致微软的活跃网站份额下降到 9.27%,这是他们第一次跌破 10%。Apache 的市场份额提高了 0.19%,并继续领跑市场,现在坐拥 46.3% 的活跃站点。尽管如此,多年来 Apache 一直在缓慢下降,而 NGINX 现在上升到了 19%。这不太准确。根据[Netcraft 十月份的网络服务器调查][7]Apache 当月的活跃网站增加得最多,获得了 180 万个新站点,而 NGINX 增加了 40 万个新站点,增长率排第二。
NGINX 的开发者正在努力创造他们的开放商业网络服务器 —— [NGINX Plus][8]通过不断的改进使其变得更有竞争力。NGINX Plus 最新的 [第 11 个发行版R11][9]发行了,这个版本更易于扩展和自定义,并支持更广泛的部署。
这次最大的补充是 [动态模块][10] 的二进制兼容性。这意味着通过 [开源 NGINX 软件][11] 编译的动态模块可以加载到 NGINX Plus。
这意味着你可以利用大量的 [第三方 NGINX 模块][12] 来扩展 NGINX Plus 的功能,仿照一系列开源和商业化的生产模块。开发者可以基于支持 NGINX Plus 的内核创建自定义扩展、附加组件和新产品。
NGINX Plus R11 还增强了其它功能:
* [提升 TCP/UDP 负载均衡][1] —— 新功能包括 SSL 服务器路由、新的日志功能、附加变量以及改进的代理协议支持。这些新功能增强了调试功能,使你能够支持更广泛的企业应用。
* [更好的 IP 定位][2] —— 第三方的 GeoIP2 模块现在已经通过认证,并提供给 NGINX Plus 用户。这个新版本提供比原来的 GeoIP 模块更精准和丰富的位置信息。
* [增强的 nginScript 模块][3] —— nginScript 是基于 JavaScript 的 NGINX Plus 的下一代配置语言。新功能可以让你在流TCP/UDP模块中即时修改请求和响应数据。
The end result? NGINX is poised to continue to make the race for the top web server a two-horse race. Microsoft IIS? It continues to slowly fade away.
最终结果NGINX 准备继续与 Apache 竞争顶级网络服务器的宝座。至于微软的 IIS它将逐渐消亡。
--------------------------------------------------------------------------------
via: http://www.zdnet.com/article/when-to-use-nginx-instead-of-apache/
作者:[ Steven J. Vaughan-Nichols][a]
译者:[OneNewLife](https://github.com/OneNewLife)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/
[1]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-tcp-udp-lb
[2]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-geoip2
[3]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-nginScript
[4]:https://www.nginx.com/
[5]:https://www.iis.net/
[6]:https://httpd.apache.org/
[7]:https://news.netcraft.com/archives/2016/10/21/october-2016-web-server-survey.html
[8]:https://www.nginx.com/products/
[9]:https://www.nginx.com/blog/nginx-plus-r11-released/
[10]:https://www.nginx.com/blog/nginx-plus-r11-released/?utm_source=nginx-plus-r11-released&utm_medium=blog#r11-dynamic-modules
[11]:https://www.nginx.com/products/download-oss/
[12]:https://www.nginx.com/resources/wiki/modules/index.html?utm_source=nginx-plus-r11-released&utm_medium=blog

View File

@ -1,118 +0,0 @@
# 如何在 Linux 中恢复一个删除了的文件
你曾经是否遇到这样的事?你意识到你已经通过删除键或者在命令行中使用 rm 命令错误的删除了一个不该删除的文件。
在第一种情况下,你可以到垃圾箱,[搜索文件][6]然后把它重新存储到它原始的位置。但是第二种情况又该怎么办呢我想你可能也知道Linux 命令行不会把被删除的文件放到任何位置,而是直接把它们清除了,于是它们不再存在了。
在这篇文章里,我将分享一个可能很有帮助的技巧来阻止这件事发生在你身上。同时,我也会分享一个你可能会考虑使用的工具,当你由于过分粗心而删除了某些不该删除的文件时。
### 为 rm -i 创建一个别名
-i' 选项和 rm 命令(也包括其他[文件处理命令比如 cp 或者 mv][5])同时使用时,在删除文件前会出现一个提示。
这同样也可以运用到[复制,移动或重命名一个文件][4],当所在位置已经存在一个和目标文件同名的文件时。
这个提示给你第二次机会来考虑你是否真的想删除该文件 - 如果你在这个提示上选择确定,那么文件就被删除了。在那种情况下,很抱歉,这个技巧没能保护你远离粗心。
为了让 rm 成为 rm -i 别名,这样做:
```
alias rm='rm -i'
```
别名命令将确定 rm 现在已经成为了别名:
[
![增加 rm 别名的命令](http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-rm-Command.png)
][3]
增加 rm 别名的命令
然而,这样做只在当前用户对话的当前 shell 上有效。为了永久改变,你必须像下面展示的这样把它保存到 '~/.bashrc' 一些版本的 Linux 系统可能是 '~/.profile')。
[
![在 Linux 中永久增添别名](http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-Permanently-in-Linux.png)
][2]
在 Linux 中永久增添别名
为了让 '~/.bashrc'(或 '~/.profile')中所做的改变立即生效,从当前 shell 中搜索文件:
```
. ~/.bashr
```
[
![在 Linux 中激活别名](http://www.tecmint.com/wp-content/uploads/2016/11/Active-Alias-in-Linux.png)
][1]
在 Linux 中激活别名
### 取证工具  Foremost
但愿你对于你的文件足够小心,只有需要恢复一个来自外部磁盘或 USB 设备的丢失文件时才使用这个工具。
然而,当你意识到你意外的删除了系统中的一个文件并将要感到恐慌时-不用担心。让我们来看一看 Foremost 一个被设计用来处理这种状况的取证工具。
为了在 CentOS/RHEL 7 中安装 Foremost 你需要首先启用 Repoforge
```
# rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
# yum install foremost
```
然而在 Debian 及其派生系统中,只需这样做:
```
# aptitude install foremost
```
安装完成以后,让我们以一个简单的测试开始。我们首先删除 /boot/images 目录下一个名为 'nosdos.jpg' 的图像文件:
```
# cd images
# rm nosdos.jpg
```
为了恢复这个文件,像下面这样使用 Foremost你需要首先确认潜在分区 - 在这种情况下, '/boot' 位于 '/dev/sda1' 分区中)
```
# foremost -t jpg -i /dev/sda1 -o /home/gacanepa/rescued
```
/home/gacanepa/rescued 是单独磁盘中的一个目录 请记住,把文件恢复到被删除文件所在驱动中不是一个明智的做法。
如果在恢复过程中,占用了被删除文件过去所在的磁盘分区,那么可能没法恢复文件。另外,在进行文件恢复操作前停止所有进程也是至关重要的。
当 Foremost 执行文件恢复操作完成以后,恢复文件(如果可以恢复)将能够在目录 /home/gacanepa/rescue/jpg 中找到。
##### 总结
这篇在文章中,我们阐述了如何避免意外删除一个不该删除的文件以及如何恢复文件如果这样一件不期望的事情发生。然而,警告一下, Foremost 需要花费一段时间运行,时间长短取决于分区的大小。
一如既往,如果你有什么问题或想法,不要犹豫,让我们知道。请自由使用下面的形式给我们留下一个注记。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/recover-deleted-file-in-linux/
作者:[ Gabriel Cánepa][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/gacanepa/
[1]:http://www.tecmint.com/wp-content/uploads/2016/11/Active-Alias-in-Linux.png
[2]:http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-Permanently-in-Linux.png
[3]:http://www.tecmint.com/wp-content/uploads/2016/11/Add-Alias-rm-Command.png
[4]:http://www.tecmint.com/rename-multiple-files-in-linux/
[5]:http://www.tecmint.com/progress-monitor-check-progress-of-linux-commands/
[6]:http://www.tecmint.com/linux-find-command-to-search-multiple-filenames-extensions/

View File

@ -1,78 +0,0 @@
通过安装扩展让 KDE Plasma 5 桌面看起来感觉就像 Windows 10 桌面
============================================================
![kde-plasma-to-windows-10](https://iwf1.com/wordpress/wp-content/uploads/2016/11/KDE-Plasma-to-Windows-10.jpg)
通过一些步骤,我将告诉你如何把 KDE Plasma 5 桌面变成 Windows 10 桌面
除了菜单, KDE Plasma 桌面的许多地方已经和 Win 10 桌面非常像了。因此,为了使二者看起来几乎是一样的,只需要一些点亮工具
### 开始菜单
让 KDE Plasma 桌面看起来像 Win 10 桌面的第一环节以及可能最形象的环节是实现 Win 10 的 ‘开始’ 菜单.
.
通过安装[Zren's Tiled Menu][1],这很容易实现。
#### 安装
1. 在 KDE Plasma 桌面上单击右键 -> 打开窗口部件
2. 在 KDE Plasma 桌面上右键单击 -> 增添窗口部件
3. 获取新窗口部件 -> 下载新的 Plasma 窗口部件
4. 搜索 "Tiled Mune" -> 安装
#### 激活
1. 在你现在的菜单键上右键单击 -> 选择
2. 选择 "TIled Mune" ->点击 开启Switch
[
![KDE Tiled Menu extension.](http://iwf1.com/wordpress/wp-content/uploads/2016/11/KDE-Tiled-Menu-extension-730x619.jpg)
][2]
KDE Tiled 菜单扩展
### 主题
弄好菜单以后,下一个你可能需要的就是主题。幸运的是, [K10ne][3] 提供了你一个 WIn 10 主题体验。
#### 安装:
1. 从 Plasma 桌面菜单打开“系统设置” -> 工作空间主题
2. 从侧边栏选择”桌面主题 -> 获取新主题
3. 搜索 "K10ne" -> 安装
#### 激活
1. 从 Plasma 桌面菜单选择“系统设置” -> 工作空间主题
2. 从侧边栏选择“桌面主题” -> "K10ne"
3. 应用
### 任务栏
最后,为了有一个更加完整的体验,你可能也想拥有一个更加 Win 10 风格的任务栏,
这次,你需要的安装包,叫做 "Icons-only Task Manager" 在大多数 Linux 发行版中,通常会默认安装。如果没有安装,需要通过你的系统的合适通道来获取它。
#### 激活
1. 在 Plasma 桌面上右键单击 -> 打开窗口部件
2. 在 Plasma 桌面上右键单击 -> 增添部件
3. 把 "Icons-only Task Manager" 拖放到你的桌面面板的合适位置。
--------------------------------------------------------------------------------
via: https://iwf1.com/make-kde-plasma-5-desktop-look-feel-like-windows-10-using-these-extensions/
作者:[Liron][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://iwf1.com/tag/linux
[1]:https://github.com/Zren/plasma-applets/tree/master/tiledmenu
[2]:http://iwf1.com/wordpress/wp-content/uploads/2016/11/KDE-Tiled-Menu-extension.jpg
[3]:https://store.kde.org/p/1153465/

View File

@ -1,88 +0,0 @@
Ubuntu 14.04/16.04 与Windows 10周年版ubuntu Bash性能对比
===========================
今年初当Microsoft和Canonical发布[Windows 10 Bash 和Ubuntu用户空间][1],我尝试做了一些初步性能测试 [Ubuntu on Windows 10 对比 原生Ubuntu][2]这次我发布更多的关于原生纯净Ubuntu和Base on Windows 10的基准对比。
![](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_1_med)
Windows的Linux子系统测试在上周刚刚完成所有测试并放出升级。 默认的Ubuntu用户空间还是Ubuntu 14.04,但是已经可以升级到16.04。所以测试首先在14.04测试完成后将系统升级升级到16.04版本并重复所有测试。完成所有基于Windows的测试后我删除了Ubuntu14.04.5和Ubuntu 16.04 LTS来对比查看性能
![](http://www.phoronix.net/image.php?id=windows10-anv-wsl&image=windows_wsl_2_med)
配置为Intel i5 6600K Skylake框架 16G内存和256东芝ssd 所有测试都采用原生默认配置。
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=09989b3&p=2)
>点击放大查看
这次Ubuntu/Bash on Windows和原生Ubuntu对比测试采用开源软件Phoronix测试套件完全自动化并可重复测试。
![](https//openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=186c4d0&c=a8c914bf9b64cf67abc65e319f8e71c7951fb1aa&p=0)
首先是SQLite嵌入式数据库基准测试.这个盒子外的Ubuntu/Bash on Windows性能是相当的慢,但是如果切换环境从14.04到16.04LTS, 性能会块很多.然而, 对于重磁盘的工作负载,原生Ubuntu Linux比Windows的子系统Linux快了近2倍.
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=fa40825&c=0912dc3f6d6a9f36da09fdd4c0cf4e330fa40f90&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=8419652&c=9b9f6b0822ed5b9dc2977a7f2faf499fce4fba23&p=0)
编译测试作为额外的重磁盘测试显示, 定制的Windows子系统真的成倍的限制了Ubuntu性能.
接下来,是一些使用Stream的基本的系统内存速度测试
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=9560e6f&c=ebbc6937fa8daf0540e0df353432a29f938cf7ed&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=63fa8d6&c=88cd58f9eca6d3a09699d60d9f877529113fb1bc&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=5a2e9d2&c=d37eee4c9394fa8104e7e49e26c964af70ec326b&p=0)
奇怪的是, 这些内存的基准测试显示Ubuntu on Windows的性能比原生的Ubuntu好!这个现象同时发生在基于同样的Windows却环境不同的14.04和16.04上.
接下来, 是一些重CPU测试.
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=ee1f01f&c=3e9a67230e0e081b99ee3237e702c0b40ee73d60&p=0)
通过Dolfyn科学测试Ubuntu On Windows和原生Ubuntu之间的性能其实是相当接近的。 对于Ubuntu 16.04由于较新的GCC编译器回退性能两个平台上的性能都较慢。
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=dd69257&c=0e31babb8b96be1ae38ea739fbb1346bf9bc4b07&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=a02416b&c=c8abb70dee982dd494fb1891bd9dc154fa7a7f47&p=0)
透过Fhourstones和John The Ripper表明通过在Windows上运行Linux子系统的Ubuntu的性能可以非常接近裸机Ubuntu Linux性能
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=3140e3c&c=f4bf6330a7d58b5939c61cbd91fe5db379c1592a&p=0)
类似于Stream, x264结果是另一个奇怪的情况其中最好的性能实际上是使用WSL Ubuntu On Windows
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=ad12f0b&c=f50c829c97d731f6926c5a874cf83f8fc5440067&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=8b7a7ca&c=3de3e8537d08665e8a41380b6b2298c09f408fa0&p=0)
定时编译基准测试非常利于裸机Ubuntu Linux. 这是由于大型程序编译需要大量读写磁盘, 先前测试已经发现了, 基于Windows的子系统缓慢的大灾区.
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=25892d8&c=f6cd3fa4a3497e3d2663106e0bf3fcd227f9b9a3&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=2ea1062&c=fbbec58a6aa1f3fb8dbc55e3de612afc99c666f7&p=0)
![](https://openbenchmarking.org/embed.php?i=1608096-LO-BASHWINDO87&sha=4899bb2&c=80df0e1e749910ebd84b0d6c2688316e5cfb8cda&p=0)
许多其他的通用开源基准测试表明, 严格的重CPU测试, Windows子系统的Ubuntu的性能是很接近的, 甚至是相等与原生安装在实际硬盘中的Ubuntu Linux.
最新的Window的Linux子系统,测试结果实际上相当令人印象深刻。让人沮丧仅仅只是持续缓慢的磁盘/文件系统性能但是对于受CPU限制的工作负载结果是非常引人注目的。还有很罕见的x264和Stream测试Ubuntu On Windows上的性能似乎明显优于运行在硬件上的Ubuntu Linux。
总的来说, 测试实验是十分愉快的并且在Ubuntu/Bash on Windows也没有遇到任何其他的bug.如果你有还兴趣了解更多关于Windows和Linux的基准测试, 欢迎留言讨论.
--------------------------------------------------------------------------------
via: https://www.phoronix.com/scan.php?page=article&item=windows10-anv-wsl&num=1
作者:[Michael Larabel][a]
译者:[VicYu/Vic020](http://vicyu.net)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: http://www.michaellarabel.com/
[1]: http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-User-Space-On-Win10
[2]: http://www.phoronix.com/scan.php?page=article&item=windows-10-lxcore&num=1