Merge remote-tracking branch 'upstream/master'

This commit is contained in:
lixiang23 2017-02-04 13:38:42 +08:00
commit ef7de3bf87
180 changed files with 15001 additions and 4865 deletions

View File

@ -0,0 +1,85 @@
Mir 并不只是 Unity 8
============================================================
![mir](https://insights.ubuntu.com/wp-content/uploads/2cf2/MIR.png)
_这是一篇来自 Canonical 的软件工程师 Alan Griffiths 的一篇游客文章。如果你也想投稿,请联系 ubuntu-devices@canonical.com_
Mir 是一个计算机显示的管理应用的支持项目。它可以与当前 Ubuntu 桌面(及很多其他桌面)上使用的、我们更熟悉的 X-Window 相比较。我下面会讨论 Mir 的一些动机,但本篇的目的是澄清 Mir 和 Unity 8 之间的关系。
大多数时候你听说 Mir 时都会提到 Unity 8。这并不奇怪因为 Unity 8 是 Canonical 新的用户界面 shell用户会一直与它交互。 Mir “只”使这成为可能。Unity 8 目前用于手机和平板电脑,也可以在 Ubuntu 16.10 桌面上“预览”它。
在这里我想解释一下,可以不用 Unity 8 也可以使用 Mir。要么作为替代 shell要么作为嵌入式环境的更简单的界面信息亭电子标牌等。Mir “抽象层”证明了这一点,它提供了三个重要的元素:
1. libmiral.so - Mir 的稳定接口,提供基本的窗口管理;
2. miral-shell - 一个提供“传统”和“平铺”窗口管理的示例 shell
3. miral-kiosk - 一个仅提供基本窗口管理的示例“信息亭”。
miral-shell 和 miral-kiosk 示例服务器可从 zesty 的归档文件中获得Kevin Gunn 已经在“Voices”上写了一篇基于 miral-kiosk 的“信息亭”的概览的[博文][1]。我将在下面给出更多关于使用这些例子的细节,但在[我的“voices”博客][2]上有更多(包括“如何”开发自己的替代 Mir 服务器)。
### 使用 MIR
Mir 是一套编程库,而不是独立的程序。这意味着这需要程序去调用它实现相应的功能。有两种方式去使用 Mir 库:编写程序的时候作为“客户端”,或者在实现 shell 时作为“服务端”。客户端(和 X11 一起)典型是使用工具库,而不是直接使用 Mir或者 X11
GTK、Qt 和 SDL2 中有对 Mir 的支持。当在那些工具库中启用对它的支持时(默认在 Ubuntu 中启用支持),意味着使用这些工具的程序应该“可以工作”于 Mir 中。除此之外还有一个 Xmir一个运行于 Mir 的 X11 服务器,这允许基于 X 的服务运行在 Mir 服务端上。
但是开始之前 Mir 客户端需要一个相匹配的 Mir 服务端。在最后一个开发周期中Mir 团队在演示中将 MirAL 作为编写 Mir 服务端的推荐方法并推出了一个“miral-examples”包。在 Ubuntu 的开发版本 zesty 中,你可以从归档中安装它:
```
$ sudo apt install miral-examples mir-graphics-drivers-desktop qtubuntu-desktop
```
_对于其他平台你需要自己构建 MirAL有关详细信息请参阅 Mir 桌面环境示例。_
miral-examples 安装后你可以在 Unity 7 中以窗口的方式运行一个 Mir 服务端,然后在里面运行一个客户端(比如 gedit
```
$ miral-shell&
$ miral-run gedit
```
这会给你一个(非常基础的)“传统” 的桌面窗口管理。另外你可以试下“平铺”窗口管理器:
```
$ miral-shell --window-manager tiling&
$ miral-run qterminal
```
或者(甚至更基础的)信息亭界面:
```
$ miral-kiosk&
$ miral-run 7kaa
```
这些 Mir 服务端都不会提供带有“启动器”、通知等的完整“桌面”。但是它们演示了不使用 Unity 8 使用 Mir 的可能。
### MIR 解决的问题
X-Window 系统已经是,并且仍然是,提供了一种与计算机的交互的非常成功的方式。它提供了广泛的硬件和驱动程序一致的抽象。它支持许多桌面环境和图形用户界面工具包,并可以让它们在大量计算机上一起工作。
但它来自一个与当前电脑使用方式非常不同的时代,现在有一些问题是很难满足的,因为它需要支持老旧的系统。
在 1980 年,大多数计算机是由专家管理的大型事物,将它们连接在一起“是非常困难的”。在那个时代,开发软件的成本是这样的,一个程序“监听”另一个程序获得的好处是可以忽略不计的:此时几乎没有计算机,同时它们是独立的,它们所有的工作和金融无关。
X-Window 开发于这种环境下,通过一系列扩展,它已经适应了许多变化。但它本质上是不安全的:任何应用程序可以知道显示了什么(并影响它)。你可以编写像 Xeyes用“眼睛”跟踪光标或“Tickeys”通过键盘来生成打字机噪声等应用程序。现实是任何应用程序可以跟踪和操纵几乎所有的事情。这就是基于 X 的桌面如 Unity 7、Gnome、KDE及其它桌面工作的方式。
X-Window 中的窗口管理的开放性质不适合用于具有数百万计算机连接到因特网的世界,它们用于信用卡交易和网上银行,且由非专家管理,并自愿安装来自陌生人的程序。人们越来越意识到让 X-Window 适应新的安全性和图形性能的要求是不可行的。
现在至少有两个开源项目旨在提供一个替代品Mir 和 Wayland。虽然有些人认为两者是竞争关系但在很多领域它们有共同的利益它们都需要与那些之前假定使用 X11 的其它软件交互,并且许多引入支持的工作对两者都有益。
Canonical 的 X-Window 替换品 Mir它只将信息暴露给它需要的应用程序因此没有按键监听或光标跟踪。它可以满足当前时代的需求并可以利用现代硬件如图形处理器。
--------------------------------------------------------------------------------
via: https://insights.ubuntu.com/2016/11/28/mir-is-not-only-about-unity8/
作者:[Guest][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://insights.ubuntu.com/author/guest/
[1]:http://voices.canonical.com/kevin.gunn/
[2]:http://voices.canonical.com/alan.griffiths/

View File

@ -0,0 +1,126 @@
Vim 初学者入门指南
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/03/vim-beginner-guide-featured.jpg "Vim 初学者入门指南")
这篇文章是 [VIM 用户指南][12] 系列文章中的一篇:
* Vim 初学者入门指南
* [Vim 快捷键速查表][3]
* [5 个针对有经验用户的 Vim 技巧][4]
* [3 个针对高级用户的 Vim 编辑器有用技巧][5]
对一个程序员来说,选择一个文本编辑器是一件非常重要的事。因为不同编辑器之间有着不少的差异:图形界面或者非图形界面、不同的快捷键、不同的编程语言支持、不同的插件以及自定义设置等等。我建议不是去搜索最棒的编辑器,而是去选择最适合你的习惯且最适应你的任务的那一个。假如你打算在一个团体中工作,那么最好和你的共事者选择一样的编辑器。这样的话,一旦你在使用中遇到问题,你就可以去向他们寻求帮助。
这正是我在几年之前开始使用 Vim 的原因。通常来说Vim 会被置于传说中的 Emacs 的对立面。我承认我对 Emacs 知之甚少,但是对于它俩,你需要知道的是它们都可以被深度定制,并且在初学时也都非常令人困惑。这个教程并不会介绍有关 Vim 的所有内容,而是将介绍一些基础以使你在最初就能正确使用它,随后还会展示一些小技巧,借此(希望能)让你有能力自己去探索学习。
Vim 一词来源于 “VI iMproved”。Vi 是一个被广泛安装于 Unix 系统的非图形界面文本编辑器,并且它也被默认安装在了 Linux 系统中。Vim 是这个原始编辑器的增强版,但是不同于 Vi并不是每个发行版都默认安装了它。
### 安装
在 Ubuntu 中可以使用如下命令来安装 Vim
```
sudo apt-get install vim
```
如果你已经对某些插件有了兴趣,使用以下命令:
```
sudo apt-cache search vim
```
这命令将给你输出一个很长的和 Vim 有关的包列表。在这之中,有针对不同编程语言的工具,有插件管理器,等等。
在这系列教程中,我将会在 Ubuntu 上使用最新版的 Vim7.3.154LCTT 译注:现在最新版为 8.0)。当然你也可以使用其它任何版本。
### 热身
在终端输入 `vim` 命令,你将会看到一个非常棒的欢迎界面。
![vim-welcome](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-welcome.jpg "vim-welcome")
LCTT 译注看到了欢迎界面中那行“Help poor children in Uganda!” 了吗?)
如果你之前从未使用过 Vi 或者 Vim那么你很可能甚至不知道该怎么退出它... 是的,这是事实。**任何你常用的快捷键在 Vim 中都将失去原有的效果**。LCTT 译注:网上有个流传的笑话——“如何制造乱码”,“让新手退出 vi”
首先要使用任何命令式的功能像保存save或者退出exit你都先得输入一个冒号`:`)。保存是 `:w` 而退出是 `:q`。如果你想不保存文件就退出,那么就要使用强制退出命令 `:q!`。Vim 中非常棒的一点是你不需要分开输入各个命令,换言之,如果你想保存然后退出,你就可以直接使用 `:wq`
现在,我们退出 Vim 再打开一个文本文件。为此,你只需把想要编辑的文件名加在命令后面即可:
```
vim [文本文件名]
```
![vim-file](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-file.jpg "vim-file")
一般而言,当你打开一个文本文件,你将会处在查看模式。这使得 Vim 与众不同并且最初会让人感到困惑。Vim 主要由两种模式构成:查看模式和编辑模式。查看模式用于查看内容并且使用一些命令。想要进入编辑模式,只需按 `i` 键进行插入insert或者 `a` 键进行添加add。想要返回到查看模式或者进行命令式功能的操作`Escape` 键即可。插入insert和添加add的差异仅仅在于你是想在光标位置之前还是在光标之后进入编辑模式并进行文字输入。要想彻底地明白你应该亲自去尝试一下。我的建议是仅在行尾使用添加add而在其它时候使用插入insert
LCTT 译注:此段落中“查看模式”原文是 “visual mode”疑为“view mode”在此模式下可以查看文本但是不能进行编辑而“visual mode” 是编辑模式的一种,可以按 `v` 键进入,然后就可以用方向键从当前光标位置开始进行选择,并以反白的视觉效果显示,通常选择后可以按 `y` 进行复制、按 `d` 进行剪切等操作。)
要想在文本之中移动光标,你通常可以使用键盘上的方向键,它们无论是在查看模式还是在编辑模式都可以生效。不过,一个真正的纯粹主义者将会告诉你使用按键 `h` 向左,`j` 向下,`k` 向上,`l` 向右来(在查看模式)进行移动。
现在你已经明白了如何和简单地控制 Vim我们再来更加深入一些。
### 一些简单命令
现在你已经熟悉了在正常模式和插入模式之间进行切换,下面是一些可以在正常模式中使用的命令:
* `x`:删除一个字符
* `u`:撤销一个操作(相当与 `Ctrl+z`
* `dd`:删除一行内容
* `dw`:删除一个单词
* `yy`:复制一行内容
* `yw`:复制一个单词
* `p`:粘贴一个之前删除或复制的行或者单词
* `e`跳到下个单词LCTT 译注:词尾)(比单纯用方向键更快)
* `r`:替换一个字母(按 `r`,松开,然后再按新字母)
当然不止这些,不过这些对现在来说已经足够了。如果你掌握了上面的全部,你将能你很顺溜地使用 Vim 了。
对于那些还想知道更多的人,我再多提一下。你可以在任何这些命令之前加上一个数值,那么这个命令将被重复执行相应的次数。例如,`5x` 将在当前行连续删除 5 个字母,而 `3p` 将会粘贴 3 次。
### 高级命令
最后,作为对你自己继续探索的鼓励和示例,这里给出几个高级且常用的命令:
* `/所搜索的内容`:在文中搜索特定内容
* `:sp 文本文件名`:将屏幕水平分割成上下两半,新文件展示在另一半。想要在两侧切换焦点,可以使用 `Ctrl+w` 快捷键。
![vim-sp](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-sp.jpg "vim-sp")
* `:vsp 文本文件名`:同上,但是是垂直分割屏幕
* `Ctrl+Shift+C``Ctrl+Shift+V`:在终端中复制和粘贴文本
* `:! 命令名`:在 Vim 中运行 Vim 外的终端命令,直接发送给 shell。例如`:! ls` 将在不退出编辑器的同时,显示你当前目录内的文件。
![vim-ls](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-ls.jpg "vim-ls")
### 结论
我觉得你现在应该已经有了足够的准备来开始使用 Vim。你还可以通过安装各种插件编辑 `~.vimrc` 文件,或者在 shell 中输入 `vimtutor` 命令来使用交互式教程以学到更多。
如果你有任何你想分享的关于 Vim 的其它命令,请在评论中告知我们。
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/start-with-vim-linux/
作者:[Himanshu Arora][a]
译者:[Yinr](https://github.com/Yinr)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/adrienbrochard/
[2]:https://www.maketecheasier.com/start-with-vim-linux/#comments
[3]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[4]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[5]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fstart-with-vim-linux%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fstart-with-vim-linux%2F&text=The+Beginner%26%238217%3Bs+Guide+to+Start+Using+Vim
[9]:mailto:?subject=The%20Beginner%E2%80%99s%20Guide%20to%20Start%20Using%20Vim&body=https%3A%2F%2Fwww.maketecheasier.com%2Fstart-with-vim-linux%2F
[10]:https://www.maketecheasier.com/turn-dropbox-into-a-blogging-tool-with-scriptogram/
[11]:https://www.maketecheasier.com/4-sms-back-up-applications-to-keep-your-messages-safe-android/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343

View File

@ -0,0 +1,211 @@
Vim 快捷键速查表
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2013/12/vim-shortcut-cheatsheet-featured.jpg "Vim Keyboard Shortcuts Cheatsheets")
本文是 [Vim 用户指南][12] 系列的其中一篇:
* [Vim 初学者入门指南][3]
* Vim 快捷键速查表
* [5 个针对有经验用户的 Vim 技巧][4]
* [3 个针对高级用户的 Vim 编辑器实用技巧][5]
Vim 编辑器是一个基于命令行的工具,是传奇编辑器 vi 的增强版。尽管图形界面的富文本编辑有很多,但是熟悉 Vim 对于每一位 Linux 的使用者都能有所帮助——无论你是经验丰富的系统管理员,还是刚上手树莓派的新手用户。
这个轻量级的编辑器是个非常强大的工具。在有经验的使用者手中,它能完成不可思议的任务。除了常规的文本编辑功能以外,它还支持一些进阶特性。例如,基于正则表达式的搜索和替换、编码转换,以及语法高亮、代码折叠等的编程特性。
使用 Vim 时有一个非常重要的一点需要注意,那就是按键的功能取决于编辑器当前的“模式”。例如,在“普通模式”输入字母`j`时,光标会向下移动一行。而当你在“插入模式”下输入字符,则只是正常的文字录入。
下面就是速查表,以便于你充分利用 Vim。
### 基本操作
| 快捷键 | 功能 |
| --- | --- |
| `Esc` | 从当前模式转换到“普通模式”。所有的键对应到命令。 |
| `i` | “插入模式”用于插入文字。回归按键的本职工作。 |
| `:` | “命令行模式” Vim 希望你输入类似于保存该文档命令的地方。 |
### 方向键
| 快捷键 | 功能 |
| --- | --- |
| `h` | 光标向左移动一个字符 |
| `j``Ctrl + J` | 光标向下移动一行 |
| `k``Ctrl + P` | 光标向上移动一行 |
| `l` | 光标向右移动一个字符 |
| `0` | (数字 0移动光标至本行开头 |
| `$` | 移动光标至本行末尾 |
| `^` | 移动光标至本行第一个非空字符处 |
| `w` | 向前移动一个词 (上一个字母和数字组成的词之后) |
| `W` | 向前移动一个词 (以空格分隔的词) |
| `5w` | 向前移动五个词 |
| `b` | 向后移动一个词 (下一个字母和数字组成的词之前) |
| `B` | 向后移动一个词 (以空格分隔的词) |
| `5b` | 向后移动五个词 |
| `G` | 移动至文件末尾 |
| `gg` | 移动至文件开头 |
### 浏览文档
| 快捷键 | 功能 |
| --- | --- |
| `(` | 跳转到上一句 |
| `)` | 跳转到下一句 |
| `{` | 跳转到上一段 |
| `}` | 跳转到下一段 |
| `[[` | 跳转到上一部分 |
| `]]` | 跳转到下一部分 |
| `[]` | 跳转到上一部分的末尾 |
| `][` | 跳转到上一部分的开头 |
### 插入文本
| 快捷键 | 功能 |
| --- | --- |
| `a` | 在光标后插入文本 |
| `A` | 在行末插入文本 |
| `i` | 在光标前插入文本 |
| `o` | (小写字母 o在光标下方新开一行 |
| `O` | (大写字母 O在光标上方新开一行 |
### 特殊插入
| 快捷键 | 功能 |
| --- | --- |
| `:r [filename]` | 在光标下方插入文件 [filename] 的内容 |
| `:r ![command]` | 执行命令 [command] ,并将输出插入至光标下方 |
### 删除文本
| 快捷键 | 功能 |
| --- | --- |
| `x` | 删除光标处字符 |
| `dw` | 删除一个词 |
| `d0` | 删至行首 |
| `d$` | 删至行末 |
| `d)` | 删至句末 |
| `dgg` | 删至文件开头 |
| `dG` | 删至文件末尾 |
| `dd` | 删除该行 |
| `3dd` | 删除三行 |
### 简单替换文本
| 快捷键 | 功能 |
| --- | --- |
| `r{text}` | 将光标处的字符替换成 {text} |
| `R` | 进入覆写模式,输入的字符将替换原有的字符 |
### 复制/粘贴文本
| 快捷键 | 功能 |
| --- | --- |
| `yy` | 复制当前行至存储缓冲区 |
| `["x]yy` | 复制当前行至寄存器 x |
| `p` | 在当前行之后粘贴存储缓冲区中的内容 |
| `P` | 在当前行之前粘贴存储缓冲区中的内容 |
| `["x]p` | 在当前行之后粘贴寄存器 x 中的内容 |
| `["x]P` | 在当前行之前粘贴寄存器 x 中的内容 |
### 撤销/重做操作
| 快捷键 | 功能 |
| --- | --- |
| `u` | 撤销最后的操作 |
| `Ctrl+r` | 重做最后撤销的操作 |
### 搜索和替换
| 快捷键 | 功能 |
| --- | --- |
| `/search_text` | 检索文档,在文档后面的部分搜索 search_text |
| `?search_text` | 检索文档,在文档前面的部分搜索 search_text |
| `n` | 移动到后一个检索结果 |
| `N` | 移动到前一个检索结果 |
| `:%s/original/replacement` | 检索第一个 “original” 字符串并将其替换成 “replacement” |
| `:%s/original/replacement/g` | 检索并将所有的 “original” 替换为 “replacement” |
| `:%s/original/replacement/gc` | 检索出所有的 “original” 字符串,但在替换成 “replacement” 前,先询问是否替换 |
### 书签
| 快捷键 | 功能 |
| --- | --- |
| `m {a-zA-Z}` | 在当前光标位置设置书签,书签名可用一个大小写字母({a-zA-Z} |
| `:marks` | 列出所有书签 |
| `{a-zA-Z}` | 跳转到书签 {a-zA-Z} |
### 选择文本
| 快捷键 | 功能 |
| --- | --- |
| `v` | 进入逐字可视模式 |
| `V` | 进入逐行可视模式 |
| `Esc` | 退出可视模式 |
### 改动选中文本
| 快捷键 | 功能 |
| --- | --- |
| `~` | 切换大小写 |
| `d` | 删除一个词 |
| `c` | 变更 |
| `y` | 复制 |
| `>` | 右移 |
| `<` | 左移 |
| `!` | 通过外部命令进行过滤 |
### 保存并退出
| 快捷键 | 功能 |
| --- | --- |
| `:q` | 退出 Vim如果文件已被修改将退出失败 |
| `:w` | 保存文件 |
| `:w new_name` | 用 new_name 作为文件名保存文件 |
| `:wq` | 保存文件并退出 Vim |
| `:q!` | 退出 Vim不保存文件改动 |
| `ZZ` | 退出 Vim如果文件被改动过保存改动内容 |
| `ZQ` | 与 :q! 相同,退出 Vim不保存文件改动 |
### 下载 Vim 快捷键速查表
仅仅是这样是否还不足以满足你?别担心,我们已经为你整理好了一份下载版的速查表,以备不时之需。
[点此下载(英文)][14]
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
作者:[Himanshu Arora][a]
译者:[martin2011qi](https://github.com/martin2011qi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/mayank/
[2]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/#comments
[3]:https://linux.cn/article-8143-1.html
[4]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[5]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-keyboard-shortcuts-cheatsheet%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-keyboard-shortcuts-cheatsheet%2F&text=Vim+Keyboard+Shortcuts+Cheatsheet
[9]:mailto:?subject=Vim%20Keyboard%20Shortcuts%20Cheatsheet&body=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-keyboard-shortcuts-cheatsheet%2F
[10]:https://www.maketecheasier.com/locate-system-image-tool-in-windows-81/
[11]:https://www.maketecheasier.com/create-system-image-in-windows8/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343
[14]:http://www.maketecheasier.com/cheatsheet/vim-keyboard-shortcuts-cheatsheet/

View File

@ -0,0 +1,133 @@
5 个针对有经验用户的 Vim 实用技巧
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-tips-tricks-featured.jpg "5 Vim Tips and Tricks for Experienced Userss")
这篇文章是 [Vim 用户指南][12]系列文章中的一篇:
* [Vim 初学者入门指南][3]
* [Vim 快捷键速查表][4]
* 5 个针对有经验用户的 Vim 实用技巧
* [3 个针对高级用户的 Vim 编辑器实用技巧][5]
Vim 编辑器提供了很多的特性,要想全部掌握它们很困难。然而,花费更多的时间在命令行编辑器上总是有帮助的。毫无疑问,和 Vim 用户们进行交流能够让你更快地学习新颖有创造性的东西。
**注:** 本文中用到的例子,使用的 Vim 版本是 7.4.52 。
### 1、 同时编辑多个文件
如果你是一名软件开发者或者把 Vim 作为主要的编辑器那么可能很多时候你需要同时编辑多个文件。“紧跟following”是在同时编辑多个文件时可用的实用技巧。
不需要在多个 shell 界面中打开多个文件,你可以通过把多个文件的文件名作为 Vim 命令的参数从而在一个 shell 界面中打开多个文件。比如:
```
vim 文件1 文件2 文件3
```
第一个文件例子中的文件1将成为当前文件并被读入缓冲区。
在编辑器中,使用 `:next``:n` 命令来移动到下一个文件,使用 `:prev``:N` 命令返回上一个文件。如果想直接切换到第一个文件或最后一个文件,使用 `:bf``:bl` 命令。特别地,如果想打开另外的文件并编辑,使用 `:e` 命令并把文件名作为参数(如果该文件不在当前目录中则需要完整路径做为参数)。
任何时候如果需要列出当前打开的所有文件,使用 `:ls` 命令。看下面展示的屏幕截图。
![vim-ls](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-ls.png "vim-ls")
注意 ”%a” 表示文件在当前活动窗口,而 “#” 表示上一个活动窗口的文件。
### 2、 通过自动补全节约时间
想节约时间并提高效率吗?使用缩写吧。使用它们能够快速写出文件中多次出现、复杂冗长的词。在 Vim 中缩写命令写就是 `ab`
比如,当你运行下面的命令以后:
```
:ab asap as soon as possible
```
文件中出现的每一个 `asap` 都会被自动替换为 `as soon as possible` ,就像你自己输入的一样。
类似地,你可以使用缩写来更正常见的输入错误。比如,下面的命令
```
:ab recieve receive
```
将会自动更正拼写错误,就像你自己输入的一样。如果在一次特殊情况下你想阻止缩写展开或更正发生,那么你只需要在输入一个单词的最后一个字母以后按 `Ctrl + V` ,然后按空格键。
如果你想把刚才使用的缩写保存下来,从而当你下次使用 Vim 编辑器的时候可以再次使用,那么只需将完整的 `ab` 命令(没有起始的冒号)添加到 `/etc/vim/vimrc` 文件中。如果想删除某个缩写,你可以使用 `una` 命令。比如: `una asap`
### 3、 切分窗口便于复制/粘贴
有时,你需要从一个文件将一段代码或文本的一部分复制到另一个。当使用 GUI图形界面编辑器的时候这很容易实现但是当使用一个命令行编辑器的时候这就变得比较困难并且很费时间。幸运的是 Vim 提供了一种高效、节约时间的方式来完成这件事。
打开两个文件中的一个然后切分 Vim 窗口来打开另一个文件。可以通过使用 `split` 命令并以文件名作为参数来完成这件事。比如:
```
:split test.c
```
上面的命令将分离窗口并打开文件 “test.c”
![vim-split](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-split.png "vim-split")
注意到 `split` 命令水平分离 Vim 窗口。如果你想垂直分离窗口,那么你可以使用 `vsplit` 命令。当同时打开了两个文件并从一个文件中复制好内容以后,按 `Ctrl + W` 切换到另一个文件,然后粘贴。
### 4、 保存一个没有权限的已编辑文件
有时候当你对一个文件做了大量更改以后才会意识到你对该文件仅有 `只读` 权限。
![vim-sudo](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-sudo.png "vim-sudo")
虽然把文件关闭,获取权限以后再重新打开是一种解决方法。但是如果你已经做了大量更改,这样做会很浪费时间,因为在这个过程中所有的更改都会丢失。 Vim 提供了一种方式来处理这种情况:你可以在编辑器中在保存文件前更改文件权限。命令是:
```
:w !sudo tee %
```
这个命令将会向你询问密码,就像在命令行中使用 `sudo` 一样,然后就能保存更改。
**一个相关的技巧**:在 Vim 中编辑一个文件的时候,如果想快速进入命令行提示符,可以在编辑器中运行 `:sh` 命令,从而你将进入一个交互的 shell 中。完成以后,运行 `exit` 命令可以快速回到 Vim 模式中。
### 5、 在复制/粘贴过程中保持缩进
大多数有经验的程序员在 Vim 上工作时都会启用自动缩进。虽然这是一个节约时间的做法,但是在粘贴一段已经缩进了的代码的时候会产生新的问题。比如,下图是我把一段已缩进代码粘贴到一个在自动缩进的 Vim 编辑器中打开的文件中时遇到的问题:
![vim-indentation](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-indentation.png "vim-indentation")
这个问题的解决方法是 `pastetoggle` 选项。在 `/etc/vim/vimrc` 文件中加入下面这行内容:
```
set pastetoggle=<F2>
```
然后当你在 `插入` 模式中准备粘贴代码前先按 `F2` 键,就不会再出现上图中的问题,这样会保留原始的缩进。注意,你可以用其他的任何键来代替 `F2`,如果它已经映射到了别的功能上。
### 结论
更进一步的提高你的 Vim 编辑器技巧的唯一方法是,在你日复一日的工作中使用命令行编辑器。留意那些耗时多的操作,然后尝试去寻找是否有编辑器命令可以很快地完成这个操作。
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
作者:[Himanshu Arora][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/himanshu/
[2]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/#comments
[3]:https://www.maketecheasier.com/start-with-vim-linux/
[4]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[5]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-for-experienced-users%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-for-experienced-users%2F&text=5+Vim+Tips+and+Tricks+for+Experienced+Users
[9]:mailto:?subject=5%20Vim%20Tips%20and%20Tricks%20for%20Experienced%20Users&body=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-for-experienced-users%2F
[10]:https://www.maketecheasier.com/enable-two-step-verification-apple-icloud-account/
[11]:https://www.maketecheasier.com/mistakes-wordpress-user-should-avoid/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343

View File

@ -0,0 +1,73 @@
aria2 与 wget :选择你的下载管理器
============================================================
任何没有下载管理器的 Linux 操作系统是不完整的。多年来,基于 Linux 的发行版使用 wget 作为默认下载管理器。它是一个很棒的小程序,可以在命令行下工作,如果你需要安装东西、下载东西、运行 shell 脚本等,某种程度上都可以在 wget 中完成任务。在过去的很多年里,我们发现 wget 缺乏一些高级的功能,而它的替代品 ** aria2** ,由于满足了高级 Linux 用户的渴望而受到了许多用户的关注。我们将在本文中回顾 **aria2** 的安装过程以及 wget 和 aria2 之间的区别,因此你可以决定哪个下载管理器最符合你的需要。
### 安装 aria2
**在 Ubuntu/Debian 中安装 aria2**
只要在 Ubuntu 中运行下面的命令安装:
```
sudo apt-get install aria2
```
[
![aria2](http://linuxpitstop.com/wp-content/uploads/2015/06/aria2.png)
][1]
**在 Fedora/RHEL/Centos 中安装 aria2**
运行下面的命令在 Fedora/RHEL 和基于 Centos 的系统中安装:
```
sudo yum install aria2
```
**在 Arch Linux 中安装 aria2**
运行下面的命令在基于 Arch Linux 的系统中安装。
```
sudo pacman -Sy aria2
```
### aria2 的重要功能
让我们来讨论 aria2 中使它如此受欢迎的重要功能:
* 通过使用多个连接下载文件,最大限度地利用可用带宽。
* 同时下载多个文件和同时下载的能力。
* torrent 客户端提供的所有功能都可以在这个小程序中找到。
* 它提供 meta 链接下载。
* 支持使用 JSON-RPC 和 XML-RPC 协议的远程过程调用。
* 无需等待当前下载完成,轻松批量下载文件。
### aria2 的一些副作用:
aria2 的多线程机制可能会使目标服务器过载。相比下来 wget 就轻量级多了wget 比 aria2 消耗资源少 20。aria2 尚未经受 wget 那样巨大的使用规模的测试,因此可能完全准备好成为默认下载管理器。
### wget 的重要特性
* 当然它是最广泛使用和测试的下载管理器。
* 它是一个简单的程序,具有较少的功能,但稳定工作了几十年。
* 默认所有 Linux 发行版上都有,不需要繁重的安装。
* 与 aria2 相比更轻量级。
### 总结
虽然 wget 没有丰富的功能,但仍然工作得相当不错,然而,高级用户肯定会喜欢 aria2因为它满足更快和并发下载的需要。aria2 可能需要很长时间来取代 wget 成为默认下载管理器,而目前 wget 用在几乎所有 linux 发行版的安装程序脚本中。
--------------------------------------------------------------------------------
via: http://linuxpitstop.com/aria-2-vs-wget/
作者:[Aun][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://linuxpitstop.com/author/aun/
[1]:http://linuxpitstop.com/wp-content/uploads/2015/06/aria2.png

View File

@ -0,0 +1,212 @@
3 个在 Linux 中永久并安全删除文件和目录的方法
============================================================
在大多数情况下,我们习惯于使用 `Delete` 键、垃圾箱或 `rm` 命令[从我们的计算机中删除文件][1],但这不是永久安全地从硬盘中(或任何存储介质)删除文件的方法。
该文件只是对用户隐藏,它驻留在硬盘上的某个地方。它有可能被数据窃贼、执法取证或其它方式来恢复。
假设文件包含密级或机密内容,例如安全系统的用户名和密码,具有必要知识和技能的攻击者可以轻松地[恢复删除文件的副本][2]并访问这些用户凭证(你可以猜测到这种情况的后果)。
在本文中,我们将解释一些命令行工具,用于永久并安全地删除 Linux 中的文件。
### 1、 shred 覆盖文件来隐藏内容
`shred` 会覆盖文件来隐藏它的内容,并且也可以选择删除它。
```
$ shred -zvu -n 5 passwords.list
```
在下面的命令中,选项有:
1. `-z` - 用零覆盖以隐藏碎片
2. `-v` - 显示操作进度
3. `-u` - 在覆盖后截断并删除文件
4. `-n` - 指定覆盖文件内容的次数默认值为3
[
![shred - overwrite a file to hide its contents](http://www.tecmint.com/wp-content/uploads/2017/01/shred-command-example.png)
][3]
*shred - 覆盖文件来隐藏它的内容*
你可以在 `shred` 的帮助页中找到更多的用法选项和信息:
```
$ man shred
```
### 2、 wipe 在 Linux 中安全删除文件
`wipe` 命令可以安全地擦除磁盘中的文件,从而不可能[恢复删除的文件或目录内容][4]。
首先,你需要安装 `wipe` 工具,运行以下适当的命令:
```
$ sudo apt-get install wipe [Debian 及其衍生版]
$ sudo yum install wipe [基于 RedHat 的系统]
```
下面的命令会销毁 private 目录下的所有文件。
```
$ wipe -rfi private/*
```
当使用下面的标志时:
1. `-r` - 告诉 `wipe` 递归地擦除子目录
2. `-f` - 启用强制删除并禁用确认查询
3. `-i` - 显示擦除进度
[
![Wipe - Securely Erase Files in Linux](http://www.tecmint.com/wp-content/uploads/2017/01/Wipe-Securely-Erase-Files.png)
][5]
*wipe 在 Linux 中安全擦除文件*
注意:`wipe` 仅可以在磁性存储上可以可靠地工作,因此对固态磁盘(内存)请使用其他方法。
阅读 `wipe` 手册以获取其他使用选项和说明:
```
$ man wipe
```
### 3、 Linux 中的安全删除工具集
secure-delete 是一个安全文件删除工具的集合,它包含用于安全删除文件的 `srm`secure_deletion工具。
首先,你需要使用以下相关命令安装它:
```
$ sudo apt-get install secure-delete [On Debian and its derivatives]
$ sudo yum install secure-delete [On RedHat based systems]
```
安装完成后,你可以使用 `srm` 工具在 Linux 中安全地删除文件和目录。
```
$ srm -vz private/*
```
下面是使用的选项:
1. `-v`  启用 verbose 模式
2. `-z`  用0而不是随机数据来擦除最后的写入
[
![srm - Securely Delete Files in Linux ](http://www.tecmint.com/wp-content/uploads/2017/01/srm-securely-delete-Files-in-Linux.png)
][6]
*srm 在 Linux 中安全删除文件*
阅读 srm 手册来获取更多的使用选项和信息:
```
$ man srm
```
### 4、 sfill -安全免费的磁盘 / inode 空间擦除器
`sfill` 是 secure-deletetion 工具包的一部分,是一个安全免费的磁盘和 inode 空间擦除器,它以安全的方法删除可用磁盘空间中的文件。 `sfill` 会[检查指定分区上的可用空间][7],并使用来自 `/dev/urandom` 的随机数据填充它。
以下命令将在我的根分区上执行 `sfill`,使用 `-v' 选项启用 verbose 模式:
```
$ sudo sfill -v /home/aaronkilik/tmp/
```
假设你创建了一个单独的分区 `/home` 来存储正常的系统用户主目录,你可以在该分区上指定一个目录,以便在其上应用 `sfill`
```
$ sudo sfill -v /home/username
```
你可以在 sfill 的手册上看到一些限制,你也可以看到额外的使用标志和命令:
```
$ man sfill
```
注意secure-deletetion 工具包中的另外两个工具(`sswap` 和 `sdmem`)与本指南的范围不直接相关,但是,为了将来的使用和传播知识的目的,我们会在下面介绍它们。
### 5、 sswap 安全 swap 擦除器
它是一个安全的分区擦除器,`sswap` 以安全的方式删除 swap 分区上存在的数据。
警告:请记住在使用 `sswap` 之前卸载 swap 分区! 否则你的系统可能会崩溃!
要找到交换分区(并检查分页和交换设备/文件是否已经使用,请使用 `swapon` 命令),接下来,使用 `swapoff` 命令禁用分页和交换设备/文件(使 swap 分区不可用)。
然后在(关闭的) swap 分区上运行 `sswap` 命令:
```
$ cat /proc/swaps
$ swapon
$ sudo swapoff /dev/sda6
$ sudo sswap /dev/sda6 #this command may take some time to complete with 38 default passes
```
[
![sswap - Secure Swap Wiper](http://www.tecmint.com/wp-content/uploads/2017/01/sswap-Secure-Swap-Wiper.png)
][8]
*sswap 安全 swap 擦除器*
阅读 `sswap` 的手册来获取更多的选项和信息:
```
$ man sswap
```
### 6、 sdmem 安全内存擦除器
`sdmem` 是一个安全的内存擦除器其设计目的是以安全的方式删除存储器RAM中的数据。
它最初命名为 [smem][9],但是因为在 Debain 系统上存在另一个包 [smem - 报告每个进程和每个用户的内存消耗][10],开发人员决定将它重命名为 `sdmem`
```
$ sudo sdmem -f -v
```
关于更多的使用信息,阅读 `sdmen` 的手册:
```
$ man sdmem
```
**推荐阅读:** [在 Linux 系统下使用 PhotoRec & TestDisk 工具来恢复文件][11]。
就是这样了!在本文中,我们查看了一系列可以永久安全地删除 Linux 中的文件的工具。像往常一样,通过下面的评论栏发表你对本篇文章的想法或建议。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是一个 Linux 系统及 F.O.S.S 爱好者,即将成为一名系统管理员及 Web 开发人员,他现在是 TecMint 网站的内容创建者,他喜欢使用电脑来工作,并且他坚信分享知识是一种美德。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/permanently-and-securely-delete-files-directories-linux/
作者:[Aaron Kili][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:https://linux.cn/article-7954-1.html
[2]:https://linux.cn/article-8122-1.html
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/shred-command-example.png
[4]:https://linux.cn/article-7974-1.html
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Wipe-Securely-Erase-Files.png
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/srm-securely-delete-Files-in-Linux.png
[7]:https://linux.cn/article-8024-1.html
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/sswap-Secure-Swap-Wiper.png
[9]:https://linux.cn/article-7681-1.html
[10]:https://linux.cn/article-7681-1.html
[11]:https://linux.cn/article-8122-1.html

View File

@ -0,0 +1,220 @@
使用 Ganglia 对 linux 网格和集群服务器进行实时监控
===========
从系统管理员接手服务器和主机管理以来,像应用监控这样的工具就成了他们的好帮手。其中比较有名的有 [Nagios][11]、 [Zabbix][10]、 [Icinga][9] 和 Centreon。以上这些是重量级的监控工具让一个新手管理员来设置并使用其中的高级特性是有些困难的。
本文将向你介绍 Ganglia它是一个易于扩展的监控系统。使用它可以实时查看 Linux 服务器和集群(图形化展示)中的各项性能指标。
![Install Gangila Monitoring in Linux](http://www.tecmint.com/wp-content/uploads/2016/06/Install-Gangila-Monitoring-in-Linux.png)
*在 Linux 上安装 Ganglia*
**Ganglia** 能够让你以**集群**(按服务器组)和**网格**(按地理位置)的方式更好地组织服务器。
这样,我们可以创建一个包含所有远程主机的网格,然后将那些机器按照其它标准分组成小的集合。
此外, Ganglia 的 web 页面对移动设备进行过优化,也允许你导出 `csv` 和 `.json` 格式的数据。
我们的测试环境包括一个安装 Ganglia 的主节点服务器 CentOS 7 IP 地址 192.168.0.29),和一个作为被监控端的 Ubuntu 14.04 主机192.168.0.32)。我们将通过 Ganglia 的 Web 页面来监控这台 Ubuntu 主机。
下面的例子可以给大家提供参考CentOS7 作为主节点Ubuntu 作为被监控对象。
### 安装和配置 Ganglia
请遵循以下步骤,在主节点服务器安装监控工具。
1、 启用 [EPEL 仓库][7] ,然后安装 Ganglia 和相关工具:
```
# yum update && yum install epel-release
# yum install ganglia rrdtool ganglia-gmetad ganglia-gmond ganglia-web
```
在上面这步随 Ganglia 将安装一些应用,它们的功能如下:
- `rrdtool`Round-Robin 数据库,它是一个储存并图形化显示随着时间变化的数据的工具;
- `ganglia-gmetad` 一个守护进程,用来收集被监控主机的数据。被监控主机与主节点主机都要安装 Ganglia-gmond监控守护进程本身
- `ganglia-web` 提供 Web 前端,用于显示监控系统的历史数据和图形。
 
2、 使用 Apache 提供的基本认证功能,为 Ganglia Web 界面(`/usr/share/ganglia`)配置身份认证。
如果你想了解更多高级安全机制,请参阅 Apache 文档的 [授权与认证][6]部分。
为完成这个目标,我们需要创建一个用户名并设定一个密码,以访问被 Apache 保护的资源。在本例中,我们先来创建一个叫 `adminganglia` 的用户名,然后给它分配一个密码,它将被储存在 `/etc/httpd/auth.basic`(可以随意选择另一个目录 和/或 文件名, 只要 Apache 对此有读取权限就可以。) 
```
# htpasswd -c /etc/httpd/auth.basic adminganglia
```
给 adminganglia 输入两次密码完成密码设置。
3、 修改配置文件 `/etc/httpd/conf.d/ganglia.conf`
```
Alias /ganglia /usr/share/ganglia
<Location /ganglia>
AuthType basic
AuthName "Ganglia web UI"
AuthBasicProvider file
AuthUserFile "/etc/httpd/auth.basic"
Require user adminganglia
</Location>
```
4、 编辑 `/etc/ganglia/gmetad.conf`
首先,使用 `gridname` 指令来为网格设置一个描述性名称。
```
gridname "Home office"
```
然后,使用 `data_source` 指令,后面跟集群名(服务器组)、轮询时间间隔(秒)、主节点主机和被监控节点的 IP 地址:
```
data_source "Labs" 60 192.168.0.29:8649 # 主节点
data_source "Labs" 60 192.168.0.32 # 被监控节点
```
5、 编辑 `/etc/ganglia/gmond.conf`
a) 确保集群的配置类似下面。
```
cluster {
name = "Labs" # gmetad.conf 中的 data_source 指令的名字
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
```
b) 在 `udp_send_chanel` 中,注释掉 `mcast_join`
```
udp_send_channel {
# mcast_join = 239.2.11.71
host = localhost
port = 8649
ttl = 1
}
```
c) 在 `udp_recv_channel` 中,注释掉 `mcast_join` 和 `bind` 部分:
```
udp_recv_channel {
# mcast_join = 239.2.11.71 ## comment out
port = 8649
# bind = 239.2.11.71 ## comment out
}
```
保存并退出。
6、打开 8649/udp 端口,使用 SELinux 确保 php 脚本(通过 Apache 运行)能够连接到网络:
```
# firewall-cmd --add-port=8649/udp
# firewall-cmd --add-port=8649/udp --permanent
# setsebool -P httpd_can_network_connect 1
```
7、重启 Apache、gmetad、gmond并确保它们启用了“开机启动”。
```
# systemctl restart httpd gmetad gmond
# systemctl enable httpd gmetad httpd
```
至此,我们现在能够打开 Ganglia 的 Web 页面 `http://192.168.0.29/ganglia` 并用步骤 2 中设置的凭证登录。
[![Gangila Web Interface](http://www.tecmint.com/wp-content/uploads/2016/06/Gangila-Web-Interface.png)][5]
*Gangila Web 页面*
8、 **Ubuntu** 主机上,只需安装 Ganglia-monitor等同于 CentOS 上的 ganglia-gmond
```
$ sudo aptitude update && aptitude install ganglia-monitor
```
9、 编辑被监控主机的 `/etc/ganglia/gmond.conf` 文件。与主节点主机上是相同的文件,除了被注释掉的 `cluster`, `udp_send_channel` `udp_recv_channel` 这里不应被注释:
```
cluster {
name = "Labs" # The name in the data_source directive in gmetad.conf
owner = "unspecified"
latlong = "unspecified"
url = "unspecified"
}
udp_send_channel {
mcast_join = 239.2.11.71
host = localhost
port = 8649
ttl = 1
}
udp_recv_channel {
mcast_join = 239.2.11.71 ## comment out
port = 8649
bind = 239.2.11.71 ## comment out
}
```
之后重启服务。
```
$ sudo service ganglia-monitor restart
```
10、 刷新页面你将在 Home office grid / Labs cluster 中看到两台主机的各种统计及图形化的展示(用下拉菜单选择集群,本例中为 Labs
[![Ganglia Home Office Grid Report](http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Home-Office-Grid-Report.png)][4]
*Ganglia 中 Home office 网格报告*
使用菜单按钮(如上指出的),你可以获取到每台服务器和集群的信息。还可以使用 <ruby>对比主机</ruby>Compare Hosts<rt></rt>选项卡来比较集群中所有服务器的状态。
可以使用正则表达式选择一组服务器,立刻就可以看到它们性能的对比:
[![Ganglia Host Server Information](http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Server-Information.png)][3]
*Ganglia 服务器信息*
我最喜欢的一个特点是对移动端有友好的总结界面,可以通过 Mobile 选项来访问。选择你感兴趣的集群,然后选中一个主机。
[![Ganglia Mobile Friendly Summary View](http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Mobile-View.png)][2]
*Ganglia 移动端总结截图*
### 总结
本篇文章向大家介绍了 Ganglia它是一个功能强大、扩展性很好的监控工具主要用来监控集群和网格。它可以随意安装便捷的组合各种功能你甚至可以尝试一下[官方网站][1] 提供的 Demo
此时,你可能会发现许多知名的 IT 或非 IT 的企业在使用 Ganglia。除了我们在文章中提及的之外还有很多理由这样做其中易用性统计的图形化在名字旁附上脸部照片更清晰不是吗可能是最重要的原因。
但是请不要拘泥于本篇文章,尝试一下自己去做。如果你有任何问题,欢迎给我留言。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-configure-ganglia-monitoring-centos-linux/
作者:[Gabriel Cánepa][a]
译者:[ivo-wang](https://github.com/ivo-wang)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: http://www.tecmint.com/author/gacanepa/
[1]:http://ganglia.info/
[2]:http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Mobile-View.png
[3]:http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Server-Information.png
[4]:http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Home-Office-Grid-Report.png
[5]:http://www.tecmint.co m/wp-content/uploads/2016/06/Gangila-Web-Interface.png
[6]:http://httpd.apache.org/docs/current/howto/auth.html
[7]:https://linux.cn/article-2324-1.html
[8]:http://www.tecmint.com/wp-content/uploads/2016/06/ Install-Gangila-Monitoring-in-Linux.png
[9]:http://www.tecmint.com/install-icinga-in-centos-7/
[10]:http://www.tecmint.com/install-and-configure-zabbix-monitoring-on-debian-centos-rhel/
[11]:http://www.tecmint.com/install-nagios-in-linux/

View File

@ -0,0 +1,66 @@
保持 Linux 容器的安全和稳定
============
![Interview with Andy Cathrow of Anchore](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-containers2.png?itok=rG1pTnZ4)
> 图片来源: [Lucarelli](http://commons.wikimedia.org/wiki/User:Lucarelli) 基于 [Wikimedia Commons](http://commons.wikimedia.org/wiki/File:Containers_Livorno.jpg). CC-BY-SA 3.0
Linux 容器正在改变 IT 从业者的工作方式。相比于庞大、沉重的虚拟机,一些组织发现把他们的应用部署在容器中更有效,可以提供更快的速度,更加密集,提升他们操作的敏捷性。
从安全的角度看,容器带来了一些优势,但是也面临着它们自己的一些安全挑战。和传统的基础设施一样,为了避免安全缺陷,确保运行在一个容器内的组件和系统库的定期更新是至关重要的。但是你如何知道什么东西运行在你的容器内?为了帮助你应对这些的安全挑战,一个名为 [Anchore](https://anchore.com)的初创公司正在开发一个[同名的开源项目](https://github.com/anchore/anchore),它用来帮助展示 Linux 容器中的内容。
为了了解更多关于 Anchore我找到了 Anchore 的市场和产品的发言人 Andrew Cathrow来了解更多关于这个开源项目背后的公司。
![](https://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png)
### 简而言之 Anchore 是什么? 它如何工作?
Anchore 的目标是提供一套工具允许开发人员、运营团队、安全团队在容器的整个开发周期中保持对“监管链Chain of Custody”的全程可见并提供生产部署所需的可见性、可预测性和控制性。Anchore 的引擎通过插件可以进行分析(通过提取镜像数据和元数据)、查询(允许对容器进行分析)、以及策略评估(这里的策略指可以被指定的管理的图像)。
虽然市场上有很多扫描工具,但是大部分不开源。我们认为安全合规的产品应该是开源的,否则你怎么才能信任他们。
Anchore 除了开源以外,还有两大优势,使它可以区别于市场中的商业产品。
首先,我们看的不止是操作系统的镜像。如今的扫描工具专注于操作系统的软件包,比如“你的 RPM 或 DEB 包中有CVE安全漏洞”这虽然是很重要的你不希望你的镜像中有不安全的包但是操作系统包只是镜像的基础。其他的层次都需要进行验证包括配置文件、语言模块、中间件等等。你可以用的全是最新的软件包但是可能一个配置文件配置出现错误不安全就出现在里面。第二个不同就是允许用户添加自己的数据、查询或策略来扩展这个引擎。
### 什么推动了容器的校验和分析工具的需求出现?这个工具可以解决运营面临的什么问题呢?
企业使用 Docker 首要关注的就是安全,特别是他们正在部署的容器的分配和合规性。在生产环境中,从公共镜像库拉取一个镜像,运行它,并在几秒钟部署,是非常简单的,甚至不知道下面可能发生什么。终端用户在部署应用时,必须信任他们所部署的是安全、高效和易于维护的。
容器是不透明的,它们是一个包含应用程序的可部署的“黑盒”。虽然非常容易把这些镜像看作“打包的应用程序”,但是它们包括了系统的镜像和多达数百个包和成千上万个文件。如同所有在物理服务器、虚拟机或者云上的操作系统一样,镜像也需要维护。镜像或许包含了未补丁的安全缺陷、带有 bug 和错误配置的过期软件。
要对您的容器部署有信心,你需要知道底层是什么,并基于容器镜像的内容来做出决定。
### 如今容器的创新基本上都是开源的,你认为是为什么呢?是什么促使了它们开源呢?
在过去的 20 年中,各个组织已经经历了开源带来的优势,节省成本,减少锁定,提高了安全性和更快的创新。容器,特别是 Docker都是非常好的例子。Docker 公司的团队不能在专有系统上创建一个新的软件部署模式他们不能要求在修改专有系统的代码而是与行业领导者比如谷歌、IBM、英特尔、红帽合作朝着一个共同的目标。开源和 Linux 总是开启创新和激励产业困境。在过去,实现一个大的想法需要一个大的团队和很多资源。在开源世界,一个有着很大的创意的小公司可以工作在一个更大的社区中,通过知识共享的力量来协作,提供真正的企业创新。
为了深入的说明开源的使用Anchroe 团队最近刚从多伦多的 LinuxCon 回来,在哪里,令人难以相信的是,微软作为钻石级的赞助商,展示了他们用在 Linux 上的产品投入的增长。Linus Toravlds 曾说过,“如果微软为 Linux 开发应用就意味着我赢了”。我要把这句话改为“开源赢了”。
### 容器领域的通用标准的创建还需要时间,在容器的几乎所有部分,仍有许多挑战。在这个领域,创业公司有哪些挑战?
这里有个很重要的点就是没有开放的标准和开源我们不可能看到快速推动容器的采用和改变行业格局的创新。开放容器倡议OCI由 Linux 和容器行业的行业领导者组成正在为运行环境和镜像格式创造标准这将使我们能够看到更多的创新。Anchore 很自豪能成为 OCI 的新成员,我们期待帮助形成标准。
###你将如何围绕 Anchor 项目建立一个开源社区?
Anchore 团队来自 Ansible、Eucalyptus Systems 和 Red Hat 的领导团队在开源社区中拥有丰富的工作经验。从一开始Anchore 就准备创建一个强大的开源社区,我们正在应用我们在开源世界中学到的经验和教训。第一课,当然,发布要尽早尽快。我们在 6 月开源我们的检测和分析引擎,远远早于我们的商用产品,以便了确保开源项目能够独立运行,使更多的直接用户能够使用它,而无需购买 Anchore 的商用产品。通过支持、服务和增强型的数据源,有很多机会给商用产品创造更多价值,但是如果开源引擎本身没有用,我们将看不到活跃的社区。
我们将 Anchore 模块化,允许添加分析、报告和策略插件,而不需要更改核心的引擎。我们希望保证任何人都可以创建插件,所以我们选择了 Python 作为项目的基本语言,因为 Python 被开发者和系统管理员广泛应用。但是,即使你不熟悉 Python你仍然可以使用任何你喜欢的语言或者脚本环境创建插件。如果你可以创建一个 Bash 脚本,那么你也可以创建一个 Anchore 插件。我们的目标是最大化的吸引社区的参与。虽然我们鼓励用户将贡献回馈给社区,但是我们也为这个项目构建并进行了授权,来确保可以独立创建和维护私有的插件和模块。
### 容器的用途不止是在服务器上更大密度的部署应用程序或者技术层面更快的速度,而且还有不同工具的组合,这些工具提供了一种不同的方式来拉近开发者和操作者共同工作。作为在这个领域工作的公司,你们希望提供一个什么样的消息来让开发者和运营产生共鸣?
随着越来越多的运行环境、编排、监控和集成产品,容器的生态系统正在快速发展。所以,我们的架构中的第一个考虑因素不是限定 Anchore 的部署和使用。我们需要确保我们可以适应任何 CI/CD 工作流无论是私有部署还是云端部署。一个经常问到我们的问题是Anchore 是否将提供一个包含了镜像扫描和分析的容器仓库。虽然这将大大简化我们的工作,但是这会迫使用户进入特定的部署架构,并限制了用户部署他们自己最好的组件的能力。我们已经确保 Anchore 可以和所有领先的仓库、运行环境平台、 CI/CD 平台和编排工具配合使用。
一些开发者掌握了运营技能,并转换为 DevOps 角色,我们看到系统管理员/运营团队也在更多的了解开发,转换成 DevOps 角色。我们也看到了具有混合能力的团队。我们设计了可供开发运营和安全团队使用的 Anchore ,以便他们共同定义规则和策略来评估开发周期中的任何一个环节。另外一个例子是插件/模块的架构,使任何人都可以在他们喜欢的环境中轻松创建一个模块 —— 无论是以 Python、Go、Perl、C 甚至是一个 Bash 脚本。
------
via: https://opensource.com/business/16/10/interview-andy-cathrow-anchore
作者:[Jason Baker][a]
译者:[Bestony](https://github.co/Bestony)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jason-baker

View File

@ -1,5 +1,4 @@
为了畅游网络的人们、专注于云端的 Linux 发行版
专注于云端的 Linux 发行版
============================================================
[
@ -8,85 +7,81 @@
概述:我们列举几款以云端为中心的 Linux 发行版,它们被视为真正能替代 Chrome OS 的 Linux 发行版。
这个世界正在向云端服务转变,而且我们都知道 Chrome OS 倍受人们喜爱。嗯,它确实值得尊重。它超级快、轻盈、省电、简约、设计精美而且充分发挥了当今科技所能提供的云端潜能。
世界正在向云端服务转变,而且我们都知道 Chrome OS 倍受人们喜爱。嗯,它确实值得赞许。它超级快、轻盈、省电、简约、设计精美而且充分发挥了当今科技所能提供的云端潜能。
虽然 [Chrome OS][7] 只能在谷歌的硬件上使用,但是,就只是在你的台式机或者笔记本上,还是有其他的方法来体验云计算的潜能。
虽然 [Chrome OS][7] 只能在谷歌的硬件上使用,但是,在你的台式机或者笔记本上,还是有其他的方法来体验云计算的潜能。
正如我重复所说的,在 Linux 领域中,人们总能参与其中。有那些看起来像 Windows 或者 Mac OS 的Linux 发行版。Linux 汇集了分享,爱和计算体验的最前沿。让我们马上看看这份列表吧!
正如我重复所说的,在 Linux 领域中,人们总能参与其中,比如那些看起来像 Windows 或者 Mac OS 的Linux 发行版。Linux 汇集了分享,爱和计算体验的最前沿。让我们马上看看这份列表吧!
### 1\. CUB LINUX
### 1、 Cub Linux
![Cub Linux Desktop](https://itsfoss.com/wp-content/uploads/2016/10/cub1.jpg)
![Cub Linux Desktop](https://itsfoss.com/wp-content/uploads/2016/10/cub1.jpg)
这不是 Chrome OS ,上述图片描绘的是 Cub Linux 的桌面。不清楚我说的什么?
Cub Linux 对于 Linux 用户来说不再新鲜但是如果你确实不知道的话我来解释下Cub Linux 灵感来源于主流的 Chrome OS ,是一款专注于网页的 Linux 发行版。从母亲 Linux 来讲,它也是 Chrome OS 的开源兄弟。
Cub Linux 对于 Linux 用户来说不是什么新鲜事但是如果你确实不知道的话我来解释下Cub Linux 灵感来源于主流的 Chrome OS ,是一款专注于网页的 Linux 发行版。从母亲 Linux 来讲,它也是 Chrome OS 的开源兄弟。
Chrome OS 内置了 Chrome 浏览器。不久之前,一个名为 [Chromixium OS][10] 的项目启动,旨在用 Chromium 浏览器取代 Chrome 浏览器,来提供与 Chrome OS 同样的体验。因为一些法律上的争论,项目名字后来改为 Cub Linux (取自 Chromium 和 Ubuntu 两个词)。
Chrome OS 内置了 Chrome 浏览器。不久之前,一个名为 [Chromixium OS][10] 的项目启动,旨在用 Chromium 浏览器取代 Chrome 浏览器,来提供与 Chrome OS 同样的体验。因为一些法律上的争论,项目名字后来改为 Cub Linux (取自 **C**hromium 和 **Ub**untu 两个词)。
![cub2](https://itsfoss.com/wp-content/uploads/2016/10/cub2.jpg)
![cub2](https://itsfoss.com/wp-content/uploads/2016/10/cub2.jpg)
在历史部分如名字提示的那样Cub Linux 基于 Ubuntu ,使用了轻量的 Openbox 桌面环境。定制桌面来给人以 Chrome OS 的印象,而且看起来很整洁。
撇开历史不说如名字提示的那样Cub Linux 基于 Ubuntu ,使用了轻量的 Openbox 桌面环境。定制桌面来给人以 Chrome OS 的印象,而且看起来很整洁。
在应用部分,你能安装 Chrome 网上商店的网应用和所有的 Ubuntu 应用。对,有 Chrome OS 的精美应用,你仍能体会到 Ubuntu 的好处。
在应用部分,你能安装 Chrome 网上商店的网应用和所有的 Ubuntu 应用。对,有 Chrome OS 的精美应用,你仍能体会到 Ubuntu 的好处。
就表现而言,这操作系统相当快多亏了它自身的 Openbox 桌面环境。基于 Ubuntu Cub Linux 的稳定性是毋庸置疑的。这桌面流畅的动画和漂亮的用户界面,对于眼睛是一种享受
就表现而言,这操作系统相当快,这多亏了它自身的 Openbox 桌面环境。基于 Ubuntu Cub Linux 的稳定性是毋庸置疑的。这桌面流畅的动画和漂亮的用户界面,对于眼睛是一种享受
[Suggested Read[Year 2013 For Linux] 2 Linux Distributions Discontinued][11]
我向花费大部分时间在浏览器,时不时做些家务的人推荐 Cub Linux 。嗯,一个浏览器就是你所需要的全部,而且,一个浏览器就可以让你得到全部。
我向花费大部分时间在浏览器,时不时做些家务的人推荐 Cub Linux 。嗯,一个浏览器就是你所需要的全部,而且,一个浏览器正是你将会得到的全部。
### 2\. PEPPERMINT OS
### 2、Peppermint OS
不少人把目光投向 Linux 因为他们想要一个良好的使用计算机的体验。一些人是真的不喜欢防病毒软件、磁盘整理程序、清理工具的打扰,他们只是想要一个操作系统而不是个孩子。我必须说 Peppermint OS 真的不会打扰用户。[Peppermint OS][12] 的开发者在理解用户需求上花费了大量的时间精力。
![pep1](https://itsfoss.com/wp-content/uploads/2016/11/pep1.jpg)
![pep1](https://itsfoss.com/wp-content/uploads/2016/11/pep1.jpg)
系统默认内置了很少的软件。内置从每一个软件类别挑选的一些应用,这传统的想法没有被开发者所采纳,这为了良好的用户体验。个性化定制电脑的权力已经移交给用户。顺便说一句,当能用网页替代几乎大部分应用时,我们真的需要安装那么多的应用吗?
系统默认内置了很少的软件。从每一个软件类别挑选的一些应用内置进去,这传统的想法没有被开发者所采纳,这为了良好的用户体验。个性化定制电脑的权力已经移交给用户。顺便说一句,当能用网页替代几乎大部分应用时,我们真的需要安装那么多的应用吗?
Ice
**Ice**
Ice 是一个有用的小工具,它能将你最喜爱和经常用到的网页转化成桌面应用,这样你就能直接从你的桌面或菜单启动。这就是我们所说的特定页浏览器。
![pep4](https://itsfoss.com/wp-content/uploads/2016/11/pep4.jpg)
![pep4](https://itsfoss.com/wp-content/uploads/2016/11/pep4.jpg)
喜欢 facebook 为了快速启动,为什么不弄一个 facebook 的网页应用在你的桌面上?当人们抱怨 Linux 上不知如何正确安装 Google Drive 应用时Ice 能让你在一次单击就能访问
喜欢 facebook 想要快速启动,为什么不弄一个 facebook 的网页应用在你的桌面上?当人们抱怨 Linux 上不知如何正确安装 Google Drive 应用时Ice 能让你在一次单击就能访问
Peppermint OS 7 是基于 Ubuntu 16.04 。它不仅有流畅、稳固的表现,而且反应很快。一个深度定制的 LXDE 将会是你的首页。我所说的定制是为了实现华丽的表现和视觉吸引力。
Peppermint OS 7 是基于 Ubuntu 16.04 。它不仅有流畅、稳固的表现,而且反应很快。一个深度定制的 LXDE 将会是你的首页。我所说的定制是兼顾了华丽的表现和视觉吸引力。
Peppermint OS 介于云操作系统和本地操作系统。虽然这操作系统的框架被设计来支持快速的云端应用,但是本地的 Ubuntu 应用运行得也不错。如果你是像我那样,想要一个能在在线和离线之间保持平衡的操作系统的话,[Peppermint OS 很适合你][13]
Peppermint OS 介于云操作系统和本地操作系统。虽然这操作系统的框架被设计来支持快速的云端应用,但是本地的 Ubuntu 应用运行得也不错。如果你是像我那样,想要一个能在在线和离线之间保持平衡的操作系统的话,[Peppermint OS][13] 很适合你。
[Suggested ReadPennsylvania High School Distributes 1,700 Ubuntu Laptops to Students][14]
### 3.APRICITY OS
### 3、Apricity OS
[Apricity OS][15] 在这里是极具美感的 Linux 发行版之一。它就像是 Linux 里的蒙娜丽莎。但是,不止外观优美,它还有更多优点。
![ap2](https://itsfoss.com/wp-content/uploads/2016/11/ap2.jpg)
![ap2](https://itsfoss.com/wp-content/uploads/2016/11/ap2.jpg)
将 [Apricity OS][16] 加入这名单中的基本理由是它的简洁。当桌面操作系统设计变得越来越乱、堆砌元素时(我只是在讨论 Linux 操作系统Apricity 除去所有杂项简化最基本的人机交互。在这Gnome 桌面环境被定制得非常优美。他们使其变得更简单。
将 [Apricity OS][16] 加入这名单中的基本理由是它的简洁。当桌面操作系统设计变得越来越乱、堆砌元素时(我只是在讨论 Linux 操作系统Apricity 除去所有杂项简化最基本的人机交互。在这Gnome 桌面环境被定制得非常优美。他们使其变得更简单。
预装的软件真的很少。几乎所有的 Linux 发行版有同样的预装软件。但是 Apricity OS 有一个全新的软件集合。Chrome 而不是 Firefox 。我真的很期待这点。我是说为什么不在外面告诉我们改变了什么?
预装的软件真的很少。几乎所有的 Linux 发行版都预装一样的预装软件。但是 Apricity OS 有一个全新的软件集合。提供了 Chrome 而不是 Firefox 。我真的很期待这点。我是说为什么不在外面告诉我们改变了什么?
Apricity OS 也展现了我们在上一段讨论的 Ice 工具。但不是 Firefox Chrome 浏览器用在网页-桌面一体化里。Apricity OS 默认内置了 Numix Circle 图标。每一次你添加一个网页应用,那就会有一个优美的图标放在你的底栏上。
Apricity OS 也展现了我们在上一段讨论的 Ice 工具。但不是 Firefox 而是将 Chrome 浏览器用在网页-桌面一体化里。Apricity OS 默认内置了 Numix Circle 图标。每一次你添加一个流行的网页应用,那就会有一个优美的图标放在你的底栏上。
![](https://itsfoss.com/wp-content/uploads/2016/11/ap1.jpg)
看见我所说的了吗?
Apricity OS 基于 Arch Linux 。(所以任何想要快速上手 Arch ,想要优美发行版的人,来[这里][17]下载 Apricity 的 ISO 文件。) Apricity 完全保持了 Arch 选择自由的原则
Apricity OS 基于 Arch Linux 。(所以任何想要快速上手 Arch ,想要优美发行版的人,来[这里][17]下载 Apricity 的 ISO 文件吧。) Apricity 完全保持了 Arch “选择自由”的原则。在 Ice 上只要花费十分钟,你就能把你所有喜爱的网页应用配置好
华丽的背景,极简主义的桌面和一大堆的功能。这些特性使得 Apricity OS 在建立一个很棒的云端系统上成为一个极佳选择。在 Apricity OS 花上5分钟来使你完全爱上它。我是认真的。
华丽的背景,极简主义的桌面和一大堆的功能。这些特性使得 Apricity OS 在建立一个很棒的云端系统方面成为一个极佳选择。在 Apricity OS 花上 5 分钟,你就会完全爱上它。我是认真的。
到此你就看完了全部给网上居住者的云端 Linux 发行版。给我们关于网页应用和本地应用话题的看法。别忘了分享。
到此你就看完了全部,这是给网上居住者的云端 Linux 发行版。给我们一些关于网页应用和本地应用话题的看法。别忘了分享。
--------------------------------------------------------------------------------
via: https://itsfoss.com/cloud-focused-linux-distros/
作者:[Aquil Roshan ][a]
作者:[Aquil Roshan][a]
译者:[ypingcn](https://github.com/ypingcn)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,245 @@
Linux 系统的成长之路:试用 1993-2003 年之间的 Linux 老版本系统
============================================================
> 让我们一起来回顾 Linux 早期版本的美好时光
![How Linux got to be Linux: Test driving 1993-2003 distros](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/car-penguin-drive-linux-yellow.png?itok=ueZE5mph "How Linux got to be Linux: Test driving 1993-2003 distros")
*图片来源:互联网档案馆[书籍][7][图片][8]。 Opensource.com. CC BY-SA 4.0 编辑引用。*
开源软件最具独特性的一点就是它永远不会真正的走到 EOL生命的终点。它们的磁盘镜像文件大都可以一直在网上找到并且它们的许可证也不会过期因此我们可以返回去找到那些老版本的 Linux 系统,并在虚拟机中安装它们,这都是很容易做到的。通过回顾那些珍贵的系统画面,让我们来回顾 Linux 系统这么多年来所发生的翻天覆地的变化。
我们从 Slackware 1.01 版本来开始这段旅程,在二十多年前它就发布在 **comp.os.linux.announce** 新闻组上了。
### Slackware 1.01 版本系统 1993 年)
![slackware 1.0 screenshot](https://opensource.com/sites/default/files/slack1.png "slackware 1.0 screenshot")
*Slackware 1.01*
体验 Slackware 1.01 系统最爽的是在 Qemu 模拟器软件 [2014 免费镜像系列][9]中有一个预先制作好的镜像文件,因此你可以不用手动去执行安装任务(真不习惯这种“奢华”待遇)。其引导启动命令如下:
```
$ qemu-kvm -m 16M -drive if=ide,format=qcow2,file=slackware.qcow2 \
-netdev user,id=slirp -device ne2k_isa,netdev=slirp \
-serial stdio -redir tcp:22122::22
```
在 1993 年那个版本的 Linux 系统中,很多东西都跟我们所想像的一样。所有常用的基本命令,比如 `ls``cd` 命令的使用方式,以及所有的基本工具(`gawk` `cut` `diff` `perl`,当然还有 [Volkerding][10] 最喜欢的 `elvis` 工具)现在都在使用,而且也包含在如今的 Linux 系统中,但是仍然有一小部分东西让我感到惊讶。当你尝试使用 tab 补全命令方式来列出上百个文件时, BASH 会非常友好的提示用户确认,并且那些查看压缩文件的工具(比如 `zless``zmore` 以及 `zcat`)都已经出现了。很多方面都超乎我的预计,总之,该系统给人的感觉就是超级现代化。
不过,该系统没有软件包管理的相关概念。所有软件的安装和卸载都得手动完成,也不能查询出已安装的软件包。
总的来说Slackware 1.01 系统感觉更像是一个非常现代化的 UNIX 系统,或者更恰当的是,它给人的感觉就是一个 Linux 用户在操作一个现代化的 UNIX 系统。很多东西都非常熟悉,但是也不尽相同。这个在 1993 年发布的操作系统中,并不是所有东西都跟你想像中的一样。
### Debian 0.91 版本系统1994 年)
为了尝试 Debian 0.91 版本系统,我使用的是 [Ibiblio 数字档案][11] 网站下载的软盘镜像文件,该系统最初发表在 1994 年。启动命令如下:
```
$ gunzip bootdsk.gz basedsk1.gz basedsk2.gz
$ qemu-system-i386 -M pc -m 64 -boot order=ac,menu=on \
-drive file=bootdisk,if=floppy,format=raw \
-drive file=debian.raw,if=ide,format=raw \
-device ne2k_isa,netdev=slirp \
-serial msmouse -vga std \
-redir tcp:22122::22 \
-netdev user,id=slirp
```
从 Debian 0.91 的启动磁盘启动后进入到一个简洁的 shell 界面,有很清晰的提示信息告诉你下一步将要执行的操作。
安装过程进行得非常顺利。从磁盘分区,写入 ext2 文件系统到分区,到显示图形菜单操作界面要经过七个步骤,之后开始复制 `basedsk` 镜像文件。这里使用的是以最小化方式来安装 Debian 系统,跟大家在安装自己的 Linux 系统过程中的很多步骤都非常相似。
Debian 系统因其自身的包管理器而出名,但是在早期的版本中只是有一些提示功能而已。有 `dpkg` 命令,但它是一个基于交互式菜单的系统——一种古老的 `aptitude`,有多个层次的可选菜单,并且自然地附带了几个可用软件包。
尽管如此,你也可以感受到其简便的设计理念。你只需下载三个软盘镜像文件,最后合成一个可启动的系统,然后就可以使用一个简单的文本菜单来安装更多的东西。我由衷的明白了为什么 Debian 系统如此受欢迎的原因。
### Jurix/S.u.S.E. 系统1996 年)
![Jurix install screen](https://opensource.com/sites/default/files/jurix_install.png "Jurix install screen")
*安装 Jurix 系统*
Jurix 系统是 SUSE 系统的前身, Jurix 带有的二进制的 `.tgz` 软件包会被组织到类似 Slackware 安装包结构的目录中,其安装包本身也跟 Slackware 的安装包很相似。
```
$ qemu-system-i386 -M pc -m 1024 \
-boot order=ac,menu=on \
-drive \
file=jurix/install,if=floppy,format=raw \
-drive file=jurix.img,if=ide \
-drive file=pkg.raw,if=ide,format=raw \
-device ne2k_isa,netdev=slirp \
-serial msmouse -vga std \
-redir tcp:22122::22 \
-netdev user,id=slirp
```
因为我不是刻意去寻找最早期的版本, Jurix 系统是找到的第一个真正’感觉‘像是打算给用户使用的有图形界面的 Linux 发行版。 [XFree86][12] 图形桌面环境已默认安装了,如果你不打算使用该工具,选择退出该环境即可。
比如 `/usr/lib/X11/XF86Config` (该文件后来变成 `Xorg.conf` )这个配置文件已经存在了,这让我在使用 GUI 前完成了 90% 的工作,但是我花费了一整个周末的时间来调试 `vsync` `hsync`,和 `ramdac` 颜色表重写,最后我完全放弃了。
在 Jurix 系统上安装软件包也非常简单;找到源路径下的 `.tgz` 文件,然后运行一个常用的 `tar` 命令: ` $ su -c 'tar xzvf foo.tgz -C /'` 该软件包就会被解压到 root 分区,并准备好使用了。我刚开始的时候安装了几个之前未安装过的软件包,发现操作也很简单、快速且非常可靠。
### SUSE 5.1 版本系统1998 年)
![suse install](https://opensource.com/sites/default/files/suse5fvwm.png "suse install")
*在 SuSE 5.1 系统上运行 FVWM 窗口管理器*
我是使用 1998 年在马里兰州的一家软件商店里买的 InfoMagic CD-ROM 来安装 SUSE 5.1 系统的。其引导启动命令如下:
```
$ qemu-system-i386 -M pc-0.10 -m 64 \
-boot order=ad,menu=on \
-drive file=floppy.raw,if=floppy,format=raw \
-cdrom /dev/sr0 \
-drive file=suse5.raw,if=ide,format=raw \
-vga cirrus -serial msmouse
```
安装过程相对于前边几次来说要复杂得多。 YasT 工具在软盘和 CD-ROM 光驱之间搞乱了配置文件和设置,还需要重启好多次,在重启了好几次后我才反应过来是我操作顺序不当导致的问题。在安装过程中,我就犯了两次同样的错,我只是习惯了 YasT 工具的安装方式,到第三次才顺利的安装成功,这对于一个 Linux 用户将来的成长来说是一个很大的教训及经验。
我使用 SUSE 5.1 的主要目的就是体验其 GUI 桌面环境。配置的过程已经很熟悉了,使用几个漂亮的图形界面工具(包括一个很好用的 `XF86Setup` 前端界面配置工具)来测试和调试鼠标及显示器问题。我用了一个小时不到的时间就调试好 GUI 界面,并正常运行起来,其中大部分时间是耽搁在研究 Qemu 的虚拟显卡可以提供哪种分辨率和颜色方案。
可选用的桌面环境包括 fvwm、fvwm2 和 ctwm。我使用的是 fvwm并且运行得也正常。我发现 tkDesk 这个 dock 式的文件管理器跟 Ubuntu 系统的 Unity 的启动栏非常的相似。
使用该系统总的来说还是非常令人愉快的一旦成功安装了桌面环境并正常运行起来SUSE 5.1 可以说是取得了令人瞩目的成功。
### Red Hat 6.0 版本系统1999 年)
![Red Hat 1999](https://opensource.com/sites/default/files/redhat6_gimp_0.png "Red Hat 1999")
*在 Red Hat 6 系统上运行 GIMP 1.x 图像处理程序*
下一个系统 Red Hat 6.0 安装盘我刚好家里有。不是 RHEL 6.0 —— 而是 Red Hat 6.0,这是一个在 RHEL 或 Fedora 系统出现之前商店里就有卖的桌面版系统。这个安装盘是我在 1999 年 6 月份买的。
其引导启动命令如下:
```
$ qemu-system-i386 -M pc-0.10 -m 512 \
-boot order=ad,menu=on \
-drive file=redhat6.raw,if=ide,format=raw \
-serial msmouse -netdev user,id=slirp \
-vga cirrus -cdrom /dev/sr0
```
整个安装过程由完全由安装向导指引的,并且速度非常快。无论是选择要安装什么包(按**工作站** **服务器** 及**自定义**进行分组 ),磁盘分区,或者是启动安装,你都不会出现进行不下去的问题。
Red Hat 6 包括一个 `xf86config` 应用程序来一步步指导你完成 X 配置工作,尽管它有一些之后的 X 不认的奇怪的鼠标模拟选项。它比手动修改 Xf86Config 配置文件要容易得多,但是要正确无误的配置好 X 环境显然不是一个简单的工作。
Red Hat 6 绑定的桌面环境是 GNOME ,没错就是它,但是窗口管理器是早期的 [Enlightenment][13] 它同样也提供了主要的声卡服务进程。Xdm  gdm 都作为登录管理器包含在其中,以便普通用户没有权限也可以登录到系统中并启动或者关闭 X 桌面进程,这在多用户系统中是非常重要的。
它缺少一些主要的应用程序;还没有 gedit 工具,没有重要的统一办公应用程序,更没有软件包管理器。有 GnoRPM 工具,这是一个图形界面的 RPM 包管理工具,用于查看及删除软件包,这个工具跟 yum 或 PackageKit 工具非常类似,还有基于图形界面的文件编辑器 gnotepad+ (尽管没有 Emacs 工具)。
总的来说,桌面环境在使用上也是非常直观的。跟后期实现的 GNOME 桌面环境不同,这个早期版本的在屏幕底部有个面板,其中有一个应用程序菜单和启动器图标,在中间位置有个虚拟桌面控制器。我无法想象其它操作系统的用户在使用这个桌面环境时会有多么的不习惯。
Red Hat 6 对于 Linux 系统来说是一个巨大的进步,很明显 Linux 系统正向着成为一个适用的桌面系统方向发展。
### Mandrake 8.0 版本系统2001 年)
![Mandrake 8.0 installer](https://opensource.com/sites/default/files/mandrake8.png "Mandrake 8.0 installer")
*Mandrake: Linux 系统的一个转折点*
Mandrake 8.0 于 2001 年发布,这已经可以跟 Apple OS 9.2 和 Windows ME 系统相提并论了。
我反而觉得老版本的系统才更安全一些。
其引导启动命令如下:
```
$ qemu-system-i386 \
-M pc-0.10 -m 2048 \
-boot order=ad,menu=on \
-drive file=mandrake8.qcow2 \
-usb -net nic,model=rtl8139 \
-netdev user,id=slirp \
-vga cirrus \
-cdrom mandrake-8.0-i386.iso
```
我一直觉得 Red Hat 系统的安装过程非常棒了,但是 Mandrake 的安装过程更是让人喜出望外。它非常友好,并且在继续下一步之前还给用户一个测试配置文件的机会,易用高效,使用起来像魔法一样。我也不用导入自己的 `XF86Config` 配置文件,因为 Mandrake 的安装程序会自动完成该任务。
![Mandrake install](https://opensource.com/sites/default/files/mandrake8install_new.png "Mandrake install")
*Mandrake 8.0 系统的安装程序*
实际上,使用 Mandrake 系统跟使用其它的桌面环境系统的感受基本相同。让我很惊奇是的它们在操作体验上如此的相似。我相信,即使这个时候我在使用 Mandrake 系统的过程中遇到一些问题,以我自己的技术能力甚至是一个技术水平一般的年轻人也很容易解决。它的界面非常直观,帮助文档也很有用,并且软件包管理起来也很容易,只是那个时候人们还不习惯直接到网上下载他们需要的任何软件包来安装。
### Fedora 1 版本系统2003 年)
![Fedora Core install](https://opensource.com/sites/default/files/fedora1.png "Fedora Core install")
*基于 Red Hat 的 Fedora 系统 *
2003 年,新的 Fedora Core 版本系统发布了。 Fedora Core 基于 Red Hat 系统,它的主要目的是在 Red Hat 企业版RHEL成为该公司旗舰产品之前继续带动 Linux 桌面版系统的发展。
启动老版本的 Fedora Core 1 系统也没啥特别的地方:
```
$ qemu-system-i386 -M pc \
-m 2048 -boot order=ac,menu=on \
-drive file=fedora1.qcow2 -usb \
-net nic,model='rtl8139' -netdev user \
-vga cirrus -cdrom fedora-1-i386-cd1.iso
```
安装 Fedora Core 同样简单容易; Fedora 和 Red Hat 系统在之后的 9 年中使用同样的安装器。它同样使用简单易用的图形化界面。
![Fedora Anaconda](https://opensource.com/sites/default/files/fedora1anaconda.png "Fedora Anaconda")
*Anaconda GUI 界面*
使用 Fedora Core 系统的体验跟 Red Hat 6 或 7 版本没多少区别。 GNOME 图形界面很漂亮,有各种独立的配置程序助手,并且界面展示都非常的整洁和专业。
桌面上的 “Start Here” 图标指导用户前往三个位置:应用程序目录,首选项面板和系统设置。 一个红帽的图标表示应用程序菜单,而下边的 GNOME 面板里包括所有最新的 Linux 应用程序启动器,包括 OpenOffice 办公套件和 mozilla 浏览器。
### 展望未来
在 2000 左右, Linux 系统已经发展得很好并取得了巨大的进步。桌面环境前所未有的更加精致美观,有各种可用的应用程序,安装过程比其它操作操作更简易更高效。事实上,从 2000 年以来,用户和系统之间的关系更加紧密,即使到现在也没发生根本上的改变。当然还有一些更新和改善,以及数量惊人的创新方面的变化。
让我们来了解一下各个 Linux 系统项目上的演变:
* Mandrake 系统后来更名为 Mandriva如今为 [Mageia][1]
* Fedora Core 随后改为 [Fedora][2]
* [Ubuntu][3] 脱胎于 [Debian][4] 并且,它让 “Linux” 成为一个家喻户晓的词汇;
* Valve 公司开发的 [SteamOS][5] 成为其官方游戏平台;
* [Slackware][6] 现如今仍在平稳发展。
无论你是一个 Linux 新手,还是一个技术精湛的 Linux 老用户,上面的大多数截图都构成了让 Linux 系统被记入历史的一本传记。很高兴今天我们能够回顾成为世界上最大的开源项目之一的 Linux 系统是如何发展壮大起来的。更重要的是,每一次想到自己也是 Linux 开源世界中的一员我们就无比激动,把握现在,展望未来。
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/penguinmedallion200x200.png?itok=ROQSR50J)
Seth Kenlon —— Seth Kenlon 是一位独立多媒体艺术家,开源文化倡导者, Unix 极客。他还是 Slackware 多媒体产品项目的维护人员之一官网http://slackermedia.ml 。
--------------------------------------------------------------------------------
via: https://opensource.com/article/16/12/yearbook-linux-test-driving-distros
作者:[Seth Kenlon][a]
译者:[rusking](https://github.com/rusking)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/seth
[1]:http://mageia.org/
[2]:http://fedoraproject.org/
[3]:http://ubuntu.com/
[4]:http://debian.org/
[5]:http://store.steampowered.com/steamos
[6]:http://slackware.com/
[7]:https://www.flickr.com/photos/internetarchivebookimages/14746482994/in/photolist-ot6zCN-odgbDq-orm48o-otifuv-otdyWa-ouDjnZ-otGT2L-odYVqY-otmff7-otGamG-otnmSg-rxnhoq-orTmKf-otUn6k-otBg1e-Gm6FEf-x4Fh64-otUcGR-wcXsxg-tLTN9R-otrWYV-otnyUE-iaaBKz-ovcPPi-ovokCg-ov4pwM-x8Tdf1-hT5mYr-otb75b-8Zk6XR-vtefQ7-vtehjQ-xhhN9r-vdXhWm-xFBgtQ-vdXdJU-vvTH6R-uyG5rH-vuZChC-xhhGii-vvU5Uv-vvTNpB-vvxqsV-xyN2Ai-vdXcFw-vdXuNC-wBMhes-xxYmxu-vdXxwS-vvU8Zt
[8]:https://www.flickr.com/photos/internetarchivebookimages/14774719031/in/photolist-ovAie2-otPK99-xtDX7p-tmxqWf-ow3i43-odd68o-xUPaxW-yHCtWi-wZVsrD-DExW5g-BrzB7b-CmMpC9-oy4hyF-x3UDWA-ow1m4A-x1ij7w-tBdz9a-tQMoRm-wn3tdw-oegTJz-owgrs2-rtpeX1-vNN6g9-owemNT-x3o3pX-wiJyEs-CGCC4W-owg22q-oeT71w-w6PRMn-Ds8gyR-x2Aodm-owoJQm-owtGp9-qVxppC-xM3Gw7-owgV5J-ou9WEs-wihHtF-CRmosE-uk9vB3-wiKdW6-oeGKq3-oeFS4f-x5AZtd-w6PNuv-xgkofr-wZx1gJ-EaYPED-oxCbFP
[9]:http://www.qemu-advent-calendar.org/2014
[10]:http://www.slackware.com/~volkerdi/
[11]:https://ibiblio.org/pub/historic-linux/distributions/debian-0.91/debian-0.91/dist
[12]:http://www.xfree86.org/
[13]:http://enlightenment.org/

View File

@ -0,0 +1,95 @@
LFCS 命令行基础
=======================
本文中包含了很多命令行基础。我们将讨论 TeleTYpeTTY和几个命令及其选项。确保做完所有练习并要知道除非另有说明对 CentOS 和 Ubuntu 都是相同的。
### TTY
当没有图形用户界面GUI或当用户在 GUI 之外Linux 就会使用 TTY。当打开终端窗口时也使用 TTY但这些是不同类型的 TTY。
有三种类型的 TTY
1. 物理终端
2. 本地伪终端
3. 远程伪终端
基本上,每个 Linux 系统有大约六个或七个物理 TTY。 通过按住 `CTRL + ALT` 键,然后在 CentOS 按住 `F1``F6` ,而在 Ubuntu 中是 `F1``F7`
**注意:** 一些发行版可能有不同数量的 TTY 和不同的 GUI 默认位置。有点发行版可能有在物理 TTY 之间切换的不同组合键,如 `CTRL + F#``ALT + F#` LCTT 译注:`F#` 代表 F1、F2 等)。当使用 VirtualBox 时,除非您更改了主机键映射,请使用右 CTRL 键。
在 CentOS 中GUI 在 TTY1`CTRL + ALT + F1`)上,其他物理 TTY 都是基于文本的。 在 Ubuntu 上GUI 在 TTY7`CTRL + ALT + F7`)上,其他物理 TTY 都是基于文本的。
**注意:** 尝试在另一个 TTY 下加载 GUI 是不明智的,因为这可能耗用大量资源,但你可以这样做。
当 Linux 启动时,不管是 CentOS 还是 Ubuntu都会打开默认 TTY。如果安装了 GUI对于 CentOS 是打开 TTY1对于 Ubuntu 是打开 TTY7。如果你打开一个终端窗口伪 TTY并使用命令 `who`,你可以看到正在使用的 TTY 的列表。 如图 1 所示。
![Figure 01.jpg](https://www.linuxforum.com/attachments/figure-01-jpg.93/)
*图 1*
在图 1 中,你可以看到我当前登录到 TTY1非 GUI。第二行连接显示我已登录到 GUITTY7以及两个伪 TTYPTS/1 和 PTS/2。如图 2你可以看到新条目显示了远程伪 TTYPTS/3。 远程伪连接来自 IP 地址为 192.168.0.11 的系统。
![Figure 02.jpg](https://www.linuxforum.com/attachments/figure-02-jpg.94/)
*图 2*
可以使用诸如 PuTTY 或任何 SSH 的客户端(如果远程 Linux 系统上启用了 SSH之类的应用程序进行远程 TTY 连接。
如果终端窗口字体比较小,你可以使用 `CTRL + SHIFT` 键和 `+` 键来放大字体。多次按下可以更大。要缩小大小,请使用 `CTRL + SHIFT + -` 不断缩小。要使终端字体恢复为原始大小,请按下 `CTRL + SHIFT + 0`
**注意:** 请注意,如果字体已经足够大或足够小了,组合键就不再工作了。
希望你现在已经了解各种类型的 TTY。让我们看看一些可以在 TTY 中使用的命令。
### 命令
其中一个命令前面已经讨论过了。命令 `who` 用于显示谁登录到了系统。
另一个命令是 `pwd`。命令 `pwd` 代表“打印工作目录Print Working Directory”。该命令返回你所在的当前目录。例如如果终端提示符是 `[jbuse@localhost〜]$`,则用户名为 `jbuse`,当前目录为 `〜`。波浪号(`〜`)代表用户的主文件夹。主文件夹应该是 `/home/USERNAME`。用户名是用于登录系统的名称。
要列出当前文件夹的内容,请使用命令 `ls`。`ls` 命令代表 List。如果未指定任何选项则列出当前文件夹。如果给出文件夹名称则会列出该文件夹的内容。例如要查看 `media` 文件夹的内容,你可以使用命令 `ls /media`
`ls` 命令后面我们可以添加一些选项以显示更多详细信息或特定详细信息。如果你想看到所有的文件夹和文件,即使是隐藏的,请使用选项 `-a`。要查看当前目录中的所有文件和文件夹,请使用命令 `ls -a`。隐藏的文件和文件夹将在名称前面显示一个句点(`.`)。
要在每个文件夹名称后看到正斜杠(`/`),请使用 `-F` 选项。当前文件夹列表将是 `ls -F`。`-F` 用于按文件类型对文件进行分类。符号链接在文件夹名称后用 `@` 表示。
你可以把这两个选项连在一起形成 `ls -aF`
**注意:** 一些选项可能有不同的大小写。选项区分大小写。
另一个选项是显示长列表的 `-l`。示例输出如图 3 所示。文件夹和文件名称列在右侧。文件为白色,文件夹为深蓝色,符号链接为浅蓝色。如图 3 所示,符号链接 `vtrgb` 链接自 `/etc/alternatives/vtrgb`
![Figure 03.jpg](https://www.linuxforum.com/attachments/figure-03-jpg.95/)
*图 3*
左侧的第一列是文件或文件夹的权限。第一个字母是 `d` 的为目录,是 `-` 的为文件。接下来的三个字母显示所有者的权限(`r` - 读、`w` - 写、`x` - 执行),后面是组权限以及“其他人”的权限。下一列数字显示指向文件或文件夹的链接数。再下一列是所有者名称,后面是所有组名称。再下一列是文件或文件夹在存储设备上占用的字节数。接下来的三列是文件上次修改的月份、日期和年份。最后一列是路径名。
目前为止,你可以看到列表是按字母顺序排序。要颠倒从 “z” 到 “a” 而不是 “a” 到 “z” 的顺序,请使用 `-r` 选项。逆转选项 `-r` 使 ls 命​​令反转输出顺序。
要按修改的时间戳列出文件,请使用 `-t` 选项。顺序是从最近修改到最早的修改日期。当然,在命令 `ls -tr` 中,同时使用 `-t``-r` 颠倒了顺序。
如果你不喜欢看文件的长长的字节数,使用选项 `-h`。输出将会更易读,如显示 `4.0K` 而不是 `4096`
要获取单个文件夹的特定信息,请使用选项 `-d`,但必须指定该文件夹。例如,要查看文件夹 `/media` 的详细信息,请使用命令 `ls -ld /media`
另一个要熟悉的命令是命令 `cat`。命令 `cat` 用于将标准输入(文件)复制到标准输出(屏幕)。使用 `cat` 可以轻松地查看文件的内容。例如,要查看名为 `text` 的文件的内容,如果你与文件 `text` 在同一个文件夹中请使用命令 `cat text`。如果你不在同一个文件夹中,那么你必须指定位置。例如,如果文件 `text` 在文件夹 `/home/jarret/test/` 中,那么命令将是 `cat /home/jarret/test/text`
另一个非常有用的命令是 `man`。`man` 命令用于查看特定命令的文档。例如,要查看命令 `ls` 的帮助页面,请使用命令 `man ls`
**注意:** 记住,在 LFCS 考试中,你可以使用 `man` 命令。
查看这些命令并测试它们以熟悉它们。使用 `man` 命令,查看本文中的命令以查看其他可用的选项。
--------------------------------------------------------------------------------
via: https://www.linuxforum.com/threads/lfcs-command-line-basics.3334/
作者:[Jarret][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linuxforum.com/members/jarret.268/

View File

@ -0,0 +1,101 @@
4 个 Linux 下最好的命令行下载管理器/加速器
============================================================
我们经常由于不同需求使用下载管理器从互联网下载文件,它给我和其他人提供了很多帮助。我们都想要一个超级快速的下载管理器来完成下载尽可能多的任务,以便我们可以节省时间来进一步地工作。有很多可以加速下载的下载管理器和加速器可用(图形化界面和命令行界面)。
所有的下载工具做着同样的任务,但它们的处理方式和功能是不同的,比如,单线程和多线程、交互和非交互。 在这里,我们将列出 4 个最好的我们日常工作使用的命令行下载加速器。
#### #1 Aria2
[Aria2][1] 是一个用于 Linux、Windows 和 Mac OSX 的轻量级、多协议和多源的命令行下载管理器/实用程序。它支持 HTTP/HTTPS、FTP、SFTP、BitTorrent 和 Metalink。aria2 可以通过内置的 JSON-RPC 和 XML-RPC 接口操作。
它支持多线程,可以使用多个源或协议下载文件,确实可以加速并尽可能多的完成下载。
它非常轻量级,不需要太多的内存和 CPU。我们可以使用它作为 BitTorrent 客户端,因为它有所有你想要的 BitTorrent 客户端的功能。
#### Aria2 功能
* 支持 HTTP/HTTPS GET 方式
* 支持 HTTP 代理
* 支持 HTTP BASIC 认证
* 支持 HTTP 代理认证
* 支持 FTP (主动、被动模式)
* 通过 HTTP 代理的 FTPGET 命令或隧道)
* 分段下载
* 支持 Cookie
* 它可以作为守护进程运行。
* 支持 BitTorrent 协议和 fast 扩展。
* 在含有多个文件的 torrent 中的选择性下载
* 支持 Metalink 版本 3.0 HTTP/FTP/BitTorrent
* 限制下载/上传速度
有关 Aria2 的进一步用法,请参阅以下文章:[如何在 Linux 中安装和使用 Aria2][2]。
#### #2 Axel
[Axel][3] 是一个轻量级下载程序,它如其他加速器那样做着同样的事情。它可以为一个文件打开多个连接,每个连接下载单独的文件片段以更快地完成下载。
Axel 支持 HTTP、HTTPS、FTP 和 FTPS 协议。它也可以使用多个镜像站点来下载单个文件。 所以Axel 可以为下载加速高达 40大约我个人认为。 它非常轻量级,因为没有依赖,而且使用非常少的 CPU 和内存。
Axel 使用一个单线程将所有数据直接下载到目标文件。
注意:没有可以在单条命令中下载两个文件的选项。
有关 Axel 的更多使用,请参阅以下文章:[如何在 Linux 中安装和使用 Axel][4]。
#### #3 Wget
[wget][5](以前称为 Geturl是一个免费的、开源的命令行下载程序它使用 HTTP、HTTPS 和 FTP 这些最广泛使用的 Internet 协议来获取文件。它是一个非交互式命令行工具,其名字是意思是从万维网中获取文件。
相比其它工具wget 将下载处理得相当好,即使它不支持多线程以及包括后台工作、递归下载、多个文件下载、恢复下载、非交互式下载和大文件下载在内的功能。
默认情况下,所有的 Linux 发行版都包含 wget所以我们可以从官方仓库轻松安装也可以安装到 windows 和 Mac 操作系统。
wget 可在慢速或不稳定的网络连接下保持健壮性,如果由于网络问题下载失败,它将继续重试,直到整个文件下载完成。如果服务器支持重新获取,它将指示服务器从中断的地方继续下载。
#### wget 功能
* 可以使用 REST 和 RANGE 恢复中止的下载
* 可以使用文件名通配符和递归来对目录进行镜像同步
* 基于 NLS 消息文件,提供许多不同语言支持
* 可选将下载的文档中的绝对链接转换为相对链接,以便下载的文档可以在本地链接到彼此
* 可在大多数类 UNIX 操作系统以及 Microsoft Windows 上运行
* 支持 HTTP 代理
* 支持 HTTP cookie
* 支持持久 HTTP 连接
* 无人值守/后台操作
* 使用本地文件时间戳来确定是否需要在镜像时重新下载文档
有关 wget 的进一步用法,请参阅以下文章:[如何在 Linux 中安装和使用 wget][6]。
#### #4 Curl
[curl][7] 类似于 wget但是不支持多线程但令人惊讶的是与 wget 相比,它的下载速度更快。
curl 是一个向服务器上传或下载的数据传输工具,支持的协议有 DICT、FILE、FTP、FTPS、GOPHER、HTTP、HTTPS、IMAP、IMAPS、LDAP、LDAPS、POP3、POP3S、RTMP、RTSP、SCP、SFTP、SMTP、SMTPS、TELNET 和 TFT 等。
该命令无需用户交互即可工作。此外curl 支持代理、用户身份验证、FTP 上传、HTTP POST、SSL 连接、Cookie、恢复文件传输、Metalink 等。curl 由 libcurl 为所有相关传输功能提供支持。
如果指定的 URL 没有 `protocol://` 前缀curl 将尝试猜测你可能需要什么协议。例如,以 “ftp.” 开头的主机名 curl 将假定你要使用 FTP。如果没有找到特定的协议那么默认为 HTTP。
参考下面的文章来进一步使用 curl[如何在 Linux 中安装和使用 curl] [8]。
--------------------------------------------------------------------------------
via: http://www.2daygeek.com/best-4-command-line-download-managers-accelerators-for-linux/
作者:[Magesh Maruthamuthu][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.2daygeek.com/author/magesh/
[1]:https://aria2.github.io/
[2]:https://linux.cn/article-7982-1.html
[3]:https://axel.alioth.debian.org/
[4]:http://www.2daygeek.com/axel-command-line-downloader-accelerator-for-linux/
[5]:https://www.gnu.org/software/wget/
[6]:https://linux.cn/article-4129-1.html
[7]:https://curl.haxx.se/
[8]:http://www.2daygeek.com/curl-command-line-download-manager/

View File

@ -0,0 +1,162 @@
Linux 上搭建 Minecraft 服务器
===============
![Title.jpg](https://www.linuxforum.com/attachments/title-jpg.89/)
“我的世界Minecraft”是一个人们可以在各种游戏主机和计算机上玩的主流游戏。 截止至 2016 年 6 月,在各种平台上已经售出了超过十亿六千万份。因其受欢迎,你可能想在家里举办一个“我的世界”派对,那么你就需要安装一个 “我的世界” 服务器,让所有的玩家连接到同一个世界中一起玩。
### 系统要求
要开始的话,你需要一个有相当数量内存的 Linux 操作系统。你要在服务器上容纳的玩家越多,你就需要越多的内存。硬盘空间倒不是需求很大,只要足够去安装 Java 以及“我的世界”服务器 Java 文件就行。Minecraft 服务器需要有一个稳定的网络连接,不管是有线还是无线网络。
让我们看看 “我的世界”服务器最低要求:
- **CPU**双核或更好。
- **内存:** 2 GB 20-40 用户量)3 GB30-60 用户量8 GB60+ 用户量)。
- **系统:** 不需要图形化用户接口,可以留出更多的空闲资源。
**备注:** 这是“我的世界” 服务端程序的需求,而不是一个完整的操作系统的需求。如果可以给我的世界服务器分配更多的资源,它将运行得更好。
###安装 Java
如果你用 Linux 操作系统运行它的话,你需要安装最新版本的 Java 环境。
为了验证你的 Java 版本,位于终端输入以下命令:`java -version`。结果应该是:
```
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) Client VM (build 25.101-b13, mixed mode)
```
如果你当前的 Java 版本不是 1.8 或者更高,则通过在 Ubuntu 系统的终端下执行以下操作来安装 Java 版本 8
```
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
```
**注意:**如果 `add-apt-repository` 命令无法找到,运行 `sudo apt-get install software-properties-common` 来安装。 您还可以将第三个命令中更改为 `oracle-java9-installer` 来安装最新的 java 版本。
对于 Redhat 系统(如 CentOS请使用以下命令
```
sudo yum install java-1.8.0-openjdk
```
安装后,核实键入版本命令 `java-version` ,并且核实输出。这样你就有了一个适当的 Java 版本,你可以继续进行接下来的安装。
### “我的世界”服务器版本下载
接下来做的事就是去检查用户将运行的“我的世界”的版本。图 1 显示了一个正在运行的 ”我的世界“ ,注意左下角的版本号。
![Figure 01.jpg](https://www.linuxforum.com/attachments/figure-01-jpg.85/)
*图 1*
请记住“我的世界”客户端版本号。每个客户端应该是相同的版本才行。
您接下来要做的是下载客户端所需要的“我的世界”的服务器版本。为了下载该版本你需要知道它的位置。得到所需的文件的命令是:
```
sudo wget https://s3.amazonaws.com/Minecraft.Download/versions/[version]/minecraft_server.[version].jar
```
在 图1 看到,版本号是 1.10.2。那么这个命令就该变成:
```
sudo wget https://s3.amazonaws.com/Minecraft.Download/versions/1.10.2/minecraft_server.1.10.2.jar
```
当你下载好文件,会保存到你当前目录下。使用命令 `pwd` 确定当前位置。
一旦你有了该文件,知道它所保存的文件夹就可以继续了。
### 服务器信息
在启动“我的世界”服务器之前,您必须知道当前系统上能被你使用的可用内存大小。 当启动“我的世界”服务器时,你将需要指定起始内存量和当更多玩家加入时最大分配的内存量。 再次提示,重要的是要有足够的内存。 如果可以,使用最小化安装操作系统来留出更多的内存,例如最小化安装的 Ubuntu。
一旦你有了所需的“我的世界”服务器文件,就可以确定分配给“我的世界”的内存数量。 要确定可用内存,打开一个终端并键入以下命令 ,示例输出如图 2 所示:
```
free -h
```
![Figure 02.jpg](https://camo.githubusercontent.com/686cb2c9421f276e1cab0b08b713f636ed3ca614/68747470733a2f2f7777772e6c696e7578666f72756d2e636f6d2f6174746163686d656e74732f6669677572652d30322d6a70672e38362f)
*图 2*
如图 2 所示,在这个低端系统上你可以看到那只有 684 MB 空闲内存。这不是一个可以用于搭建一个 “我的世界” 服务器的系统。在另一个服务器上我有 2.8 GB 内存可供给“我的世界” 使用。
在我们启动服务器之前,我们需要找到服务器的 IP 地址。 为此,请运行命令 `ifconfig`。 如图 3 所示,应该列出了网络连接,显示 `Internet Address``inet addr`,这里是 `192.168.0.2`。 在我的服务器系统上,它列出的地址是 `192.168.0.14`,这个地址是客户端系统将要使用的地址。
![Figure 03.jpg](https://camo.githubusercontent.com/62dc2bfe97f8df7895d606c594d74f27b4881ee4/68747470733a2f2f7777772e6c696e7578666f72756d2e636f6d2f6174746163686d656e74732f6669677572652d30332d6a70672e38372f)
*图 3*
### 启动“我的世界”服务器
下一步才是真正的启动“我的世界”服务器。在我们实际开始前,会涉及到几个选项。当启动“我的世界”服务器时,你需要指定用多少内存来初始化“我是世界”。 您还将指定使用的最大内存量。
如果我的系统有 3.7GB 闲置内存,我知道会有不到 40 位玩家,于是我只需要划出 2GB。当然我可以增加些以允许用户增长。如果需要的话我还可以留一点内存给系统运行。我将最小值设置为 2 GB最大值设置为 3 GB。 由于最大值设置为 3 GB如果需要的话还可以至少留给系统 700 MB 内存但这只有在“我的世界”服务器使用超过最初分配的2 GB 时才会发生。
启动服务器的命令行是:
```
sudo java -Xms# -Xmx# -jar [path]/minecraft_server.[version].jar nogui
```
现在解释一下命令结构:
- -Xms# - 初始启动分配的内存(`-Xms2048m`
- -Xmx# - 最大分配的内存(`-Xmx3096m`
- [path] “我的世界” 服务器文件路径( `/home/tux/MCS/`
- [version] 下载的“我的世界” 服务器的版本(`1.10.2`
- nogui 用于以基于文本的界面来显示,可以减少内存使用。如果你使用图形化界面,那么移除 `nogui` 选项。
一个使用 2GB 内存以及最大 3GB、位置为 `/home/tux/MCS`、 版本号为 `1.10.2` 的系统的完整命令实例是:
```
sudo java -Xms2048m -Xmx3096m -jar /home/tux/MCS/minecraft_server.1.10.2.jar nogui
```
**注意:** 这里内存容量的大小是兆字节单位。容量要乘以 1024。举个例子2GB 的内存使 2 与 1024 相乘,容量为 2048。但别忘小写字母 `m` 是特指兆字节。你可以简单地使用特指的 `2g``3g` 来表示 2GB 和 3GB。
在你首次运行服务器时会发成一些错误。开始之前,它表明需要同意 “最终用户许可协议 EULA”。
要同意 “最终用户许可协议 EULA”你需要编辑与“我的世界”服务器 JAR 文件同一文件夹下的的 `eula.txt` 文件。
使用一个类似 `nano` 的文件编辑器打开文件 `eula.txt` 文件。确定你进行这步时使用的是 root 权限。将行 `eula = false` 更改为 `eula = true`,并保存文件。
现在,再次输入上述命令以启动服务器。 应该滚过满屏幕信息,然后一个状态行将显示它的创建过程。 当其这个初始世界创建好之后,状态行将显示 100。 有关系统时间更改的任何错误消息是正常的,因此忽略它们。
此时,你可以打开客户端程序并且看到如上图 1 的界面。点击“Multiplayer”按钮。在下一屏幕如图 4选择 “Direct Connect”这将提示您输入服务器地址因此键入“我的世界”服务器的 IP 地址。你现在应该已经连接到游戏了。
![Figure 04.jpg](https://camo.githubusercontent.com/6893151530092ac59b7b04d17ca5bc07d9bfc9b4/68747470733a2f2f7777772e6c696e7578666f72756d2e636f6d2f6174746163686d656e74732f6669677572652d30342d6a70672e38382f)
*图 4*
### 连接的某些麻烦
如果一些客户端无法连接到服务器,那么你需要按下 `CTRL+Z` 退出 Java 程序。打开文件 `server.propertices` 使用一个 nano 之类的编辑器进行编辑。记住要 root 权限。编辑 `online-mode` 行,它应该设置为 `true` ,修改为 `false` 并保存。重启服务器并打开“我的世界”服务器。使用客户端重新连接到服务器,现在应该一切都好了。
建设快乐!
------
via: https://www.linuxforum.com/threads/minecraft-server-on-linux.3202/
作者:[Jarret][a]
译者:[erlinux](http://www.itxdm.me)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxforum.com/members/jarret.268/
[1]: https://s3.amazonaws.com/Minecraft.Download/versions/%5Bversion%5D/minecraft_server.%5Bversion%5D.jar
[2]: https://s3.amazonaws.com/Minecraft.Download/versions/%5Bversion%5D/minecraft_server.%5Bversion%5D.jar

View File

@ -0,0 +1,83 @@
2016 年编程语言发展趋势
============================================================
> 回顾年度最热门的 AI 项目和容器的编程语言、新出现的编程语言,和更多编程趋势。
![Top programming trends in 2016](https://opensource.com/sites/default/files/styles/image-full-size/public/u23316/climb-top-bridge-yearbook_red.png?itok=YITYmpoR "Top programming trends in 2016")
图片提供:[Museum of Photographic Arts][6]。由 Opensource.com 修改。 CC BY-SA 4.0
技术在不断前进 - 可能不总是向前但总是在变动。但即使对于那些关注发展趋势及其对程序员的影响的人来说确切地了解技术的方向也是一个挑战。我们总是在每年秋季才能够清晰地看出当年开源编程趋势那时我与我的同事Kelsey Hightower 和 Scott Hanselman以及我们非常棒的编程委员会正在筹备来年的 [OSCON] [7]O'Reilly 开源大会)。我们获得的建议和对特定主题的关注数量是反映开源世界热门趋势的良好指标。以下是我们在 2016 年看到的顶级编程趋势的概述。
### 编程语言驱动 AI
走出 20 世纪 90 年代的人工智能冬季,人工智能随着它所依赖的计算能力的提升再次出现,它影响着我们如何构建软件。机器学习、深度学习、自然语言处理和自动语音识别覆盖了世界各地 - 从 GitHub 的项目和工作岗位到新公司成立背后的原因以及清除我们杂乱的台面Hey, Alexa!LCTT 译注Alexa 是预装在亚马逊 Echo 内的个人虚拟助手,可以接收及相应语音命令,可被看成是亚马逊版的 Siri 语音助手。用户只需要说一声“Alexa”就可以创建各种任务还可以和各种智能家居设备进行交互。 是的,即使像 OSCON 这样的会议都处处提及 <ruby>“万物皆智能”<rt>all things AI</rt></ruby> 。虽然计算能力的提升已经铺平了道路,所有关于 all things AI 的开源已经引起了行业广泛开放的创新和竞争。谷歌的 [TensorFlow][8]、[OpenAI][9] 和 [Apache Spark][10] 使用强大框架成为行业领导者,但也有较小的参与者,如 [Nervana][11] 的 [Neon][12] 和 [Theano][13]。
AI 的兴起已经影响到了软件开发者的前景?没错,现在是了解 Python 的好时机 - 它给数据工程师和科学家带来的敏捷性和流行性使它成为最流行的 AI 编程语言,其次是 R、Java 和 Scala。
### 容器和 Go 的结合就像花生、黄油和果冻
(花生、黄油和果冻 —— LCTT译注最佳组合
[Go 1.0 发布][14]于 2012 年 3 月。紧接着 [Docker][15] 在一年后发布,[Kubernetes][16] 在另外一年后发布。总之Go 并不是如我们所知的那样专为基础设施的未来而设计的,但 Go 似乎是为了填充编程世界的一个主要的空洞而出现。对于一个高度联网的世界一个必须拥有一流并发性的世界而言Go 是以 Java 或 C++ 永远不会有的方式专门写的。如果你在做运维或者类似的事,你应该至少稍微了解下 Go ,因为它正在发展中,它将会被使用多年,并成为许多程序的骨干。
### Swift 超越了 Apple 的生态系统
Swift 是 [Apple 在 2015 年启动该编程语言不久之后就开源的][17]。Swift 已经成为 iOS 和 Mac OS X 开发人员的热门话题。这种语言很容易理解,因此很快流行起来,并且它比它要取代的语言 - Objective-C 和 C++ 赢得了一个[更安全的声誉][18]。在 [JavaScript 框架][19]和其他新语言的世界中Swift 是否成功仍有待观察但如果它能继续获得苹果忠实用户的欢迎Swift 将有机会成为伟大的网络世界中最有望成功的竞争者和超越者。
### Java 8 vs 使用 JVM 的函数式语言
Java 8 的函数式能力(即引入 Lambdas )的出现使得 JVM 语言(如 Scala 和 Clojure上榜单了。最近很大程度上由于 Apache Spark 的增长使得 Scala 有一点小爆发。现在,因为新老开发人员都在关注 Java 8 所带来的东西至少目前Scala 和 Clojure 似乎被搁置了。Java 现在能够解决并发和大数据相关的事,而那些专门为满足此方面要求而构建的其他编程语言已经做了多年。在 2017 年OSCON 几乎没有 Scala 和 Clojure 的提案,不是因为这样计划的,而是那些提交提案的发言者似乎没有什么兴趣。
### 新兴语言
和往常一样世上总是在不停出现新兴语言目的是比之前的语言做得更好可以响应从前的语言出现时没有的需求或者开始只是疯狂思想最终却改变了我们对编程的看法。今年有五种语言即将进入大时代Rust、Elixir、Elm、Kotlin 和 Perl 6。
这 5 个热门会给行业带来什么?
* [Rust][1]:兼顾速度和一定安全的系统编程语言。
* [Elixir][2]:函数式、动态和容错,适用于那些规模越来越大的应用程序。
* [Elm][3]:更多函数式的乐趣,使用 JavaScript学习成为一种乐趣。
* [Kotlin][4]:这一个是为使用 Java 和 JVM 的人设计的语言 - 静态类型、安全,此外我提到 Java 兼容了吗?
* [Perl 6] [5]它还活着Perl 6 碰巧是一种新的语言,它胜在富有表现力和功能丰富。
时间会告诉他们是否会如约发布。尝试他们,为他们贡献,成为未来的一部分!
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/_mts0602.jpg?itok=7cSl2h8C)
Rachel Roumeliotis - O'Reilly MediaInc. 的战略内容总监,领导了一个编辑团队,其涵盖各种各样的编程主题,从全栈 web 开发到企业中的开源到新兴的编程语言。她是 OSCONO'Reilly 软件架构会议)和 Fluent 的编程主席。 她从事技术出版工作超过 10 年出版了许多领域的内容包括移动编程、UX、计算机安全。
--------------------------------------------------------------------------------
via: https://opensource.com/article/16/12/yearbook-top-programming-trends-2016
作者:[Rachel Roumeliotis][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/rroumeliotis
[1]:https://www.rust-lang.org/en-US/
[2]:http://elixir-lang.org/
[3]:http://elm-lang.org/
[4]:https://kotlinlang.org/
[5]:https://perl6.org/
[6]:https://www.flickr.com/photos/mopa1/5710937421/in/photolist-9GE3Ji-6tCkcs-otWCnW-wkkhM8-tm7Nah-7vwJ3Q-68HXuT-oruzry-7Dnhxt-oeUiuj-otcNUW-oyfLei-i1n1f6-owqxpT-i8RyRi-owbQS4-ovnJwp-otgwsB-qtFP4G-i1yVzD-i9cB9K-i1Db76-8eHe5n-i8VwCo-oupp7X-ouCYj2-i7VHNV-qrLEpj-ou6mGD-otHdws-55Bcba-ba4NaZ-owr9WM-r5rFgN-i1As83-i9e17E-of1nLV-ocbpqf-occJbg-oeZBT4-oujeML-obZjTD-oePhsw-odkejY-5ohHHH-odjBfU-odkSVS-otTy9e-obWKAc-ouXqVQ
[7]:http://conferences.oreilly.com/oscon/oscon-tx
[8]:https://www.tensorflow.org/
[9]:https://openai.com/blog/
[10]:http://spark.apache.org/
[11]:https://www.nervanasys.com/
[12]:https://github.com/NervanaSystems/neon
[13]:https://github.com/benanne/nervana_theano
[14]:https://blog.golang.org/go-version-1-is-released
[15]:https://opensource.com/resources/what-docker
[16]:https://opensource.com/resources/what-is-kubernetes
[17]:https://opensource.com/life/15/12/most-likely-succeed-2016
[18]:http://www.infoworld.com/article/2920333/mobile-development/swift-vs-objective-c-10-reasons-the-future-favors-swift.html
[19]:https://opensource.com/article/16/11/15-javascript-frameworks-libraries

View File

@ -0,0 +1,62 @@
2017 年成为 Linux 专家的 4 个热门技能
============================================================
### 你在新的一年里需要刷哪些技能?
![4 hot skills for Linux pros in 2017](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/lightbulb-idea-think-yearbook-lead.png?itok=56ovNk8n "4 hot skills for Linux pros in 2017")
图片提供:[Internet Archive Book Images][1]。由 Opensource.com 修改。 CC BY-SA 4.0
成为 Linux 专家的一个问题是“专家”的定义在不断变化。当我进入 Linux 世界的时候,那时认为成为一个 _Linux 专家_,你需要能够编译自己的内核。天啊,如果你想在笔记本电脑上使用 Linux即便你只是_用户_你也必须编译一个自定义内核。 如今编译自己的内核通常是浪费时间。这不是说它并不重要,但在开源世界,我们建立在他人成功的基础之上,而 Linux 发行版为我们提供了运行良好的内核。虽然“专家”的定义并不总是那么剧烈变化,但对 IT 专业人员的需求每年都在变化。
下面是 2017 年 Linux 专业人员的四个重要技能:
### 1、 安全
我不是在讨论安全专家或安全顾问。这些职位和服务当然很重要,但是随着联网设备渗透到我们生活的每一个方面,我们需要在我们做出的每一个决定中都具有[安全][2]意识。今年,我的妻子和我买了一台洗衣机和一台冰箱,它们都配备了蓝牙。黑客攻入我的漂洗系统的想法可能看起来很傻,但这都是潜在的攻击点。
当激活工作、家庭或我们的口袋中的任何系统时,我们应该考虑它们可能引发的安全问题。而且因为像联网烤面包机这样的物品不太可能及时获得固件升级,我们需要按照普通设备可能遭到破坏的思路来设计其余的系统。相比以前任何时候,我们更需要考虑来自防火墙内的攻击。不要让你的文件服务器被你的搅拌器破坏!
### 2、 DevOps
[DevOps][3] 不再是一个新概念。在过去两三年里,我们一直鼓励员工学习 DevOps以便他们能够在工作中取得成功。这是个好建议但这并不意味着我们应该完全依赖自动化工具来完成我们的工作。Chef、Puppet、Ansible、Salt Stack 及类似的工具是美好的,但我们需要了解背后发生了什么,所以当发生一些不可避免的错误,我们应该知道如何解决它。
使用 DevOps 的编程方法来计算,我们仍然需要能够维护、修复和理解在代码层之下运行的系统的人。没有 Linux 专家,云计算将是一个可怕的地方,即使那个云在你自己的机房里。
### 3、 开发
作为系统管理员20 年来,我从来没有时间学习编程。这听起来可能是一个借口,但这是事实。我所有的开发技能就是基本的脚本编写,以帮助我更快工作。不过,那些日子已经结束了。虽然我们需要在 DevOps 世界中拥有系统管理技能,但我们还需要系统管理员拥有编程技能。
如果你是一个像我一样的老练的系统管理员,你可能已经采用 DevOps 并每天使用它。如果你真的想要胜过他人,你需要学习如何以编程方式解决问题,并且不要认为 Chef 或 Puppet 代码只是配置文件。 每个 IT 专业人员都至少需要掌握编程的概念,因为 DevOps 代码至少在某种程度上抽象了 IT 的每个方面。
### 4、 软技能
通常,我们在准备职业生涯时所考虑的最后一件事是所谓的 *软技能* - 社交和沟通技巧 - 但是它们可能是最有可能决定你走向成功的技能。无论你正在寻找一份新工作,还是试图适应当前职业生涯的变化,软技能是至关重要的。
划分 IT 各个领域的标准是交错的,并且良好的沟通能力使得这些模糊的分野成为一个有利条件,而不是绊脚石。我们正生活在一个开发人员围绕着服务器,而运维团队编写 Ruby 代码来维护服务器农场的世界里。这些都是 IT 中的大胆的新思想如果人们不能在不同部门间很好的沟通工作场所将迅速有敌对气氛。此外IT 人员总是需要与其他业务领域的人员进行有效沟通。而且,现在比以往有更大的需求。
你计划在 2017 年里添加什么到你的技能中?在评论栏中让我们知道吧。
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/Shawn%20Powers%20350%20x%20250%20px_2.jpg?itok=6n0E_-Z2)
Shawn Powers - 自 2009 年起是 CBT Nuggets (www.cbtnuggets.com) 的一名 IT 训练员,专于 Linux、Chef 及为大规模网络集成多个平台。他在 2016 年 12 月发布了一个在线高级 Linux 认证课程LPIC-2
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/yearbook-4-hot-skills-linux-pros-2017
作者:[Shawn Powers][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/shawnpowers
[1]:https://www.flickr.com/photos/internetarchivebookimages/14758810172/in/photolist-oubL5m-ocu2ck-odJwF4-oeq1na-odgZbe-odcugD-w7KHtd-owgcWd-oucGPe-oud585-rgBDNf-obLoQH-oePNvs-osVgEq-othPLM-obHcKo-wQR3KN-oumGqG-odnCyR-owgLg3-x2Zeyq-hMMxbq-oeRzu1-oeY49i-odumMM-xH4oJo-odrT31-oduJr8-odX8B3-obKG8S-of1hTN-ovhHWY-ow7Scj-ovfm7B-ouu1Hj-ods7Sg-qwgw5G-oeYz5D-oeXqFZ-orx8d5-hKPN4Q-ouNKch-our8E1-odvGSH-oweGTn-ouJNQQ-ormX8L-od9XZ1-roZJPJ-ot7Wf4
[2]:https://opensource.com/tags/security
[3]:https://opensource.com/tags/devops

View File

@ -0,0 +1,185 @@
50 种系统免遭黑客侵袭的方法 [2017 年版]
============================================================
> Paul Simon 概括了“与爱人分手的 50 法”,而这里,我们提供了提高系统安全性的 50 种方法。
![secure your systems](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=VNmpz6K- "secure your systems")
图片来自: 
Opensource.com
当我还是小孩子,耳畔萦绕着 Paul Simon 的流行歌:“[与爱人分手的50法][3]”。当我渐渐地长大,突然受歌的启发,收集了 50 种方法,免得你——门内汉和门外汉——遭受黑客侵袭啊:
### “你刚刚从后头溜出去了,杰克”
1、 备份你的数据。如果你不幸被勒索软件光顾,那么你就不用支付赎金,因为你做了备份。
2、 当你需要在公共场所为你的手机充电,那就使用 [sysncstop][4]吧或者你也可以用你的备份电池。LCTT 译注sysncstop 是一种可以在公共场所安全充电的 USB 设备。在公共场所充电的风险,你知道的。)
3、 利用好你的审计系统,里头有好多很酷的工具可以帮助你监控系统。如果你确实遭到了入侵,那么审计系统也许就可以告诉你发生了什么,以及攻击者做了些什么。
4、 说到日志,把日志定向到集中式服务器上总是一个不错的想法,因为如果某个黑客侵入你的系统里,他首先要攻击的就是日志系统以便隐藏他的踪迹。构建一个好的入侵检测系统来监控日志,这对于防范黑客也很有帮助。
### “做份新的计划吧,斯坦”
5、 以强制模式运行 SELinux见 [StopDisablingSelinux.com][5]。不要觉得我现在还在喋喋不休地说这个可笑。SELinux 可以防止 0day 漏洞的影响。当[破壳][6]漏洞出现的时候SELinux 曾是唯一的防护手段。
6、 如果可能,在 [SELinux 沙盒][7]中运行应用程序吧——在容器火遍全球前,它就已经是容器了。同时,请关注 [Flatpack][8] 开发,这个工具很快会开发沙盒功能。
7、 不要安装或者使用 Flash。Firefox 不再支持它了,同时也希望大多数 web 服务器正在远离它。
8、 使用[受约束的 SELinux 用户][9]来控制用户在你的系统中所能做的事。如果你正运行着一台共享登录的系统,设置用户为 `guest_t`
### “你不必害羞,罗伊”
9、 利用 [systemd 工具的能力][10]来帮助你提升系统安全。大多数系统攻击是通过那些监听着网络的服务来实现的,而 Systemd 提供了一些很棒的方法来锁定服务。例如,使用 [PrivateTmp=yes][11] 。Privatemp 利用挂载命名空间来为服务器的 `/tmp` 设置一个私有的 **tmpfs** 挂载,这可以阻止被入侵的服务访问到主机 `/tmp` 中的内容,以及针对系统中基于监听 `/tmp` 的服务的潜在攻击。
10、 `InaccessibleDirectories=/home` 是一个 systemd 单元的选项,它使用挂载命名空间的方式使从服务的角度看不到 `/home` 目录(或者其它任何目录),这会使得被入侵的服务攻击到数据更为困难。
11、 `ReadOnlyDirectories=/var` 是另外一个 systemd 单元的选项,它使用挂载命名空间的方式来将目录内容变成只读模式。基本上你总是可以让 `/usr` 运行在**只读模式**。这可以阻止一个被入侵的应用程序重写二进制文件,因为那可以在下次服务重启时,该服务依旧是被入侵的。
12、 降低服务权限(`CapabilityBoundingSet=CAP_CHOWN CAP_KILL`)。在内核中,特权服务被分解成一些列不同的权限。大多数服务不需要很多权限(如果需要一些的话),而 systemd 提供了一个简单的开关来从服务中剥离这些权限。
13、 如果服务不使用网络,那么你可以使用 `PrivateNetwork=yes` 来为该服务关闭网络功能。只需在服务的单元文件中开启该选项,就可以享受它带来的好处,关闭服务所有可用的网络。黑客常常并不是真的想破坏你的机器——他只是想用它作为攻击服务器来攻击其它机器。如果服务连不上网络,那么就不会受到攻击。
14、 控制服务可用的设备。 Systemd 提供了 `DeviceAllow` 配置,它控制了该服务可用的设备。`DeviceAllow=/dev/null rw` 将访问限制为 `/dev/null`,且仅可访问该设备节点,不允许对其它任何设备节点的访问。该功能实现于设备的 cgroup 控制器顶端。
15、 Systemd 系统即将迎来的一个新功能是 [`ProtectSystem Strict`][2],该功能可以开启所有这些命名空间以完全锁定服务运行的环境。
### “刚刚重获自由”
16、 不要使用没有运行着 SELinux[SEAndroid][11])强制模式的手机。幸运的是,我听说目前超过 90% 的安卓手机都运行着 SEAndroid 的强制模式,这真让我高兴。现在要是我们能让那些果粉们使用 SELinux 就好了。
17、 只从受信源安装软件。不要安装你从因特网找来的危险东西,对于你的手机、计算机系统、虚拟机以及容器等等也一样。
18、 我不会在我的手机上进行网上银行操作——我只在我的 Linux 计算机上做这事儿。如果黑客偷了我的信用卡,也许我就丢了那么 50 美元;而如果他黑进我的银行账户,那我丢的钱就会更多。我想我是个老古板。(“滚出我的地盘。”——那些老古板都会这样说。)
19、 我用我手机做的一件很酷的事情,就是设置让我的信用卡公司每次在我的信用卡消费时给我发送短信。那样的话,如果账号被盗,我会更快地知道。
20、 当你需要安全地通讯,请使用 [Signal 安全信息应用][12]。
### “搭个便车,格斯”
21、 在你的计算机系统上运行 Linux。当我第一次想用计算机联络我的父亲时在他的计算机中毒前我很少回家。我回去给他的系统安了个 Linux而他从那以后就一直运行着它。我相信 Linux 大体上说是一个更加安全的系统,因为它的设计方式。而且我也相信这个桌面被黑的可能性也相对较小,因为用它的人相对较少。有些人或许要持反对意见了,他们会说 Windows 在过去几年中已经有了很大的改进了,但对于我而言,我仍然坚持己见。
22、 只运行那些有[安全响应团队][13]进行安全监管的发行版。企业软件及其重要。
23、 运行一个企业级内核。在容器中,单点故障往往是内核。如果你想要保证它安全,那么就使用一个企业级内核,即便它不是一个最新的版本,但也包含了最新的安全补丁。记住,最新的内核虽然带来了最新的安全补丁,但是它也带来了大量的新代码,这些代码可能存在漏洞。
### “你不要说太多”
24、 大多数非法入侵都是通过社会工程学实施的——例如电子邮件链接、web 浏览器攻击,以及电话。对于此,最好的选择是接受相关教育,并且对一切留个心眼儿。没有哪个来自尼日利亚的家伙会给你钱,国税局也不会打电话到你家问你要钱。如果你电子邮件收到了来自你银行的电子邮件,里面包含有到某个网站的链接,那么不要直接去点击那个链接,在 web 浏览器中输入那个地址来打开。
25、 总是把你的系统打上最新的安全补丁。已知有安全漏洞以及过时的系统的数量十分可怕,脚本小子们依赖于你**不**更新系统。
26、 当连接到网络上的服务时,请始终使用 HTTPS。Chrome 和 Firefox 现在有个强制开启 HTTPS 的模式。到 2016 年为止,那些还不支持安全通讯的网站可能就不值得你们访问。
27、 在你的容器中使用 [seccomp][14],这会将攻击限制在内核之外,内核是个单点故障。限制什么进程可以具体讨论。
### “就把那钥匙丢下吧,李”
28、 使用 [YubiKey][15] 来存储私钥。
29、 加密你系统上的数据。至少对于笔记本而言,应该把**家目录**以及你的其它数据目录加密。几年前,我正乘坐在伦敦的地铁上,我的笔记本就成了某些人的目标——我下了车,车门关上了,而我发现我的笔记本不见了。此时,地铁已经驶出了站台。幸运的是,我把磁盘加密了。
30、 给你的所有网站用上 [Let's Encrypt][16] 吧,没有任何理由不再运行 HTTPS 了。
31、 绝不要在不同 web 服务器上使用相同的密码。虽然这个很难不落入陷阱,但是像 [Let's Encrypt][16] 这样的工具会有很大帮助。如果你使用 ssh 密钥来登录进系统,这会更好。
32、 使用双因素认证2FA。密码变得无关紧要使用 Yubikey 以及诸如此类的工具可以使得双因素认证很方便,我们都有手机。在大脑中记一个密码,并在手机中生成一个密钥,总是比一个密码来得更好。
33、 网站总要我注册个帐号,没有比这更激怒我的事情了——我们就不能做得更好点?对于网站密码,始终都要使用密码生成工具来生成。我是个保守派:我使用 [Password Safe][17] 来生成密码,然后剪切粘贴到 web 浏览器中。我听说,其他人使用 [LastPass][18],或者其它整合在手机和 web 服务中的工具也用着不错。
34、 配置像 [FreeIPA][19] 之类的服务用于身份认证。使用像 [Kerberos][20] 之类的工具来认证和授权,会使得跟踪雇员及其对系统的访问更为简便(而且它也有很酷的加密服务)。使用活动目录也很不错,或许我有点偏颇。
35、 如果你经常输入密码,那就使用一个容易记忆的句子,而不是一个单词。我所偏好的用于记忆密码的方式,就是使用有几个单词并且易于输入的词组。
### “让自己自由”
36、 使用 [USBGuard][21] 来保护你的系统免遭流氓 USB 设备破坏。
37、 在过去几年中,我一直工作于容器方面,让我们来说说容器的安全吧。首先,让它们在开启强制模式的 SELinux 的系统中运行。如果你的系统不支持 SELinux那就换个支持它的版本吧。SELinux 是使用文件系统来保护容器免遭破坏的最佳工具。
38、 如果可能,在容器中跑你的服务吧。我相信,使用 [OCI 镜像格式][22] 和 Linux 容器技术是应用的未来。用 [runC][23]、OCID、RKT、Systemd-nspawn 等等来启动这些容器。虽然我常常说“容器并不包容“,但是不要在容器外面运行这些服务更好一些。
39、 在虚拟机中运行容器。虚拟机提供比容器更好的隔离机制,在虚拟机中跑像容器之类的东西,更加灵活有弹性,并且互相隔离。
40、 在不同的虚拟机中,按不同的安全需求跑容器应用。你可以在 DMZ 中的虚拟机上跑 web 服务容器,而在 DMZ 外的虚拟机上跑数据容器。
41、 同时记得在不同的物理机上跑需要最高安全性的虚拟机并且容器放在不同虚拟机上这也叫深度防护LCTT 译注:此处原文有误,根据理解修改)。
42、 以[只读模式][24]跑容器。开发环境中的容器需要能够写入到 `/usr`,但是生产环境中的容器只能写入到 `tmpfs`,并且将卷挂载到容器中。
43、 [降低容器权限][25]。不管是在容器中,还是在容器外,我们都以比它们所需的更多的“权限”跑它们的进程,你可以通过降低权限来让你的进程更加安全。
44、 [不要以 root 身份在容器中跑进程][26]。大多数服务都不需要 root 特权,或者它们需要该权限来绑定到低于 1024 的端口,然后切换到非 root 用户。我建议你始终以非 root 身份来跑应用。
45、 给你的容器打上最新的 CVE 补丁。使用像 OpenShift 这样的工具来构建并维护你的容器镜像是个不错的主意,因为它会在新的安全补丁出现时自动重构容器镜像。
46、 我的一个同事说 “Docker 就是用来在你的主机上以 root 身份运行来自因特网的随机代码的。”从一个受信源获取软件,不要抓取你在 docker.io 上随便找到的第一个 Apache 应用。[操作系统有重要关系][27]。
47、 在一台受限的容器化优化的主机上跑生产环境容器,例如在一台[原子主机][28]上,它开启了所有安全特性,为运行中的容器而优化,带有限制攻击层和原子级更新。有什么不喜欢的吗?
48、 使用像 [OpenScap][29] 这样的工具来扫描你系统的漏洞。糟糕的是,新的漏洞总是层出不穷,所以你得时刻更新你的扫描器。(也可以看看 [原子扫描][30],用于扫描你的容器。)
49、 OpenScap 也具有扫描[安全配置][31]的功能,如 STIG安全技术部署指南
50、 为你孩子收到的所有那些圣诞物联网设备设置一个特别的客户网络。我钟爱我的 Amazon Echo还有自动化灯以及电源开关“Alexa打开圣诞灯“但是所有这些都是由可能存在安全问题的 Linux 操作系统控制。
### ”一定还有着另外 50 种免遭黑客侵害的方法“
你会为这个列表添加点什么呢?在下面的评论中告诉我们吧。
_Josh Bressers 对本文作出贡献。_
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/walsh1.jpg?itok=JbZWFm6J)
Daniel J Walsh - Daniel Walsh 已经致力于计算机安全领域将近 30 年。Dan 在 2001 年 8 月份加入 Red Hat。
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/yearbook-50-ways-avoid-getting-hacked
作者:[Daniel J Walsh][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/rhatdan
[1]:http://danwalsh.livejournal.com/51459.html
[2]:https://www.phoronix.com/scan.php?page=news_item&px=systemd-New-Protect-Tunables
[3]:https://www.youtube.com/watch?v=0H5chfbcWtY
[4]:http://syncstop.com/
[5]:http://stopdisablingselinux.com/
[6]:http://danwalsh.livejournal.com/71122.html
[7]:http://danwalsh.livejournal.com/31146.html
[8]:http://flatpak.org/
[9]:http://danwalsh.livejournal.com/37404.html
[10]:http://0pointer.de/blog/projects/security.html
[11]:https://source.android.com/security/selinux/
[12]:https://whispersystems.org/
[13]:https://access.redhat.com/blogs/766093/posts/2695561
[14]:https://lwn.net/Articles/656307/
[15]:https://www.yubico.com/
[16]:https://letsencrypt.org/
[17]:https://pwsafe.org/
[18]:https://www.lastpass.com/
[19]:https://www.freeipa.org/page/Main_Page
[20]:https://web.mit.edu/kerberos/
[21]:https://github.com/dkopecek/usbguard
[22]:https://www.opencontainers.org/
[23]:https://runc.io/
[24]:http://www.projectatomic.io/blog/2015/12/making-docker-images-write-only-in-production/
[25]:http://rhelblog.redhat.com/2016/10/17/secure-your-containers-with-this-one-weird-trick/
[26]:https://www.projectatomic.io/blog/2016/01/how-to-run-a-more-secure-non-root-user-container/
[27]:https://opensource.com/16/12/yearbook-why-operating-system-matters
[28]:https://access.redhat.com/articles/rhel-atomic-getting-started
[29]:https://www.open-scap.org/
[30]:https://developers.redhat.com/blog/2016/05/02/introducing-atomic-scan-container-vulnerability-detection/
[31]:https://www.open-scap.org/security-policies/scap-security-guide/

View File

@ -1,13 +1,13 @@
使用 Axel 命令行下载器/加速器加速你的下载
使用 Axel 命令行下载器/加速器加速下载
============================================================
[Axel][7] 是一个轻量级下载程序,它和其他加速器一样,为一个文件打开多个连接,每个连接下载单独的文件片段以更快地完成下载。
[Axel][7] 是一个轻量级下载程序,它和其他加速器一样,对同一个文件建立多个连接,每个连接下载单独的文件片段以更快地完成下载。
Axel 支持 HTTP、HTTPS、FTP和 FTPS 协议。它也可以使用多个镜像下载单个文件。所以Axel 可以加速下载高达 40大约我个人认为。它非常轻量级因为它没有依赖并且使用非常少的 CPU 和 RAM
Axel 支持 HTTP、HTTPS、FTP 和 FTPS 协议。它也可以使用多个镜像站点下载单个文件,所以Axel 可以加速下载高达 40大约我个人认为。它非常轻量级因为它没有依赖并且使用非常少的 CPU 和内存
Axel 使用一个单线程将所有数据直接下载到目标文件
Axel 一步到位地将所有数据直接下载到目标文件LCTT 译注:而不是像其它的下载软件那样下载成多个文件块,然后拼接)
**注意**没有选项可以在单条命令中下载两个文件。
**注意**不支持在单条命令中下载两个文件。
你还可以尝试其他命令行下载管理器/加速器。
@ -76,7 +76,7 @@ Downloaded 21.6 megabytes in 3 seconds. (5755.94 KB/s)
#### 2) 用不同的名称保存文件
要使用其他名称来保存文件,启动下载时可以添加 -o小写选项和文件名。这里我们使用文件名 **owncloud.tar.bz2** 来保存文件。
要使用其他名称来保存文件,启动下载时可以添加 `-o`(小写字母)选项和文件名。这里我们使用文件名 `owncloud.tar.bz2` 来保存文件。
```
# axel -o cloud.tar.bz2 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
@ -114,7 +114,7 @@ Downloaded 21.6 megabytes in 3 seconds. (6001.05 KB/s)
#### 3) 限制下载速度
默认 axel 以字节/秒为单位设置下载文件的最大速度。当我们的网络连接速度较慢时,可以使用此选项。只需添加 `-s` 选项,后面跟字节值。这里我们要限速 `512 KB/s` 下载一个文件。
默认情况下 axel 以字节/秒为单位设置下载文件的最大速度。当我们的网络连接速度较慢时,可以使用此选项。只需添加 `-s` 选项,后面跟字节值。这里我们要限速 `512 KB/s` 下载一个文件。
```
# axel -s 512000 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
@ -150,7 +150,7 @@ Downloaded 21.6 megabytes in 44 seconds. (494.54 KB/s)
#### 4) 限制连接数
axel 默认建立 4 个连接以从不同的镜像获取文件。此外,我们可以通过使用 `-n` 选项添加更多的连接,后跟连接数 `10` 来提高下载速度。我们为了更安全新添加了八个连接,但不幸的是,它花了更多时间来下载文件。
axel 默认建立 4 个连接以从不同的镜像获取文件。此外,我们可以通过使用 `-n` 选项添加更多的连接,后跟连接数 `10` 来提高下载速度。保险起见,我们添加了十个连接,但不幸的是,它花了更多时间来下载文件。
```
# axel -n 10 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
@ -267,7 +267,7 @@ Downloaded 3415.4 kilobytes in 1 second. (2264.93 KB/s)
#### 7) 替换进度条
如果你不喜欢默认的进度条,你可以使用 **-a** 选项来替换进度条。
如果你不喜欢默认的进度条,你可以使用 `-a` 选项来替换进度条。
```
# axel -a https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
@ -281,7 +281,7 @@ Starting download
Downloaded 14.3 megabytes in 2 seconds. (5916.11 KB/s)
```
我们已经了中断上面的下载,以便在下载文件时能清楚地显示替代进度条状态。一旦文件成功下载后,你可以看到相同的输出,如下所示。
我们中断上面的下载,以便在下载文件时能清楚地显示替代进度条状态。一旦文件成功下载后,你可以看到相同的输出,如下所示。
```
# axel -a https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
@ -297,7 +297,7 @@ Connection 0 finished ]
Downloaded 21.6 megabytes in 4 seconds. (5062.32 KB/s)
```
#### 8) 阅读更多关于 axel
#### 8) 了解关于 axel 的更多信息
如果你想要了解更多关于 axel 的选项,只需要进入它的手册。
@ -313,7 +313,7 @@ Downloaded 21.6 megabytes in 4 seconds. (5062.32 KB/s)
via: http://www.2daygeek.com/axel-command-line-downloader-accelerator-for-linux/
作者:[ MAGESH MARUTHAMUTHU][a]
作者:[Magesh Maruthamuthu][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
@ -323,7 +323,7 @@ via: http://www.2daygeek.com/axel-command-line-downloader-accelerator-for-linux/
[1]:http://www.2daygeek.com/aria2-command-line-download-utility-tool/
[2]:http://www.2daygeek.com/wget-command-line-download-utility-tool/
[3]:http://www.2daygeek.com/aria2-command-line-download-utility-tool/
[4]:http://www.2daygeek.com/best-4-command-line-download-managers-accelerators-for-linux/
[5]:http://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/
[4]:https://linux.cn/article-8124-1.html
[5]:https://linux.cn/article-2324-1.html
[6]:http://www.2daygeek.com/author/magesh/
[7]:https://axel.alioth.debian.org/

View File

@ -1,15 +1,15 @@
在 Linux 系统下使用 PhotoRec 工具来恢复已删除或丢失的文件
在 Linux 系统下使用 PhotoRec & TestDisk 工具来恢复文件
============================================================
当你在系统中有意或无意地使用 'shift + delete 组合键或者删除选项或是清空回收站的方式来删除一个文件时,该文件的内容并没有从硬盘(或是其它存储设备)上直接销毁。
当你在系统中有意或无意地使用 `shift + delete` 组合键、删除选项,或是清空回收站的方式来删除一个文件时,该文件的内容并没有从硬盘(或是其它存储设备)上直接销毁。
它仅仅是从系统的目录结构中被移除,然后你在删除文件的目录下就看不到该文件了,但是这个文件仍然存在你磁盘中的某个位置上。
如果你有一个合适的工具和相关的专业知识,你就可以[从电脑中恢复已丢失的文件][1]。然而,随着你存储的文件越来越多,删除的文件将会被覆盖,你可能只能恢复最近删除的文件了。
在这篇文章中,我们将阐明如何在 Linux 系统中使用 **Testdisk** 来恢复硬盘上已删除或丢失的文件,它是非常优秀的修复工具,随一款免费的叫做 **PhotoRec** 的工具发布。
在这篇文章中,我们将阐明如何在 Linux 系统中使用 **TestDisk** 来恢复硬盘上已删除或丢失的文件,它是非常优秀的修复工具,随一款免费的叫做 **PhotoRec** 的工具发布。
**PhoteRec** 工具用于从存储介质比如硬盘,数码相机和 cdrom 设备中恢复丢失的文件。
**PhoteRec** 工具用于从存储介质比如硬盘,数码相机和 cdrom 设备中恢复丢失的文件。LCTT 译注PhotoRec 的意思是 Photo Recovery不是 Photo Recorder。
### 在 Linux 系统中安装 TestDiskPhotoRec
@ -46,7 +46,7 @@ $ sudo photorec /dev/sda3
*Linux 系统 PhotoRec 数据恢复工具*
使用左右箭头选择菜单选项,按 Enter 键确认。要继续恢复操作,选择 `[Proceed]` 并单击 Enter。
使用左右箭头选择菜单选项,按回车键确认。要继续恢复操作,选择 `[Proceed]` 并单击 Enter。
你将看到下面的界面:
@ -64,9 +64,9 @@ $ sudo photorec /dev/sda3
*Linux 系统文件恢复选项*
`Q`  返回,在下图界面,你可以指定你想要查询并恢复的文件扩展名。因此,选择 `[File Opt]`,按 Enter 键确认。
`Q`  返回,在下图界面,你可以指定你想要查询并恢复的文件扩展名。因此,选择 `[File Opt]`,按回车键确认。
`s` 禁用或启用所有文件扩展名,如果你已经停止所有文件扩展,只需要使用向右箭头选择你想要恢复的文件类型即可(或者按向左箭头取消选择)。
`s` 来选择或取消选择所有的文件扩展名,如果你已经取消选择了所有的文件扩展名,只需要使用向右箭头选择你想要恢复的文件类型即可(或者按向左箭头取消选择)。
例如,我想恢复所有系统中丢失的 `.mov` 类型的文件:
@ -76,7 +76,7 @@ $ sudo photorec /dev/sda3
*指定恢复文件类型*
`b` 键保存设置,之后你应该看到如下图所示信息。单击 Enter 键返回(或者按 `Q` 键),再按 `Q` 键返回到主界面。
`b` 键保存设置,之后你应该看到如下图所示信息。单击回车键返回(或者按 `Q` 键),再按 `Q` 键返回到主界面。
[
![Save File Recovery Settings](http://www.tecmint.com/wp-content/uploads/2017/01/Save-File-Recovery-Settings.png)
@ -84,7 +84,7 @@ $ sudo photorec /dev/sda3
*保存文件恢复设置*
现在选择 `[Search]` 开始文件恢复。在下图中,选择存储文件分区的文件系统类型,然后按 Enter 键。
现在选择 `[Search]` 开始文件恢复。在下图中,选择存储文件分区的文件系统类型,然后按回车键。
[
![Select Filesystem to Recover Deleted Files](http://www.tecmint.com/wp-content/uploads/2017/01/Select-Filesystem-to-Recover-Files.png)
@ -92,7 +92,7 @@ $ sudo photorec /dev/sda3
*选择文件系统类型来恢复删除的文件*
下一步,如下图所示,选择是仅对空闲空间还是整个分区进行分析。注意选择整个分区将会让操作过程变得更长更慢。选择合适的选项后,按 Enter 键继续。
下一步,如下图所示,选择是仅对空闲空间还是整个分区进行分析。注意选择整个分区将会让操作过程变得更长更慢。选择合适的选项后,按回车键继续。
[
![Choose Filesystem to Analyze](http://www.tecmint.com/wp-content/uploads/2017/01/Select-Filesystem-to-Analyze.png)
@ -110,7 +110,7 @@ $ sudo photorec /dev/sda3
*选择要保存恢复文件的目录*
下图显示正在被恢复的指定类型的已删除文件。你可以按 Enter 键来停止操作。
下图显示正在被恢复的指定类型的已删除文件。你可以按回车键来停止操作。
**注意**:在恢复的过程中,你的系统会变得很慢,很可能会卡住一段时间,请耐心等待直至恢复完成。
@ -161,7 +161,7 @@ via: http://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/recover-deleted-file-in-linux/
[1]:https://linux.cn/article-7974-1.html
[2]:http://www.cgsecurity.org/wiki/TestDisk_Download
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/PhotoRec-Data-Recovery-Tool.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Select-Partition-to-Proceed-File-Recovery.png

View File

@ -0,0 +1,247 @@
在 Linux 中设置 sudo 的十条 sudoers 实用配置
===================
在 Linux 和其他的类 Unix 操作系统中,只有 root 用户可以运行所有的命令,才能在系统中执行那些需要鉴权的操作,比如安装、升级和移除软件包、[创建用户和用户组][1]、修改系统重要的配置文件等等。
然而,系统管理员,比如说 root 用户,可以通过 [sudo 命令][2] 和一些配置选项来给普通用户进行授权,从而让该普通用户可以运行某些命令已经上述的那些相当重要的系统级操作。
另外,系统管理员还可以分享 root 用户密码 (这个做法是不值得提倡的),这样普通用户就可以通过 `su` 命令来转化为 root 用户角色。
`sudo` 允许已授权用户按照指定的安全策略、以 root 用户 (或者是其他的用户角色) 权限来执行某个命令。
1. `sudo` 会读取和解析 `/etc/sudoers` 文件,查找调用命令的用户及其权限。
2. 然后提示调用该命令的用户输入密码 (通常是用户密码,但也可能是目标用户的密码,或者也可以通过 `NOPASSWD` 标志来跳过密码验证)。
3. 这之后, `sudo` 会创建一个子进程,调用 setuid() 来切换到目标用户。
4. 接着,它会在上述子进程中执行参数给定的 shell 或命令。
以下列出十个 `/etc/sudoers` 文件配置,使用 `Defaults` 项修改 sudo 命令的行为。
```
$ sudo cat /etc/sudoers
```
`/etc/sudoers` 文件:
```
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults logfile="/var/log/sudo.log"
Defaults lecture="always"
Defaults badpass_message="Password is wrong, please try again"
Defaults passwd_tries=5
Defaults insults
Defaults log_input,log_output
```
#### Defaults 项的类型
```
Defaults parameter, parameter_list ### 对任意主机登录的所有用户起作用
Defaults@Host_List parameter, parameter_list ### 对指定主机登录的所有用户起作用
Defaults:User_List parameter, parameter_list ### 对指定用户起作用
Defaults!Cmnd_List parameter, parameter_list ### 对指定命令起作用
Defaults>Runas_List parameter, parameter_list ### 对以指定目标用户运行命令起作用
```
在本文讨论范围内,我们下面的将以第一个 `Defaults` 作为基准来参考。parameter 参数可以是标记 (flags)、整数值或者是列表 (list)。
值得注意的是,标记 (flag) 是指布尔类型值,可以使用 `!` 操作符来进行取反,列表 (list) 有两个赋值运算符:`+=` (添加到列表) 和 `-=` (从列表中移除)。
```
Defaults parameter
Defaults parameter=值
Defaults parameter -=值
Defaults parameter +=值
Defaults !parameter
```
### 1、 安置一个安全的 PATH 环境变量
`PATH` 环境变量应用于每个通过 `sudo` 执行的命令,需要注意两点:
1. 当系统管理员不信任 `sudo` 用户,便可以设置一个安全的 `PATH` 环境变量。
2. 该设置将 root 的 PATH 和用户的 PATH 分开,只有在 `exempt_group` 组的用户不受该设置的影响。
可以添加以下内容来设置:
```
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
```
### 2、 允许 tty 用户会话使用 sudo
该设置允许在一个真实的 tty 中进行调用 `sudo`,但不允许通过 cron 或者 cgi-bin 脚本等方法来调用。添加以下内容来设置:
```
Defaults requiretty
```
### 3、 使用 pty 运行 sudo 命令
少数情况下,攻击者可以通过 sudo 来运行一个恶意程序 (比如病毒或者恶意代码),这种恶意程序可能会分叉出一个后台运行的进程,即使主程序完成执行,它仍能够运行在用户的终端设备上。
为了防止出现这样的情况,你可以通过 `use_pty` 参数来设置 `sudo` 使用伪终端来运行其他命令,而不必管 I/O 日志的开启状态。如下:
```
Defaults use_pty
```
### 4、 创建 sudo 日志文件
默认下,`sudo` 通过 syslog(3) 来记录到日志。但是我们可以通过 `logfile` 参数来指定一个自定义的日志文件。如下:
```
Defaults logfile="/var/log/sudo.log"
```
使用 `log_host``log_year` 参数可以对应记录日志主机名和 4 位数年份到自定义日志文件。如下:
```
Defaults log_host, log_year, logfile="/var/log/sudo.log"
```
下面是自定义 sudo 日志文件的例示:
[![Create Custom Sudo Log File](http://www.tecmint.com/wp-content/uploads/2017/01/Create-Sudo-Log-File.png)][3]
*创建 sudo 日志文件*
### 5、 记录 sudo 命令的输入/输出
`log_input` 和 `log_output` 参数可以让 `sudo` 命令运行在伪终端,并可以对应地记录所有的用户输入和输出到屏幕上。
默认的 I/O 日志目录为 `/var/log/sudo-io`,如果存在会话序列号,它将被存储到该目录。你可以通过 `iolog_dir` 参数来指定一个目录。
```
Defaults log_input, log_output
```
这其中支持转义字符,像 `%{seq}` —— 以 36 为基数的单调递增序列,比如 000001这里每两个数字都分别用来形成一个新目录。请看下边例示 00/00/01
```
$ cd /var/log/sudo-io/
$ ls
$ cd 00/00/01
$ ls
$ cat log
```
[![Log sudo Input Output](http://www.tecmint.com/wp-content/uploads/2017/01/Log-sudo-Input-Output.png)][4]
*记录 sudo 命令的输入/输出*
[cat 命令][5] 来查看该目录的其余部分。
### 6、 为 sudo 用户提示命令用法
如下,使用 `lecture` 参数可以在系统中为 `sudo` 用户提示命令的用法:
参数属性值有三个选择:
1. `always` 一直提示
2. `once` 用户首次运行 sudo 时提示 (未指定参数属性值时的默认值)
3. `never` 从不提示
```
Defaults lecture="always"
```
此外,你还可以使用 `lecture_file` 参数类自定义提示内容,在指定的文件中输入适当的提示内容即可:
```
Defaults lecture_file="/path/to/file"
```
[![Lecture Sudo Users](http://www.tecmint.com/wp-content/uploads/2017/01/Lecture-Sudo-Users.png)][6]
*为 sudo 用户提示命令用法*
### 7、 输入错误的 sudo 密码是显示自定义信息
当某个用户输错密码时,会有一个对应的信息显示在屏幕上。默认是“抱歉,请重新尝试。(sorry, try again)”,你可以通过 `badpass_message` 参数来修改该信息:
```
Defaults badpass_message="Password is wrong, please try again"
```
### 8、 增加 sudo 密码尝试限制次数
`passwd_tries` 参数用于指定用户尝试输入密码的次数。
默认为 3。
```
Defaults passwd_tries=5
```
[![Increase Sudo Password Attempts](http://www.tecmint.com/wp-content/uploads/2017/01/Increase-Sudo-Password-Attempts.png)][7]
*增加 sudo 密码尝试限制次数*
使用 `passwd_timeout` 参数设置密码超时 (默认为 5 分钟),如下:
```
Defaults passwd_timeout=2
```
### 9、 在输错密码时让 sudo 羞辱用户
使用了 `insults` 参数之后一旦你输出了密码sudo 便会在命令窗口中显示羞辱你的信息。这个参数会自动关闭 `badpass_message` 参数。
```
Defaults insults
```
[![Let's Sudo Insult You When Enter Wrong Password](http://www.tecmint.com/wp-content/uploads/2017/01/Sudo-Insult-Message.png)][8]
*在输错密码时让 sudo 羞辱用户*
### 10、 更多关于 sudo 的配置
此外,欲了解更多 sudo 命令的配置,请自行阅读:[su 与 sudo 的差异以及如何配置 sudo][9]。
文毕。你也可以在评论区分享其他有用的 sudo 配置或者 [Linux 技巧][10]。
---------------------------------------------------------------------
作者简介Aaron Kili 是一名 Linux 和 F.O.S.S 忠实拥护者、高级 Linux 系统管理员、Web 开发者,目前在 TecMint 是一名活跃的博主,热衷于计算机并有着强烈的只是分享意愿。
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
译者简介:[GHLandy](http://GHLandy.com) —— 欲得之,则为之奋斗 (If you want it, work for it.)。
![GHLandy](http://GHLandy.com/images/GHLandy.ico)
---------------------------------------------------------------------
via: http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/
作者:[Aaron Kili][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/add-users-in-linux/
[2]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Create-Sudo-Log-File.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Log-sudo-Input-Output.png
[5]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Lecture-Sudo-Users.png
[7]:http://www.tecmint.com/wp-content/uploads/2017/01/Increase-Sudo-Password-Attempts.png
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Sudo-Insult-Message.png
[9]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[10]:http://www.tecmint.com/tag/linux-tricks/

View File

@ -0,0 +1,86 @@
CentOS 与 Ubuntu哪个更适合做服务器
============================================================
![](https://thishosting.rocks/wp-content/uploads/2017/01/centos-vs-ubuntu.jpg.webp)
已经决定买一台虚拟服务器,但还不能决定使用哪个 Linux 发行版?我们都经历过这种困扰。对于 Linux 发行版来说要在这么多的发行版和种种支流flavors中选择一个那简直能让人崩溃。不过对于服务器而言有两个主流的 Linux 发行版,那就是 CentOS 和 Ubuntu。但如何从这两个之中选择这是摆在管理员、初学者和专业人士面前的主要问题。在对这两个和更多发行版有了一定的经验之后我们决定对这两个发行版用于服务器时做个比较。
### 概览
| ![CentOS](https://thishosting.rocks/wp-content/uploads/2017/01/centos-logo-50.png.webp) CentOS | ![Ubuntu](https://thishosting.rocks/wp-content/uploads/2017/01/ubuntu-logo-50.png.webp) Ubuntu |
| --- | --- |
| 基于 Red Hat Linux Enterprise | 基于 Debian |
| 更新频度较少 | 经常更新 |
| 更稳定和更安全一些,因为不经常更新。 | 更新的软件包可能不稳定,不安全?不会,因为他们在发布到正式版本前进行了大量测试。 |
| 没有足够的教程和用户群较少LCTT 译注:可能是由于国内外情况不同,在国内,相对 Ubuntu 来说,人们更喜欢用 CentOS 做服务器) | 丰富的文档,活跃的社区和大量的在线教程|
| 对初学者困难,因为基于 Red Hat 桌面发行版不流行 | 更容易为已经熟悉桌面版 Ubuntu 的初学者使用|
| 支持 cPanel | 不支持 cPanel |
| .rpm 软件包和 “yum” 软件包管理器 | .deb 软件包和 “apt-get” 软件包管理器 |
| 在 [DigitalOcean][1] 免费试用 CentOS 服务器 | 在[DigitalOcean][2] 免费试用 Ubuntu 服务器 |
### 哪个更适合新手?
Ubuntu。
一如往常那样它主要取决于你的需求和以前的经验但一般来说Ubuntu 对于初学者来说是更好的选择。主要是因为这两个原因:
* Ubuntu 有一个庞大的社区,随时可以免费提供帮助。我指的是真正的大。数以千计的用户分布在数百个不同的在线论坛和兴趣组内。甚至有现实生活中的大会。你也可以为 CentOS 找到很多教程和帮助,特别是对于简单的 LAMP 栈和流行的应用程序而言。
* Ubuntu 服务器对于以前使用过 Ubuntu 桌面的人来说会容易得多。同样的情况也存在于 CentOS 和 Fedora 之间,但是 Ubuntu 桌面版比任何其他基于 Linux 的家用桌面更受欢迎。
所以,如果你是一个初学者,而且没有任何特殊要求,那就去使用 Ubuntu 服务器。 更好的是,你可以从一个[便宜的托管服务提供商][4]那购买服务,这样你就可以在你的服务器上进行实验,还有一个[专业的 24/7 支持团队][7]准备好帮助你。
### 哪个更适合商用?
CentOS。
同样,你仍然可以使用 Ubuntu 作为商用网站或公司内部服务器,但 CentOS 有它的优势:
* CentOS可以说更稳定以及更安全。由于 CentOS 的更新频率较低,这意味着软件测试的时间更长,并且只有真正稳定的版本才会得到发布。如果你使用 CentOS你不会因新的有 bug 的应用程序版本而遇到任何稳定性问题,因为你不会得到那个新的有 bug 的版本。
* 大多数控制面板(包括最受欢迎的控制面板 - cPanel仅支持 CentOS。所以这意味着如果你是一个网站托管公司或者如果你是一个有很多客户的网站服务代理商并且需要一个控制面板 - CentOS 是一个更好的选择。
### 尝试一下它们并选择一个
如果你还是不能决定,你可以免费试试它们。你可以在本地安装或使用 live 镜像。你还可以从 [Vultr][6] 和 [DigitalOcean][7] 这样的地方买到便宜的 VPS$5/月)。你可以在几秒钟内启动 CentOS/Ubuntu 服务器。当你通过推广链接(如我们的)注册,你可能会得到免费金额 - 这意味着你会真的可以免费试用。
### 哪个更快?
它们在速度方面是相同的。它们和运行在你自己的硬件上一样快。它们将如你配置的一样快。不管怎样,你都应该正确配置并且保护所有的服务器、配置和应用程序。
你会使用哪个发行版?想告诉我们你是哪个发行版的拥趸么?请随时留下评论。
--------------------------------------------------------------------------------
**文末评论**
W. Anderson
> 我的大多数 Linux 服务器部署都是针对企业客户的,所以我对文章作者以 GUI 客户端版本来反映任何服务器的管理功能感到困惑。通常,许多服务提供商也会在 CentOS、Ubuntu或经常部署的 OpenSuse Leap 和 FreeBSD 10+ 服务器操作系统上提供 WebMin、VirtualAdmin 或类似工具作为控制面板即使是在虚拟专用服务器VPS环境中。
> CentOS 在许多商业应用以及高级网络/虚拟化和云计算环境方面具有明显优于 Ubuntu 的优势,并且 CentOS 充分利用 SELinux 框架用于加强的安全层,而目前在 Ubuntu 中则不可用(或不容易)。
> 这种类型的比较通常是多余的,因为几乎总是有特定的和细微的要求,和需要服务器实现的需求,这将决定哪个发行版具有更多的优势或用途 - 基于技术专家/托管公司的专业知识和广泛的经验。
VAN DER BEKEN
> 正确的比较应该是对 Debian 和 CentOS 进行比较。
> 以我的经验,我使用 CentOS 和 Debian 作为服务器,稍微偏爱 Debian 一点点,因为它的社区。
--------------------------------------------------------------------------------
via: https://thishosting.rocks/centos-vs-ubuntu-server/
作者:[W. Anderson][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://thishosting.rocks/centos-vs-ubuntu-server/
[1]:https://thishosting.rocks/go/digitalocean/
[2]:https://thishosting.rocks/go/digitalocean/
[3]:https://thishosting.rocks/how-to-choose-web-hosting/
[4]:https://thishosting.rocks/best-cheap-managed-vps/
[5]:https://thishosting.rocks/support/
[6]:https://thishosting.rocks/go/vultr/
[7]:https://thishosting.rocks/go/digitalocean/

View File

@ -0,0 +1,32 @@
是时候抛弃 Skype 和 TeamSpeak 了, Discord 为 Linux 用户发布了应用
============================================================
### 程序已经在 Ubuntu Linux 和其他发行版上可用了
在 2016 年 1 月 11 日发布的一则非常简短的声明中,[Discord][1] 公司发布了首个 Linux 平台的稳定版本,它是一款给玩家开发的流行、免费的、安全一体化的语音和文字聊天程序。
Linux 是他们补足全平台桌面设备和移动设备服务支持的缺失的一块。Discord 目前可用于 Android、iOS、Mac和 Windows但你也可以使用兼容的网络浏览器直接在网络上使用它。
该应用程序似乎是微软 Skype VoIP 客户端,以及著名的 TeamSpeak 语音通信平台的直接竞争对手。它提供了广泛的功能,包括 IP 和 DDoS 保护,游戏内叠加,智能推送通知,单独音量控制,支持多个通道和现代化的文字聊天。
Discord 其他值得注意的功能包括支持编解码器、权限和自定义键盘快捷键、直接消息系统和朋友列表。它还承诺尽可能减少 CPU 使用率,为音频和自动故障转移功能提供低延迟支持。
### 在 Ubuntu 上安装 Discord
官方 Discord 的第一个 Linux 稳定版本(版本 0.0.1)目前以二进制软件包[提供][2],支持 Debian 和基于 Ubuntu 的发行版(例如 Ubuntu、Debian、Linux Mint 等)。但是要安装它,你需要一个 64位系统。
如果你没有运行一个基于 Debian 或 Ubuntu 的操作系统,还有一个源码 tarball 可供下载,但你必须自行编译它。目前 Discord 0.0.1 已经进入 Arch Linux AUR 仓库了,并且很快也会到 Solus 中。其他发行版可能在未来几周内向其仓库添加 Discord。
--------------------------------------------------------------------------------
via: http://news.softpedia.com/news/it-s-time-to-ditch-skype-and-teamspeak-discord-launches-its-app-for-linux-users-511753.shtml
作者:[Marius Nestor][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://news.softpedia.com/editors/browse/marius-nestor
[1]:https://discordapp.com/
[2]:https://discordapp.com/download

View File

@ -0,0 +1,100 @@
3 个针对高级用户的 Vim 编辑器实用技巧
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/vim-featured.jpg "3 Useful VIM Editor Tips and Tricks for Advanced Userss")
这篇文章是[ Vim 用户指南][12]系列文章中的一篇:
* [Vim 初学者入门指南][3]
* [Vim 快捷键速查表][4]
* [5 个针对有经验用户的 Vim 技巧][4]
* 3 个针对高级用户的 Vim 编辑器实用技巧
毫无疑问, Vim 是一个很强大的文本编辑器。它提供了大量的特性,这意味着学习并记住 Vim 的所有功能实际上是不可能的。但是我们至少可以不断学习简单的方法来完成事情,从而随着时间的增长,我们使用编辑器的经验将会变得更好。
请记住,在这篇文章中我们将讨论的一些 Vim 编辑器技巧是针对高级用户的。
**注**:如果你是第一次接触 Vim你可以首先阅读我们的[入门指南][14]。对于已经使用过 Vim 编辑器的用户,我确信[ Vim 快捷键速查表][15]将会对你很有帮助。如果你已经是一名有经验的用户,你可能对[一些针对有经验用户的技巧][16]比较感兴趣。
请注意文中提到的所有技巧绝大多数都是在简单、易于理解的代码环境中进行阐述的,因为它们在软件开发中确实很实用。但这并不意味着普通用户(非程序员、没有把 Vim 作为一般的文本编辑器)在他们的工作中用不到。
### 1、为文件设置特定的变量
有时候,在一个特定文件中,你可能想把输入的制表符用空格代替,或者想要把源代码文件使用两个空格缩进,即便编辑器的默认缩进是四个空格。
基本上我们在这儿讨论对针对文件的的更改。 Vim 提供的这个特性允许你对一个指定的文件更改特定的设置。这个特性叫做 “模式行Modeline” 。
比如如果你想把输入的每一个制表符Tab用空格代替那么你只需要在文件的前几行或最后几行加入下面的模式行
```
# vim: set expandtab:
```
如果想把默认缩进从 4 个空格变成 2 个空格,可以在源文件中添加下面的模式行:
```
// vim: noai:ts=2:sw=2
```
在使用模式行时,请记住下面这几个重要的点:
* 模式行只能添加在文件中的前五行或者最后五行。
* 为了使用模式行这个特性,必须在 `.vimrc` 文件中添加 `:set modeline`
* 在以 root 用户身份对文件进行编辑的时候该特性失效。
了解更多的信息,请阅读该特性的[官方文档][17]。
### 2、 关键字补全
当你开始写的复杂代码越来越多或者开始在一个大的源文件上编辑时,你会遇到一些变量名字。有时,要记住所有的变量名字不太容易,所以当需要输入变量名字的时候,你通常从已经使用过的地方复制过来。
幸运的是,使用 Vim 你只需要输入变量的几个起始字母即可。在’插入模式’中,按 `Ctrl + n` 或者 `Ctrl + p` 可以得到一个匹配的关键词列表。 `Ctrl + n` 用来插入下一个匹配词; `Ctrl + p` 给出一个之前匹配的关键词列表。
下图是该特性的一个展示:
![vim-keyword-completion1](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/vim-keyword-completion1.jpg "vim-keyword-completion1")
正如上面的屏幕截图清晰展示的那样,列表中也会出现其他源文件中包含的词。关于该特性的更多信息,请访问[这儿][18]。
### 3、 搜索
假设你正在调试代码,其中一个需要做的工作是快速查看一个变量在一个文件中所有出现的地方。一个常用的方法是退出‘插入模式’,输入 `/[变量名字]` 命令,按回车 ,然后返回‘插入模式’,使用 `n``p` 在关键字之间导航。
上面讲到的这种方法没毛病,但是还有一种更简单、更快捷的方法可以来完成这样的搜索。使用这种方法,首先你需要退出‘插入模式’,然后把光标移动到你想要搜索的词/变量下面,这并不费时。接下来,你只需要按 `Shift + *` 即可。
重复这样做,然后编辑器将会带你找到在文件中所有使用了这个词/变量的地方。
### 结论
尽管是针对高级用户,但文章中讨论的这些技巧并不难理解,也比较容易使用。如果你具有一定的基础,那么你能够从中获益很多。不必多说,无论是任何新特性或观念,你需要勤于练习这些技巧才能够把它们变成一种习惯。
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
作者:[Himanshu Arora][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/himanshu/
[2]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/#respond
[3]:https://www.maketecheasier.com/start-with-vim-linux/
[4]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[5]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-advanced-users%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-advanced-users%2F&text=3+Useful+VIM+Editor+Tips+and+Tricks+for+Advanced+Users
[9]:mailto:?subject=3%20Useful%20VIM%20Editor%20Tips%20and%20Tricks%20for%20Advanced%20Users&body=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-advanced-users%2F
[10]:https://www.maketecheasier.com/opt-out-google-personalized-ads/
[11]:https://www.maketecheasier.com/wi-fi-vs-ethernet-vs-4g/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343
[14]:https://www.maketecheasier.com/start-with-vim-linux/
[15]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[16]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[17]:http://vim.wikia.com/wiki/Modeline_magic
[18]:http://vim.wikia.com/wiki/Any_word_completion

View File

@ -0,0 +1,96 @@
让 sudo 在你输入错误的密码时“嘲讽”你
============================================================
**sudoers** 是 Linux 中的默认 sudo 安全策略插件,但是经验丰富的系统管理员可以自定义安全策略以及输入输出日志记录的插件。它由 `/etc/sudoers` 这个文件驱动,或者也可在 LDAP 中。
你可以在上面的文件中定义 **sudoers** <ruby>嘲讽<rt>insults</rt></ruby> 或其他选项。它在 `defaults` 部分下设置。请阅读我们的上一篇文章[在 Linux 中设置 `sudo` 时 10 个有用的 sudoers 配置][1]。
在本文中,我们将解释一个 sudoers 配置参数,以允许个人或系统管理员设置 [sudo 命令][2],当系统用户输入错误密码时“嘲讽”他们。
首先打开文件 `/etc/sudoers`,如下所示:
```
$ sudo visudo
```
进入 `defaults` 部分,并添加下面的行:
```
Defaults insults
```
下面是我系统中 `/etc/sudoers` 默认展示的 `defaults` 部分。
[
![Set sudo Insults Parameter](http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-Insults-Parameter.png)
][3]
*设置 sudo insults 参数*
从上面的截图中,你可以看到 `defaults` 中还有许多其他默认值定义,例如,每次用户输入错误的密码时发送邮件到 root、设置安全路径、配置自定义 sudo 日志文件等。
保存并关闭文件。
运行 `sudo` 命令并输入错误的密码,然后观察 insults 选项是如何工作的:
```
$ sudo visudo
```
[
![sudo Insult in Action](http://www.tecmint.com/wp-content/uploads/2017/01/How-sudo-Insult-Works.png)
][4]
*实践 sudo insult*
**注意**:当配置 insults 参数时,它会禁用 `badpass_message` 参数,该参数在用户输入错误的密码时,会在命令行中输出特定的消息(默认消息为 “**sorry, try again**”)。
要修改该消息,请将 `badpass_message` 参数添加到 `/etc/sudoers` 文件中,如下所示。
```
Defaults badpass_message="Password is wrong, please try again" #try to set a message of your own
```
[
![Set sudo badpassword Message](http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-badpassword-Message.png)
][5]
*设置 sudo 错误密码消息*
保存并关闭文件,然后调用 `sudo` 查看它是如何工作的,你设置的 `badpass_message` 消息会在每次你或任何系统用户输入错误的密码的时候打印出来。
```
$ sudo visudo
```
[
![Sudo badpassword Message](http://www.tecmint.com/wp-content/uploads/2017/01/sudo-badpassword-Message.png)
][6]
*sudo 密码错误消息*
就是这样了,在本文中,我们回顾了如何在用户输入错误的密码时将 `sudo` 设置为显示嘲讽。请通过下面的评论栏分享你的想法。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin、web 开发人员,目前是 TecMint 的内容创建者,他喜欢用电脑工作,并坚信分享知识。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/sudo-insult-when-enter-wrong-password/
作者:[Aaron Kili][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/
[2]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-Insults-Parameter.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/How-sudo-Insult-Works.png
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-badpassword-Message.png
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/sudo-badpassword-Message.png

View File

@ -0,0 +1,31 @@
你现在可以下载包含所有风味的 Ubuntu 16.10 的单独 ISO 镜像了
======================================
Linux AIO 开发商 Željko Popivoda 通知说可以下载 Linux AIOAll-in-OneUbuntu 16.10 Live DVD 了,该 DVD 包含所有主要的 Ubuntu 16.10 风味flavor版本。
如果你梦想有一个可以写在 USB 或 DVD 光盘上的单独 ISO 镜像,然后在需要时启动某个 Ubuntu Linux 操作系统(如 Ubuntu、Kubuntu、Xubuntu、Lubuntu 或者 Ubuntu MATE现在你就可以用 Linux AIO Ubuntu 16.10 做到了。
[Linux AIO][1] 团队以开发这种完全免费的多发行版 ISO 镜像而闻名,而 Linux AIO Ubuntu 16.10 有两个版本,分别用于 64 位和 32 位平台,里面有 Ubuntu 16.10、Kubuntu 16.10、Xubuntu 16.10、Lubuntu 16.10、Ubuntu MATE 16.10 和 Ubuntu GNOME 16.10。
这些都是未修改的官方发行版。Linux AIO 团队把它们都放在一个易于使用的单一容器中,例如,当你在客户那,你需要向他/她展示各种基于 Linux 的操作系统来选择,你就不必带来六个不同的 U 盘或 DVD 光盘。
### 包含了硬件和内存测试工具
两种 Linux AIO Ubuntu 16.10 都附带两个重要的实用程序,即 HDT硬件检测工具用于查看目标计算机上是否与各个同 Ubuntu 16.10 流派完全兼容,还有 Memtest86+,这是一个非常流行的命令行工具,用于测试系统内存错误并验证其完整性。
[Linux AIO Ubuntu 16.10 现在可以下载了][2],但请记住,由于托管文件的 SourceForge 服务器的存储限制,镜像被分为两个 .7z 存档,你需要下载并解压缩以获取可用的 ISO。
我们曾经被许多读者问过 Linux AIO Live DVD 是否支持 UEFI ,答案仍然是没有,但是团队正在努力实现未来对 UEFI 的支持。还请查看最近发布的 Linux AIO Ubuntu Mixture 2017.01。
--------------------------------------------------------------------------------
via: http://news.softpedia.com/news/you-can-now-have-a-single-iso-image-with-all-essential-ubuntu-16-10-flavors-exclusive-511788.shtml
作者:[Marius Nestor][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://news.softpedia.com/editors/browse/marius-nestor
[1]:http://linuxaio.net/
[2]:http://linux.softpedia.com/get/Linux-Distributions/Ubuntu-AIO-DVD-103429.shtml

View File

@ -0,0 +1,99 @@
给 Linux 新手的最佳发行版
============================================================
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/distros-new-users.jpg?itok=Prp88H71)
Jack Wallen 为来自不同环境的新手们挑选出专门为他们设计的发行版。[CC0][5]社区。
一个很古老的问题,找到适合的 Linux 发行版比简单的指出哪种 Linux 版本受欢迎更重要。为什么这么说?
让我们设置一个情景:你有一位用户,很有可能,他过去大多数时候都是在 Windows 或者 Mac 系统上工作,他们想让你给他们一个选择的替代品。现在,你想要在很短的时间里直截了当的说明 Linux 系统的工作方式并突出它的强大性和灵活性。
但是,请记住,最重要的一个方面是他们必须能够 _get it_,即开箱即用。
这就是为什么我们经常需要花费时间来找出哪种版本是最适合新手的 -- 因为把新手们带入 Linux 系统是传播 Linux 并增加 Linux 用户的最好方式。
对于新手来说最好的版本是什么?这次,我将要花费一定时间来说明对于来自不同环境的用户哪种版本才是最适合的。此外,你也可以查看我在 [2017 最好的发行版][11]中列出的发行版。
### 从 Windows 7 到 LinuxZorinOS
当 Windows 8 发布以后,有一个理由让如此多的用户依然坚持使用 Windows 7 那就是熟悉度。用户们已经在相同的桌面环境上工作了十几年,他们不想转移到 Windows 8 这种更以触摸屏为主的平台上。所以,你会去选择哪种版本呢?你首先必须要考虑的是桌面环境。为什么?因为这是你能够立刻吸引上这些 Windows 7 用户的地方。对于这个任务,还有什么版本会比 [ZorinOS][13] 更好呢?
ZorinOS 就是专门作为 Windows 和 Mac 系统的替代品而设计的,所以它下了很大的功夫来模仿 Windows 和 Mac 桌面的外观和感觉。事实上,除了 ZorinOS 以外,你很难找到一个别的 Linux 版本,能够完美的从 Windows 7 转移到 Linux 系统上,同时保留 Linux 系统如此强大、灵活的平台。
除了桌面环境(图片 1以外 因为 ZorinOS 完全基于 Ubuntu 系统,所以在其“外表”下面, ZorinOS 和 Ubuntu 以同样的方式工作(所以基本不用去担心硬件不能够被检测到)。同时伴有已经就绪的软件,你便有了针对来自 Windows 7 用户的最完美的 Linux 版本。
![ZorinOS](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/zorinos.jpg?itok=i970f1Id "ZorinOS")
*图片 1类 Windows 7 的 ZorinOS 桌面,准备开始服务。[使用许可][1]*
请注意:然而, ZorinOS 有两个版本: Zorin Ultimate 和 Zorin Core 。 Zorin Core 是免费的,但它不包含几乎所有你能够在 Zorin Ultimate 中找到的软件。如果你想要一个适合于所有来自 Windows 7 用户的开箱即用的版本,那么我强烈推荐购买 [Zorin Ultimate][14](大约需要花费 20 美元)。当然,如果你不想花钱购买 Ultimate 版本,你也可以从 Core 版本包含的软件包管理工具中安装几乎所有你需要的东西。
### 从 Windows 8 到 Linux Ubuntu GNOME
让我们来看看 Windows 8 它带来了一个以触摸屏为中心的环境,改变了用户与电脑互动的方式。老式的启动菜单、面板、系统托盘桌面已经被触摸屏环境界面所取代。如果你正在找一个能给 Linux 新手们带来不同体验的最好环境,同时功能也要是最好的,那么没有比 [Ubuntu GNOME][16] 更合适的了。
Ubuntu GNOME 是 Ubuntu 和 GNOME图 2这两个世界之间最好的融合。用一个现代、优雅、简洁并且用户友好的桌面代替了 Unity 界面, 因此 Ubuntu GNOME 不会给任何来自 Windows 8 的用户造成太多的麻烦。该版本不仅基于最新的长期支持版的 Ubuntu 发行版(支持期会很长),同时使用了 GNOME 桌面的最新稳定版本 这意味着用户将能够享受到难以置信的稳定体验。
![Ubuntu GNOME](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ubuntugnome.jpg?itok=SNjA3y7T "Ubuntu GNOME")
*图片 2 :在 Ubuntu GNOME 中可以发现,在优雅而又简洁。 [使用许可][2]*
### 从 Mac 到 Linux Elementary OS
毫无疑问,这一场的绝对赢家是 [Elementary OS][17]。尽管 Elementary OS 在外观和感觉上所达到的效果和 OS X 桌面非常相似,但实际还有更多优秀的地方。 Elementary OS 同样是基于 Linux 系统的,只不过是它采取了很多 Mac X 桌面的设计元素。
任何的 Mac 用户使用 Elementary OS 的桌面环境(图片 3都会感觉就像是“在家一样”使用 Mac 一样)。伴有如此熟悉的文档,同时包含一个熟悉的应用菜单, Elementary OS 总是位于我的‘最佳发行版列表’的顶部。如果我们正在和 Mac 用户讨论迁移,那么没有比 Elementary OS 更好的 Mac 替代品了。
![Elementary OS](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elementaryos.jpg?itok=qaXRClRM "Elementary OS")
*图片 3 Elementary OS 桌面的荣耀。[使用许可][3]*
有一件事情 Mac 用户们将会非常感激,那就是 Elementary OS 的开发者们很好的保持了桌面的一致性。从 dock 到面板、菜单、到包括的应用,你找不到任何一个看起来或感觉没有归属感的单一元素。
我将在这儿说一个关于 Elementary OS 的预警。你需要安装一个好的浏览器(因为它自带安装的 Epiphany-a 浏览器没有得到许多常用站点的支持),同时,你需要从官方的 [LibreOffice 网站][18]下载安装包来安装 LibreOffice (因为在 Elementary OS 的软件中心找到的安装包已经有些过时了)。
### 从 Android 到 LinuxUbuntu
这似乎有点像是一个延伸话题,但考虑到 Android 在全球市场中占主导地位,所以你可能遇到一个来自以移动设备为中心的用户,他可能需要一个 Linux 桌面,从而让他一直感觉像是‘在家’一样。对于我来说, [Ubuntu][19] 是最显然的赢家。为什么?和其他系统相比, Ubuntu Unity 在桌面上做出了很杰出的工作,它使得桌面感觉像是一个包罗万象的界面。如果你愿意,那么可以包含在线搜索结果(默认情况下禁用),这是在几乎每个移动环境中均可找到的东西。同样, Unity HUD 菜单系统(图片 4是在任何界面系统中所能找到的最独一无二的菜单系统之一。通过 Unity HUD 菜单系统,用户可以更少的依赖鼠标(就像他们过去在 Android 支持的移动设备上工作一样)。
![Ubuntu Unity](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ubuntu.jpg?itok=HsvBJAIN "Ubuntu Unity")
*图片 4 使用中的 Unity HUD 。[使用许可][4]*
当然, Ubuntu 也提供了市场上最稳定的桌面平台,所以用户体验近乎完美。
### 总有一款 Linux 发行版适合你
有一件很重要的事情需要记住,那就是总有一款 Linux 发行版适合你。但是对于那些来自特殊环境的人,我强烈推荐找到一个最喜爱的 Linux 版本,从而能够帮助他们无缝过渡。给自己一个机会尝试一下,看看你是否可以轻松体验到开源和 Linux 的强大。
--------------------------------------------------------------------------------
via: https://www.linux.com/news/best-linux-distributions-new-users
作者:[JACK WALLEN][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/jlwallen
[1]:https://www.linux.com/licenses/category/used-permission
[2]:https://www.linux.com/licenses/category/used-permission
[3]:https://www.linux.com/licenses/category/used-permission
[4]:https://www.linux.com/licenses/category/used-permission
[5]:https://www.linux.com/licenses/category/creative-commons-zero
[6]:https://www.linux.com/files/images/zorinosjpg
[7]:https://www.linux.com/files/images/ubuntugnomejpg
[8]:https://www.linux.com/files/images/elementaryosjpg-1
[9]:https://www.linux.com/files/images/ubuntujpg
[10]:https://www.linux.com/files/images/distros-new-usersjpg
[11]:https://www.linux.com/news/learn/sysadmin/best-linux-distributions-2017
[12]:http://bit.ly/2jJgK0Q
[13]:https://zorinos.com/
[14]:https://zorinos.com/download/#ultimate
[15]:https://training.linuxfoundation.org/certification/lfcs?utm_source=linux-inline-ad&utm_campaign=new-users-2017&utm_medium=online-advertising&utm_content=new-year
[16]:https://ubuntugnome.org/
[17]:https://elementary.io/
[18]:http://www.libreoffice.org/download/libreoffice-fresh/
[19]:https://www.ubuntu.com/

View File

@ -0,0 +1,231 @@
Linux I/O 重定向基础
============================================================
Linux 管理的一个最重要并且[有趣的话题][4]是 I/O 重定向。此功能在命令行中使你能够将命令的输入输出取自或送到文件中,或者可以使用管道将多个命令连接在一起以形成所谓的“**命令管道**”。
我们运行的所有命令基本上产生两种输出:
- 命令结果 - 程序产生的数据,以及
- 程序状态和错误消息,用来通知用户程序的执行细节。
在 Linux 和其他类 Unix 系统中,有三个默认文件(名称如下),这些文件也由 shell 使用文件描述符号标识:
- stdin 或 0 - 它连接键盘,大多数程序从此文件读取输入。
- stdout 或 1 - 它连接屏幕,并且所有程序将其结果发送到此文件
- stderr 或 2 - 程序将状态/错误消息发送到此文件,它也连接到屏幕上。
因此I/O 重定向允许你更改命令的输入源以及将输出和错误消息发送到其他地方。这可以通过 `<``>` 重定向操作符来实现。
### 如何在 Linux 中重定向标准输出到文件中
如下面的示例所示,你可以重定向标准输出,这里,我们要存储 [top 命令][5]的输出以供以后检查:
```
$ top -bn 5 >top.log
```
其中标志的含义:
- `-b` - 让 `top` 以批处理模式运行,以便你可以将其输出重定向到一个文件或另一个命令。
- `-n` - 指定命令终止前的迭代次数。
你可以使用 [cat 命令][6]来查看 `top.log` 文件的内容:
```
$ cat top.log
```
要将命令输出**附加**在文件后面,请使用 `>>` 操作符。
例如,要将 [top 命令][7]的输出追加在上面的 `top.log` 文件中,特别是在脚本(或命令行)中,请输入下面的那行:
```
$ top -bn 5 >>top.log
```
**注意** 也可以使用文件描述符数字,上面的重定向命令等同于:
```
$ top -bn 5 1>top.log
```
### 如何在 Linux 中重定向标准错误到文件中
要重定向命令的标准错误,你需要明确指定文件描述符 `2`,以便让 shell 了解你正在尝试做什么。
例如,下面的 [ls 命令][8]将在没有 root 权限的普通系统用户执行时产生错误:
```
$ ls -l /root/
```
你可以重定向标准错误到文件中:
```
$ ls -l /root/ 2>ls-error.log
$ cat ls-error.log
```
[
![Redirect Standard Error to File](http://www.tecmint.com/wp-content/uploads/2017/01/Redirect-Standard-Error-in-Linux.png)
][9]
*重定向标准错误到文件中*
为了将标准错误附加在文件后,使用下面的命令:
```
$ ls -l /root/ 2>>ls-error.log
```
### 如何重定向标准输出及标准错误到一个文件中
还可以将命令的所有输出(包括标准输出和标准错误)捕获到单个文件中。这可以用两种可能的方式,通过指定文件描述符来完成:
1、 第一种是相对较旧的方法,其工作方式如下:
```
$ ls -l /root/ >ls-error.log 2>&1
```
上面的命令意思是 shell 首先将 [ls 命令][10]的输出发送到文件 `ls-error.log`(使用 `>ls-error.log`),然后将所有写到文件描述符 `2`(标准错误)的错误消息重定向到文件 `ls-error.log`(使用`2>1`中。LCTT 译注:此处原文有误,径改。)这表示标准错误也被发送到与标准输出相同的文件中。
2、 第二种并且更直接的方法是:
```
$ ls -l /root/ &>ls-error.log
```
你也可以这样将标准输出和标准错误附加到单个文件后:
```
$ ls -l /root/ &>>ls-error.log
```
### 如何将标准输入重定向到文件中
大多数(如果不是全部)命令从标准输入获得其输入,并且标准输入默认连接到键盘。
要从键盘以外的文件重定向标准输入,请使用 `<` 操作符,如下所示:
```
$ cat <domains.list
```
[
![Redirect Standard Input to File](http://www.tecmint.com/wp-content/uploads/2017/01/Redirect-Standard-Input-to-File.png)
][11]
*重定向文件到标准输入中*
### 如何重定向标准输入/输出到文件中
你可以如下在 [sort 命令中][12] 同时执行标准输入、标准输出的重定向:
```
$ sort <domains.list >sort.output
```
### 如何使用管道进行 I/O 重定向
要将一个命令的输出重定向为另一个命令的输入,你可以使用管道,这是用于构建复杂操作命令的有力方法。
例如,以下命令将[列出最近修改的前五个文件][13]。
```
$ ls -lt | head -n 5
```
选项的意思是:
- `-l` - 启用长列表格式
- `-t` - [最新修改的文件][1]首先显示
- `-n` - 指定要显示的标题行数
### 构建管道的重要命令
在这里,我们将简要回顾一下构建命令管道的两个重要命令,它们是:
`xargs` 用于从标准输入构建和执行命令行。下面是使用 `xargs` 的管道示例,此命令用于[将文件复制到 Linux 中的多个目录][14]
```
$ echo /home/aaronkilik/test/ /home/aaronkilik/tmp | xargs -n 1 cp -v /home/aaronkilik/bin/sys_info.sh
```
[
![Copy Files to Multiple Directories](http://www.tecmint.com/wp-content/uploads/2017/01/Copy-Files-to-Multiple-Directories.png)
][15]
*复制文件到多个目录*
选项含义:
- `-n 1` - 让 `xargs` 对每个命令行最多使用一个参数,并发送到 [cp命令][2]
- `cp` - 复制文件
- `-v` - [显示 `cp` 命令的进度][3]。
有关更多的使用选项和信息,请阅读 `xargs` 手册页:
```
$ man xargs
```
`tee` 命令从标准输入读取,并写入到标准输出和文件中。我们可以演示 `tee` 如何工作:
```
$ echo "Testing how tee command works" | tee file1
```
[
![tee Command Example](http://www.tecmint.com/wp-content/uploads/2017/01/tee-command-example.png)
][16]
*tee 命令示例*
[文件或文本过滤器][17]通常与管道一起用于[有效地操作 Linux 文件][18],来以强大的方式来处理信息,例如命令的重组输出(这对于[生成有用的 Linux 报告][19]是必不可少的)、修改文件中的文本和其他的 [Linux 系统管理任务][20]。
要了解有关 Linux 过滤器和管道的更多信息,请阅读这篇文章[查找前十个访问 Apache 服务器的 IP 地址][21],这里展示了使用过滤器和管道的一个例子。
在本文中,我们解释了 Linux 中 I/O 重定向的基本原理。请通过下面的反馈栏分享你的想法。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin、web 开发人员,目前是 TecMint 的内容创建者,他喜欢用电脑工作,并坚信分享知识。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/linux-io-input-output-redirection-operators/
作者:[Aaron Kili][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/find-and-sort-files-modification-date-and-time-in-linux/
[2]:http://www.tecmint.com/progress-monitor-check-progress-of-linux-commands/
[3]:http://www.tecmint.com/monitor-copy-backup-tar-progress-in-linux-using-pv-command/
[4]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/
[5]:http://www.tecmint.com/12-top-command-examples-in-linux/
[6]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/
[7]:http://www.tecmint.com/12-top-command-examples-in-linux/
[8]:http://www.tecmint.com/tag/linux-ls-command/
[9]:http://www.tecmint.com/wp-content/uploads/2017/01/Redirect-Standard-Error-in-Linux.png
[10]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/
[11]:http://www.tecmint.com/wp-content/uploads/2017/01/Redirect-Standard-Input-to-File.png
[12]:http://www.tecmint.com/sort-command-linux/
[13]:http://www.tecmint.com/find-recent-modified-files-in-linux/
[14]:http://www.tecmint.com/copy-file-to-multiple-directories-in-linux/
[15]:http://www.tecmint.com/wp-content/uploads/2017/01/Copy-Files-to-Multiple-Directories.png
[16]:http://www.tecmint.com/wp-content/uploads/2017/01/tee-command-example.png
[17]:http://www.tecmint.com/linux-file-operations-commands/
[18]:http://www.tecmint.com/linux-file-operations-commands/
[19]:http://www.tecmint.com/linux-performance-monitoring-and-file-system-statistics-reports/
[20]:http://www.tecmint.com/automating-linux-system-administration-tasks/
[21]:http://www.tecmint.com/find-top-ip-address-accessing-apache-web-server/

View File

@ -0,0 +1,97 @@
为你在 Bash 历史中执行过的每一项命令设置时间和日期
============================================================
在默认情况下,所有通过 Bash 在命令行中执行过的命令都被存储在历史缓存区或者一个叫做 `~/.bash_history` 的文件里。这意味着系统管理员可以看到系统上用户执行过的命令清单,或者用户可以通过像 [history 命令][1]这样的选项来看他或她自己的命令历史。
```
$ history
```
[
![Linux History Command](http://www.tecmint.com/wp-content/uploads/2017/01/Linux-History-Command.png)
][2]
*Linux 历史命令*
从上面 [history 命令][3]的输出可知,命令被执行的日期和时间并没有显示出来。基本上所有的 Linux 发行版的默认设置都是这样的。
在这篇文章里,我们将解释当在 Bash 中执行 `history` 命令显示每个命令时,如何配置显示时间戳信息。
每个命令相关的日期和时间可以记录到历史文件中,用 `HISTTIMEFORMAT` 环境变量的设置作为命令历史的备注记录。
这里有两种可行的方式来达到目的:一种是暂时的效果,一种是永久的效果。
要临时设置 `HISTTIMEFORMAT` 环境变量,在命令行这样输出它:
```
$ export HISTTIMEFORMAT='%F %T'
```
在上面的输出命令当中,时间戳格式如下:
1、`F`-展开为完整日期,即 `Y-m-d`(年-月-日)。
2、`T`-展开为时间,即 `H:M:S`(时:分:秒)。
通读 [date 命令][4]的 man 手册来获得更多使用说明:
```
$ man date
```
然后如下检查你的命令历史:
```
$ history
```
[
![Display Linux Command History with Date and Time](http://www.tecmint.com/wp-content/uploads/2017/01/Set-Date-and-Time-on-Linux-Commands-History.png)
][5]
*显示带有日期和时间的 Linux 命令历史。*
LCTT 译注:注意:这个功能只能用在当 HISTTIMEFORMAT 这个环境变量被设置之后,之后的那些新执行的 bash 命令才会被打上正确的时间戳。在此之前的所有命令,都将会显示成设置 HISTTIMEFORMAT 变量的时间。)
然而,如果你想永久地配置该变量,用你最喜欢的编辑器打开文件 `~/.bashrc`
```
$ vi ~/.bashrc
```
然后在下方添加(用注释将其标记为你自己的配置):
```
# 我的配置
export HISTTIMEFORMAT='%F %T'
```
保存文件并退出,然后,运行下面的命令以便改动当即生效:
```
$ source ~/.bashrc
```
就是这些!请通过下方的评论区来与我们分享一些有趣的历史命令的小技巧以及你对这篇文章的想法。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/7badddbc53297b2e8ed7011cf45df0c0?s=128&d=blank&r=g)
我是 Ravi SaiveTecMint 的创建者。一个爱在网上分享的技巧和提示的电脑极客和 Linux 专家。我的大多数服务器运行在名为 Linux 的开源平台上。请在 Twitter、 Facebook 和 Google 等上关注我。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/display-linux-command-history-with-date-and-time/
作者:[Ravi Saive][a]
译者:[Hymantin](https://github.com/Hymantin)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:http://www.tecmint.com/history-command-examples/
[2]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-History-Command.png
[3]:http://www.tecmint.com/history-command-examples/
[4]:http://www.tecmint.com/sort-ls-output-by-last-modified-date-and-time/
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Set-Date-and-Time-on-Linux-Commands-History.png

View File

@ -0,0 +1,45 @@
RISC-V微处理器中的 Linux :它会开启一个开源硬件的文艺复兴么?
============================================================
![](https://irp-cdn.multiscreensite.com/58a25abc/dms3rep/multi/desktop/riscv2-1122x812.png)
我与许多人分享过一个愿景,我们很快就能使用由开源硬件([OSH][1])和开源软件所驱动的现代而强大的设备。
开放硬件是那种有完整的文档,并且可以根据你的需求自由使用、研究、修改和复制的设备。它从原理图到 PCB 布局的所有内容全都是公开的,包括驱动硬件的软件。近年来有所进步,有更多的硬件被开放了,但是我们的 PC 和其它设备中的微处理器却被限制在了桌面端的以 x86 为主导的、封闭的指令集架构([ISA][2]),或者智能手机/平板设备上的 ARM 变体。这两个指令集架构都是闭源的,并且不能用于开放设备。此外,许多广泛使用的 ARM 实现,比如 A9 或 Snapdragon 在这些已经专有的指令集架构上添加了进一步的专有层。
[RISC-V][3] 是不同的。在加州大学伯克利分校的研究人员于 2010 年推出的 RISC-V发音 risk-five是根据同样的初始 [RISC][4]精简指令集计算Reduced Instruction Set Computing CPU 设计构建的,其基础是其它熟悉的指令集架构,如 ARM、MIPS、PowerPC 和 SPARC但目的是开放且不受专利保护注意目前RISC-V 规范仅供私人或教育用途使用计划在将来完全开放。RISC 设计策略与 x86 系列的复杂指令集计算CISC设计相反。
虽然 RISC-V 不是现有唯一的开放指令集架构,但它是唯一一个极速推进的。指导指令集架构的开发和采用的 RISC-V 基金会有一些相当大的捐赠者,如 Oracle、Western Digital、HP、Google、IBM 和 Nvidia。我可以看到名单上缺少的几个著名的芯片制造商。似乎大的玩家们已经意识到与软件一样硬件会在开放下发展得更快更好。而且任何人使用它你都不必付费。因为开发中的困难和成本像这样的项目并没有被更快取得成功。现在一个公开的结果是大的公司正在跟进开发资金正在源源而来。
RISC-V 在学术界也有很多支持。从在伯克利的孵化到在世界范围内超过 35 个大学项目协助其发展,在那里不缺乏聪明的头脑为这个项目工作。
在其背后也有进展。在软件方面,人们正在将程序移植到 RISC-V 上让它启动起来。Fedora 已经移植了成千上万的程序 - 下面是 [Fedora/RISC-V][5] 在 QEMU 中启动:
![](https://irp-cdn.multiscreensite.com/58a25abc/dms3rep/multi/desktop/booting-500x664.gif)
*向 Richard WM Jones 做出这么棒的动画致敬*
在硬件方面人们正在制造开发板。HiFive1 是一个成功众筹的项目,它是来自 SiFive 的一块 Arduino 板,由他们的 FE310 SoC 驱动,这是一块 32 位的 RISC-V 芯片,运行频率为 320+ MHz。 它会在 2 月发货,你可以[在这里][6]预订一个,价格为 $59。
![](https://irp-cdn.multiscreensite.com/58a25abc/dms3rep/multi/desktop/si5-640x457.jpg)
这一切听起来很棒 - 我希望他们能够交付,因为我们都将从中受益非浅。如果可以,请支持这个项目。告诉人们这个东西。购买一块 HiFive1看看它上面运行了什么。我在你的未来看到了这些芯片。
--------------------------------------------------------------------------------
via: https://www.darrentoback.com/can-risc-v-linux-of-microprocessors-start-an-open-hardware-renaissance
作者:[dmt][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.darrentoback.com/about-me
[1]:https://en.wikipedia.org/wiki/Open-source_hardware
[2]:https://en.wikipedia.org/wiki/Comparison_of_instruction_set_architectures
[3]:https://en.wikipedia.org/wiki/RISC-V
[4]:https://en.wikipedia.org/wiki/Reduced_instruction_set_computing
[5]:https://fedoraproject.org/wiki/Architectures/RISC-V
[6]:https://www.crowdsupply.com/sifive/hifive1/

View File

@ -0,0 +1,78 @@
如何知道目录及子目录下文件的数量
============================================================
在本指南中,我们将介绍如何在 Linux 系统上显示当前工作目录或任何目录及其子目录中的文件数量。
我们将使用 [find 命令][6],它用于搜索目录层次结构中的文件,以及 [wc 命令][7],它会打印每个文件或来自标准输入的换行符、单词和字节计数。
以下是我们在 [find 命令][8]中使用的选项,如下所示:
1. `-type` - 指定要搜索的文件类型,在上面的情况下,`f` 表示查找所有常规文件。
2. `-print` - 打印文件绝对路径。
以下是我们 [wc 命令][8]中使用的选项,如下所示:
1. `-l` - 此选项打印换行符的总数,也即由 [find 命令][1]输出的绝对文件路径总数。
`find` 命令的一般语法。
```
# find . -type f -print | wc -l
$ sudo find . -type f -print | wc -l
```
重要:使用 [sudo 命令][9]来读取指定目录中的所有文件,包括具有超级用户权限的子目录中的文件,以避免 “Permission denied” 错误,如下截图所示:
[
![Find Number of Files in Linux](http://www.tecmint.com/wp-content/uploads/2017/01/Find-Number-of-Files-in-Linux.png)
][10]
*Linux 中的文件数量*
你可以看到,在上面的第一个命令中,`find` 命令没有读取当前工作目录中的所有文件。
下面是更多的示例,分别显示 `/var/log``/etc` 目录中的常规文件总数:
```
$ sudo find /var/log/ -type f -print | wc -l
$ sudo find /etc/ -type f -print | wc -l
```
有关 Linux 中 `find``wc` 命令的更多示例,请查看以下系列文章以了解其他使用选项,提示和相关命令:
1. [35 个 Linux 中的 “find” 命令示例][2]
2. [如何在 Linux 中查找最近或今天的修改的文件][3]
3. [在 Linux 中查找十个占用最大的目录和文件][4]
4. [6 个有用的 “wc” 命令示例来计算行数、单词和字符][5]
就是这样了!如果你知道其他任何方法来显示目录及其子目录中的文件总数,请在评论中与我们分享。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin、web 开发人员,目前是 TecMint 的内容创建者,他喜欢用电脑工作,并坚信分享知识。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/find-number-of-files-in-directory-subdirectories-linux/
作者:[Aaron Kili][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/
[2]:http://www.tecmint.com/35-practical-examples-of-linux-find-command/
[3]:http://www.tecmint.com/find-recent-modified-files-in-linux/
[4]:http://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/
[5]:http://www.tecmint.com/wc-command-examples/
[6]:http://www.tecmint.com/35-practical-examples-of-linux-find-command/
[7]:http://www.tecmint.com/wc-command-examples/
[8]:http://www.tecmint.com/find-recent-modified-files-in-linux/
[9]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/
[10]:http://www.tecmint.com/wp-content/uploads/2017/01/Find-Number-of-Files-in-Linux.png

View File

@ -0,0 +1,61 @@
如何在 Linux 中让 sudo 密码会话的超时更长些
============================================================
在最近的文章中,我们向你展示了 在 Linux 中设置 sudo 的十条 sudoers 实用配置][1]以及[让 sudo 在你输入错误的密码时“嘲讽”你][2],在本文中,我们发现了另一个 sudo 贴士,在 Ubuntu Linux 中使 sudo 密码会话(超时)更长或更短。
在 Ubuntu 及其衍生版如 Linux Mint 或任何其他基于 Ubuntu 的发行版中,当你执行 [sudo 命令][3] 时,它将提示你输入管理密码。
在第一次执行 sudo 命令后,默认情况下密码将保持 15 分钟,因此你不需要为每个 sudo 命令键入密码。
如果,你因为某种原因觉得 15 分钟太长或太短,你可以在 `sudoers` 文件中做一个简单的调整。
要设置 sudo 密码超时值,请使用 `passwd_timeout` 参数。首先使用 `sudo``visudo` 命令以超级用户权限打开 `/etc/sudoers` 文件,如下所示:
```
$ sudo visudo
```
接着添加下面的默认值,这意味着 sudo 密码提示将会在用户使用 sudo 20 分钟后过期。
```
Defaults env_reset,timestamp_timeout=20
```
注意:你可以以分钟设置为你所需的任何时间,它会在超时之前一直等待。 如果要为每个执行的 sudo 命令弹出密码提示,你也可以将时间设置为 `0`,或者通过设置值 `-1` 永久禁用密码提示。
下面的截图显示了我在 `/etc/sudoers` 文件中设置的默认参数。
[
![Change sudo Password Timeout](http://www.tecmint.com/wp-content/uploads/2017/01/set-sudo-password-timeout-session.png)
][4]
*改变 sudo 密码超时*
`Ctrl + O` 保存文件,然后使用 `Ctrl + X` 退出。 然后,使用 `sudo` 运行命令并等待 2 分钟以检查密码提示是否超时以测试设置是否正常。
在本篇中,我们解释了如何设置 `sudo` 密码提示超时之前的分钟数,记得在评论栏分享你对这篇文章的想法或者其他[对系统管理员配置有用的 sudo 配置][5]。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin 以及 web 开发人员,目前是 TecMint 的内容创建者,他喜欢用电脑工作,并坚信分享知识。
-----
via: http://www.tecmint.com/set-sudo-password-timeout-session-longer-linux/
作者:[Aaron Kili ][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:https://linux.cn/article-8145-1.html
[2]:https://linux.cn/article-8128-1.html
[3]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/set-sudo-password-timeout-session.png
[5]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/

View File

@ -0,0 +1,81 @@
如何将 Linux 命令的输出赋值给变量
==================================
运行一条命令时,它都会产生某种输出:要么是该命令的期望结果,或者是该命令执行细节的状态/错误消息。有些时候,你可能想要将某个命令的输出内容存储在一个变量中,以待在后续操作中取出来使用。
本文将介绍将 shell 命令赋值给变量的不同方法,这对于 shell 脚本编程是特别有用的。
可以使用如下形式的 shell 命令置换特性,将命令的输出存储到变量中:
```
变量名=$(命令)
变量名=$(命令 [命令选项 ...] 参数1 参数2 ...)
或者:
变量名='命令'
变量名='命令 [命令选项 ...] 参数1 参数2 ...'
```
以下是使用命令置换特性的示例:
本例,我们将 `who` (显示当前登录系统的用户) 的输出值存储到 `CURRENT_USERS` 变量中:
```
$ CURRENT_USERS=$(who)
```
然后,我们可以使用 [echo 命令][1] 显示一个句子并使用上述变量,如下:
```
$ echo -e "以下为登录到系统中的用户:\n\n $CURRENT_USERS"
```
上面的命令中:`-e` 标记表示解释所有的转义序列 (如 `\n` 为换行)。为节约时间和内存,通常在 [echo 命令][2] 中直接使用命令置换特性,如下:
```
$ echo -e "以下为登录到系统中的用户:\n\n $(who)"
```
[![显示当前登录系统的用户](http://www.tecmint.com/wp-content/uploads/2017/01/Shows-Current-Logged-Users-in-Linux.png)][3]
*在 Linux 中显示当前登录系统的用户*
接下来,为了演示上面提到的第二种形式,我们以把当前工作目录下文件数存储到变量 `FILES` ,然后使用 **echo** 来输出,如下:
```
$ FILES=`sudo find . -type f -print | wc -l`
$ echo "当前目录有 $FILES 个文件。"
```
[![显示目中包含文件的数量](http://www.tecmint.com/wp-content/uploads/2017/01/Show-Number-of-Files-in-Directory.png)][4]
*显示目中包含文件的数量*
就是这些了。我们展示了将 shell 命令的输出赋值给变量的方法。你可以在下边的评论反馈区留下你的想法。
---------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili 是一名 Linux 和 F.O.S.S 忠实拥护者、未来的 Linux 系统管理员、Web 开发者,目前是 TecMint 的原创作者,热衷于计算机并乐于知识分享。
译者简介:
![GHLandy](http://GHLandy.com/images/GHLandy.ico)
[GHLandy](http://GHLandy.com) —— 欲得之,则为之奋斗 (If you want it, work for it.)。
------------------------------------------------
via: http://www.tecmint.com/assign-linux-command-output-to-variable/
作者:[Aaron Kili][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/echo-command-in-linux/
[2]:http://www.tecmint.com/echo-command-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Shows-Current-Logged-Users-in-Linux.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Show-Number-of-Files-in-Directory.png

View File

@ -0,0 +1,335 @@
vmstat一个标准的报告虚拟内存统计工具
============================================================
### 什么是 RAM
在智能手机世界,我们每一个人都知道 RAM。因此我不想深入介绍这样我就简要概括下。RAM 代表“随机访问内存”Random Access Memory是一种计算机数据存储它会存储经常使用的程序来提升系统性能。
### 什么是虚拟内存?
虚拟内存是一种内存管理方式,计算机通过临时将最近未使用的程序数据从 RAM 转移到硬盘,以平衡或管理内存的短缺。
### 什么是 vmstat
vmstat 是一个标准的工具,它会报告 Linux 系统的虚拟内存统计。vmstat 会报告有关进程、内存、分页、块 IO、陷阱中断和 cpu 活动的信息。它可以帮助 Linux 管理员在解决问题时识别系统瓶颈。
### 在 Linux 中安装 Sysstat
Linux 中没有独立的 `vmstat` 包。它与 `sysstat` 绑定在一起,并在大多数发行版的默认仓库上都有。如果还没有安装,只要基于你的发行版输入下面的命令。
```
[在 CentOS/RHEL 中安装 vmstat]
$ sudo yum install sysstat
[在 Fedora 中安装 vmstat]
$ sudo dnf install sysstat
[在 Debian/Ubuntu 中安装 vmstat]
$ sudo apt-get install sysstat
[在 Arch Linux 中安装 vmstat]
$ sudo pacman -S sysstat
[在 Mageia 中安装 vmstat]
$ sudo urpmi sysstat
[在 openSUSE 中安装 vmstat]
$ sudo zypper install sysstat
```
### 不带参数运行 vmstat
假设你已经成功安装 vmstat在终端中不带参数运行 `vmstat`,它会向你展示 vmstat 的默认结果。
```
# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
2 0 79496 1614120 139240 787928 0 0 23 10 0 0 11 1 88 0
```
当你看到上面的输出,你可能已经大致了解了它是什么以及它的目的。不要担心,我们将深入解释每个参数,以便你可以了解 vmstat 的用途和目的。
`procs`procs 中有 `r``b` 列,它报告进程统计信息。在上面的输出中,在运行队列(`r`)中有两个进程在等待 CPU 并有零个休眠进程(`b`)。通常,它不应该超过处理器(或核心)的数量,如果你发现异常,最好使用 [top 命令][1]进一步地排除故障。
* `r`:等待运行的进程数。
* `b`:休眠状态下的进程数。
`memory` memory 下有报告内存统计的 `swpd`、`free`、`buff` 和 `cache` 列。你可以用 `free -m` 命令看到同样的信息。在上面的内存统计中,统计数据以千字节表示,这有点难以理解,最好添加 `M` 参数来看到以兆字节为单位的统计数据。
* `swpd`:使用的虚拟内存量。
* `free`:空闲内存量。
* `buff`:用作缓冲区的内存量。
* `cache`:用作高速缓存的内存量。
* `inact`:非活动内存的数量。
* `active`:活动内存量。
`swap`swap 有 `si``so` 列,用于报告交换内存统计信息。你可以用 `free -m` 命令看到相同的信息。
* `si`:从磁盘交换的内存量(换入,从 swap 移到实际内存的内存)。
* `so`:交换到磁盘的内存量(换出,从实际内存移动到 swap 的内存)。
`I/O`I/O 有 `bi``bo` 列,它以“块读取”和“块写入”的单位来报告每秒磁盘读取和写入的块的统计信息。如果你发现有巨大的 I/O 读写,最好使用 [iotop][2] 和 [iostat][3] 命令来查看。
* `bi`:从块设备接收的块数。
* `bo`:发送到块设备的块数。
`system`system 有 `in``cs` 列,它报告每秒的系统操作。
* `in`:每秒的系统中断数,包括时钟中断。
* `cs`:发送到块设备的块数。
`CPU`CPU 有 `cs`、`us`、`sy`、`id` 和 `wa` 列,报告(所用的) CPU 资源占总 CPU 时间的百分比。如果你发现异常,最好使用 `top``free` 命令。
* `cs`:每秒的系统中断数,包括时钟。
* `us`:发送到块设备的块数。
* `sy`:用作高速缓存的内存量。
* `id`:非活动内存量。
* `wa`:活动内存量。
### 以 MB 方式输出
默认情况下vmstat 以千字节为单位显示内存统计,这是非常难以理解的,最好添加 `-S m` 参数以获取以兆字节为单位的统计。
```
# vmstat -S m
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 103 371 406 2116 0 0 40 15 0 0 11 1 87 0
```
### 以延迟方式运行 vmstat 获取更好的统计信息
默认情况下vmstat 的单次统计信息不足以进一步进行故障排除,因此,添加更新延迟(延迟是更新之间的延迟,以秒为单位)以定期捕获活动。如果你想以 2 秒延迟运行 vmstat ,只需使用下面的命令(如果你想要更长的延迟,你可以根据你的愿望改变)。
以下命令将每 2 秒运行一次,直到退出。
```
# vmstat 2
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 105500 325776 416016 2166912 0 0 40 15 0 0 11 1 87 0
0 0 105500 325644 416016 2166920 0 0 0 13 1083 1174 11 1 87 0
0 0 105500 308648 416024 2166928 0 0 1 16 1559 1453 16 2 82 0
0 0 105500 285948 416032 2166932 0 0 0 12 934 1003 9 1 90 0
0 0 105500 326620 416040 2166940 0 0 1 27 922 1068 9 1 90 0
0 0 105500 366704 416048 2166944 0 0 0 17 835 955 9 1 90 0
0 0 105500 366456 416056 2166948 0 0 1 22 859 918 9 1 90 0
0 0 105500 366456 416056 2166948 0 0 0 15 1539 1504 17 2 81 0
0 0 105500 365224 416060 2166996 0 0 1 19 984 1097 11 1 88 0
```
### 带延迟和计数运行 vmstat
或者,你可以带延迟和特定计数运行 vmstat一旦达到给定的计数然后自动退出。
以下命令将每 2 秒运行一次10 次后自动退出。
```
# vmstat 2 10
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 79496 1581916 157380 810412 0 0 23 10 0 1 11 1 88 0
2 0 79496 1559464 157380 810416 0 0 1 1 1821 1749 21 2 77 0
0 0 79496 1583768 157384 810416 0 0 1 46 681 799 9 1 90 0
2 0 79496 1556364 157384 810428 0 0 1 1 1392 1545 15 2 83 0
0 0 79496 1583272 157384 810428 0 0 1 0 1307 1448 14 2 84 0
2 0 79496 1582032 157384 810428 0 0 1 41 424 605 4 1 96 0
1 0 79496 1575848 157384 810428 0 0 1 0 1912 2407 26 2 71 0
0 0 79496 1582884 157384 810436 0 0 1 69 678 825 9 1 90 0
2 0 79496 1569368 157392 810432 0 0 11 26 920 969 9 1 90 0
1 0 79496 1583612 157400 810444 0 0 7 39 2001 2530 20 2 77 0
```
### 显示活动和非活动内存
默认情况下vmstat 会显示除活动和非活动内存之外的内存统计信息。如果要查看活动和非活动内存统计信息,请在 vmstat 后添加 `-a` 参数。
```
# vmstat -a
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free inact active si so bi bo in cs us sy id wa
1 0 105500 2387592 415148 584112 0 0 40 15 0 1 11 1 87 0
```
### 打印磁盘统计
在 vmstat 后面添加 `-d` 参数会以每个磁盘一行的方式显示统计(包含读、写和 IO
```
# vmstat -d
disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors ms total merged sectors ms cur sec
ram0 0 0 0 0 0 0 0 0 0 0
ram1 0 0 0 0 0 0 0 0 0 0
ram2 0 0 0 0 0 0 0 0 0 0
ram3 0 0 0 0 0 0 0 0 0 0
ram4 0 0 0 0 0 0 0 0 0 0
ram5 0 0 0 0 0 0 0 0 0 0
ram6 0 0 0 0 0 0 0 0 0 0
ram7 0 0 0 0 0 0 0 0 0 0
ram8 0 0 0 0 0 0 0 0 0 0
ram9 0 0 0 0 0 0 0 0 0 0
ram10 0 0 0 0 0 0 0 0 0 0
ram11 0 0 0 0 0 0 0 0 0 0
ram12 0 0 0 0 0 0 0 0 0 0
ram13 0 0 0 0 0 0 0 0 0 0
ram14 0 0 0 0 0 0 0 0 0 0
ram15 0 0 0 0 0 0 0 0 0 0
loop0 0 0 0 0 0 0 0 0 0 0
loop1 0 0 0 0 0 0 0 0 0 0
loop2 0 0 0 0 0 0 0 0 0 0
loop3 0 0 0 0 0 0 0 0 0 0
loop4 0 0 0 0 0 0 0 0 0 0
loop5 0 0 0 0 0 0 0 0 0 0
loop6 0 0 0 0 0 0 0 0 0 0
loop7 0 0 0 0 0 0 0 0 0 0
fd0 0 0 0 0 0 0 0 0 0 0
sda 16604050 904497 2594882190 57455732 30037054 28093770 2160032056 118189160 0 40915
sdb 257357577 479985 3124712204 577235320 8502519 1283237 36645890 11250948 0 182336
```
### 总结磁盘统计
在 vmstat 后面添加 `-D` 会显示全局统计(包括全部的磁盘、分区、全部读、合并的读、读取的扇区、写、合并的写、写入的扇区和 IO
```
# vmstat -D
27 disks
3 partitions
275754028 total reads
1388030 merged reads
5751195976 read sectors
638710116 milli reading
38795040 writes
29520659 merged writes
2209820333 written sectors
130210652 milli writing
0 inprogress IO
224704 milli spent IO
```
### 打印指定分区统计
vmstat 添加 `-p` 参数后面跟上设备名会显示指定分区统计(包括读、读取的扇区、写以及请求的写)。
```
# vmstat -p /dev/sdb1
sdb1 reads read sectors writes requested writes
3115 27890 839453 206728016
```
### vmstat 统计信息带上时间戳
当你想在特定时间区间内找到内存尖峰时,用 vmstat 命令添加 `-t` 参数,后跟延迟和计数。
注意:此组合不适用于基于 Debian 的系统。
```
# vmstat -t 1 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ ---timestamp---
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 6981416 181324 24588604 0 0 0 1 0 0 0 0 100 0 0 2017-01-11 15:42:15 MST
2 0 0 6981276 181324 24588604 0 0 0 0 91 40 0 0 100 0 0 2017-01-11 15:42:16 MST
0 0 0 6982016 181324 24588604 0 0 0 0 75 116 0 0 100 0 0 2017-01-11 15:42:17 MST
0 0 0 6982016 181324 24588604 0 0 0 0 43 39 0 0 100 0 0 2017-01-11 15:42:18 MST
0 0 0 6982280 181324 24588604 0 0 0 0 113 185 0 0 100 0 0 2017-01-11 15:42:19 MST
```
### 打印更多统计
vmstat 后面跟上 `-s` 参数会显示不同统计的总结。
```
# vmstat -s
32849392 total memory
25864128 used memory
16468180 active memory
8320888 inactive memory
6985264 free memory
181324 buffer memory
24588612 swap cache
20970492 total swap
0 used swap
20970492 free swap
891075 non-nice user cpu ticks
6532 nice user cpu ticks
1507099 system cpu ticks
18925265601 idle cpu ticks
113043 IO-wait cpu ticks
108 IRQ cpu ticks
4185 softirq cpu ticks
0 stolen cpu ticks
4071862 pages paged in
216759718 pages paged out
0 pages swapped in
0 pages swapped out
369611221 interrupts
477861261 CPU context switches
1478258826 boot time
2196121 forks
```
### 打印 slab 统计
vmstat 后面跟上 `-m` 参数会显示 slab 信息。
```
# vmstat -m
Cache Num Total Size Pages
nf_conntrack_expect 0 0 240 16
nf_conntrack_ffffffff81b2a920 18 60 312 12
fib6_nodes 24 59 64 59
ip6_dst_cache 16 30 384 10
ndisc_cache 7 30 256 15
ip6_mrt_cache 0 0 128 30
RAWv6 35 35 1088 7
UDPLITEv6 0 0 1024 4
UDPv6 4 12 1024 4
tw_sock_TCPv6 0 0 320 12
request_sock_TCPv6 0 0 192 20
TCPv6 4 6 1920 2
fat_inode_cache 5 6 672 6
fat_cache 0 0 32 112
ioat2 4096 4140 128 30
ext4_inode_cache 34322 34364 1000 4
ext4_xattr 0 0 88 44
.
.
.
```
### 阅读更多关于 vmstat
如果你想了解关于 vmstat 的更多选项,请阅读手册。
```
# vmstat --help
或者
# man vmstat
```
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/d487bef1de15143a7b80a40396e96118?s=256&d=mm&r=g)
热爱玩所有的 Linux 发行版
--------------------------------------------------------------------------------
via: http://www.2daygeek.com/linux-vmstat-command-examples-tool-report-virtual-memory-statistics/
作者:[Magesh Maruthamuthu][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.2daygeek.com/author/magesh/
[1]:http://www.2daygeek.com/top-command-examples-to-monitor-server-
[2]:http://www.2daygeek.com/monitor-disk-io-activity-using-iotop-
[3]:http://www.2daygeek.com/monitor-disk-io-activity-using-iotop-
[4]:https://en.wikipedia.org/wiki/Virtual_memory
[5]:http://www.2daygeek.com/sar-command-examples-system-performance-monitoring-linux/

View File

@ -0,0 +1,36 @@
MapD由 GPU 驱动的数据库分析平台可在几毫秒内查询数十亿条数据
=================================================
![database analytics platform MapD](http://i0.wp.com/opensourceforu.com/wp-content/uploads/2015/03/Database-Backup1.jpg?resize=750%2C525)
麻省理工学院计算机科学与人工智能实验室CSAIL的前研究员开发了一款名为 MapD 的数据库分析平台。该平台使用 GPU 而不是 CPU ,可在几毫秒内查询和映射数十亿条数据。
人们通常将 GPU 与图像处理和游戏相关联。然而,现代 GPU 中高效的核心和处理单元也可以用于通用计算应用。以前在 CSAIL 工作的 Todd Mostak 开发了 MapD它能在毫秒内处理数十亿条数据。
Mostak [声称][5] 他的 MapD 比由 CPU 驱动的传统数据库管理系统的快 100 倍。该平台可以在短时间内处理并可视化大量数据,并且被处理的数据的参数可以很容易地修改。
MapD 将所有数据缓存在多个 GPU 上,而不是存储在某些 CPU 上。每个 GPU 被给予不同的缓冲池以节省时间。通过此过程,系统可以提供比 CPU 驱动的数据库系统快两到三倍的性能。
许多公司客户已经开始使用 Mostak 的 MapD。像 Verizon 这样的电信公司据说也在为其内部研发尝试该数据库分析平台。这家电信公司使用 MapD 分析了 8500 万用户的 SIM 卡更新数据库。
除了 VerizonMapD 还有如社交媒体公司,金融和广告公司的客户。
由 Mostak 领导的创业公司最近从美国中央情报局的投资部门 In-Q-Tel 筹集了一笔资金。你可以期望在不久的将来在不同的领域中使用 MapD 的各种情况。
--------------------------------------------------------------------------------
via: http://opensourceforu.com/2017/01/gpu-powered-database-analytics-platform-query-billions-data-points/
作者:[RAJAT KABADE][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:
[1]:https://twitter.com/home?status=This%20GPU-powered%20database%20analytics%20platform%20can%20query%20billions%20of%20data%20points%20in%20milliseconds+http://opensourceforu.com/2017/01/gpu-powered-database-analytics-platform-query-billions-data-points/
[2]:https://plus.google.com/share?url=http://opensourceforu.com/2017/01/gpu-powered-database-analytics-platform-query-billions-data-points/
[3]:http://pinterest.com/pin/create/button/?url=http://opensourceforu.com/2017/01/gpu-powered-database-analytics-platform-query-billions-data-points/&media=http://opensourceforu.com/wp-content/uploads/2015/03/Database-Backup1.jpg&description=This%20GPU-powered%20database%20analytics%20platform%20can%20query%20billions%20of%20data%20points%20in%20milliseconds
[4]:https://www.tumblr.com/widgets/share/tool?shareSource=legacy&canonicalUrl=&url=http%3A%2F%2Fopensourceforu.com%2F2017%2F01%2Fgpu-powered-database-analytics-platform-query-billions-data-points%2F&posttype=link&title=This+GPU-powered+database+analytics+platform+can+query+billions+of+data+points+in+milliseconds&content=
[5]:http://news.mit.edu/2017/startup-mapd-fast-big-data-mapping-0111

View File

@ -0,0 +1,92 @@
剪切板是一个安全问题 - 在 Linux 中你可以用 xclip 和 cron 修复它
============================================================
![](https://irp-cdn.multiscreensite.com/58a25abc/dms3rep/multi/desktop/clip2-630x520.png)
**更新:我原文推荐的是 xsel但几个用户报告说它禁用了他们的声音。这对我来说不是问题但我发现了另一种方式使用 [xclip][1] )来实现同样的目标,这样应该就能回避这个问题。文章已更新,切换到了 xclip。**
在你的操作系统上复制/粘贴的能力是必不可少的。无论你写的是代码还是剧本这两个功能是在计算机上处理文本的核心。当你复制文本时它会进入内存驻留的剪贴板。除非安装了可以容纳多个条目的剪贴板管理器否则剪贴板默认情况下只会处理一个_复制_事件当你_复制_其他东西的时候它之前的条目才会消失。在标准 Linux 设置中,剪贴板内容存储在控制它的程序的内存中(通常是 Xorg
剪贴板应该有所限制,因为任何程序都可以读取其内容,如果放任它,它保存的东西就会一直呆在那里。此外,现代浏览器允许恶意网站以多种方式从剪贴板读取(和写入)。
虽然不是默认设置,但浏览器可以设置为禁止访问剪贴板。虽然也有用于浏览器和操作系统管理剪贴板的附加组件,但是,在此链条的源头解决问题更容易、更可靠,并使系统范围内的剪贴板安全。有很多理由使用一个剪贴板,但没有足够的理由让内容在那里保留一两分钟以上。
密码管理器最近变得很受欢迎,如果你使用过的话,你已经了解了它们如何将密码复制到剪贴板,以便你可以将其粘贴到浏览器中,并登录到你的帐户。接下来会发生什么?你的密码会保留在剪贴板上,直到另一个复制事件或重新启动。
即使你使用单独的浏览器来处理银行等事务,复制密码时,通过剪贴板会将其带回其他浏览器,并将其暴露在基于 web 的剪贴板收集技术中。
我的解决方案是在后台进行处理,每分钟自动清除剪贴板的内容。它使用 xclip 这个命令行工具、一个小脚本和 [cron][2]。cron 的一分钟间隔给你足够的时间来复制密码,然后它会清空剪贴板。此动作会每分钟执行一次,保证复制无忧。
我们需要使用 [xclip][3] 工具清除终端中的剪贴板。在基于 apt 的发行版中,输入:
```
sudo apt-get install xclip
```
我们在终端中测试一下程序。首先从某处复制一些文字,复制到其他地方,并输入这两条命令:
```
touch blank
xclip -selection clipboard blank
```
接着再次尝试复制文本 - 它应该就会消失了。现在把这个命令放在脚本中。创建一个脚本(用你的文本编辑器代替 leafpad
```
leafpad nukeclipboard.sh
```
并在新文件中输入下面的内容:
```
#!/bin/sh
touch blank && xclip -selection clipboard blank
```
保存并关闭文件,接着加上可执行权限:
```
chmod +x nukeclipboard.sh
```
现在让 cron 任务每分钟运行一次。首先要小心,不同的发行版有不同的 cron 选项。以下设置适用于 Ubuntu基于的发行版并且在你的发行版中过程可能不同因此[请阅读手册][4]。
要设置 cron 任务,请在终端输入:
```
crontab -e
```
在最后被注释掉的行后,输入下面的行(将 `/home/user/` 替换为你的脚本位置):
```
* * * * * export DISPLAY=:0 && /home/user/nukeclipboard.sh
```
现在按下 `ctrl-o` 保存(使用你的 cron 任务编辑器的保存快捷键),然后点击回车保存你的 crontab。最后按下 `ctrl-x` 退出程序。从现在起,你的剪贴板的使用寿命为一分钟。
关于上面的 cron 条目的解释: cron 有环境变量的限制,当它失败时,你可能要花一整天试着一百种方法来解决它。在我找到了一个建议设置 DISPLAY 的[快速修复][5] 后,就解决了。感谢 [Mike Q][6] 的贡献。
现在,可能会发生当你要粘贴复制的东西时,正好剪贴板被清空,从而无法粘贴,但它只是安全的一个小的代价。 如果这是一个问题,您可以配置 cron 以任何适合您的间隔运行任务(比如 2 分钟)。 Ubuntu 的说明在[此] [7]页。
我希望这个教程能帮助你把剪贴板锁定下来 - 如果你有可以工作的脚本或者更好的方法,欢迎来做评论。
--------------------------------------------------------------------------------
via: https://www.darrentoback.com/your-computer-s-clipboard-is-a-security-problem-fix-it-in-linux-with-xsel-and-cron
作者:[dmt][a]
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.darrentoback.com/about-me
[1]:https://github.com/astrand/xclip
[2]:https://en.wikipedia.org/wiki/Cron
[3]:https://github.com/astrand/xclip
[4]:https://en.wikipedia.org/wiki/Cron
[5]:https://stackoverflow.com/questions/14296911/when-linux-system-calls-scripts-some-commands-dont-work-cron-if-up-d/24070707#24070707
[6]:https://stackoverflow.com/users/1618630/mike-q
[7]:https://help.ubuntu.com/community/CronHowto

View File

@ -0,0 +1,157 @@
OpenSSL 在 Apache 和 Dovecot 下的使用(一)
============================================================
![OpenSSL](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/openssl.jpg?itok=RWoqdCAI "OpenSSL")
> 在这有两部分的系列中Carla Schroder 会向你展示如何创建自己的 OpenSSL 证书以及如何配置 Apache 和 Dovecot 来使用它们。
这么长时间之后,我的读者们,这里是我给你们承诺的在 Apache 中使用 OpenSSL 的方法,下周你会看到在 Dovecot 中使用 SSL。 在这个分为两部分的系列中,我们将学习如何创建自己的 OpenSSL 证书,以及如何配置 Apache 和 Dovecot 来使用它们。
这些例子基于这些教程:
* [给初学者看的在 Ubuntu Linux 上使用 Apache][3]
* [给初学者看的在 Ubuntu Linux 上使用 Apache第 2 部分][4]
* [给初学者看的在 CentOS Linux 上使用 Apache][5]
### 创建你的证书
Debian/Ubuntu/Mint 会在 `/etc/ssl` 中存储私钥和证书的符号链接。系统自带的证书保存在 `/usr/share/ca-certificates` 中。你安装或创建的证书在 `/usr/local/share/ca-certificates/` 中。
这个例子是对 Debian 而言。创建私钥和公用证书,将证书转换为正确的格式,并将其符号链接到正确的目录:
```
$ sudo openssl req -x509 -days 365 -nodes -newkey rsa:2048 \
-keyout /etc/ssl/private/test-com.key -out \
/usr/local/share/ca-certificates/test-com.crt
Generating a 2048 bit RSA private key
.......+++
......................................+++
writing new private key to '/etc/ssl/private/test-com.key'
-----
You are about to be asked to enter information that will
be incorporated into your certificate request.
What you are about to enter is what is called a Distinguished
Name or a DN. There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:WA
Locality Name (eg, city) []:Seattle
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Alrac Writing Sweatshop
Organizational Unit Name (eg, section) []:home dungeon
Common Name (e.g. server FQDN or YOUR name) []:www.test.com
Email Address []:admin@test.com
$ sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
Adding debian:test-com.pem
done.
done.
```
CentOS/Fedora 使用不同的文件结构,并不使用 `update-ca-certificates`,使用这个命令:
```
$ sudo openssl req -x509 -days 365 -nodes -newkey rsa:2048 \
-keyout /etc/httpd/ssl/test-com.key -out \
/etc/httpd/ssl/test-com.crt
```
最重要的条目是 `Common Name`它必须与你的完全限定域名FQDN完全匹配。此外其它信息都是任意的。`-nodes` 用于创建一个无密码的证书,这是 Apache 所必需的。`-days` 用于定义过期日期。更新证书是一个麻烦的事情,但这样应该能够额外提供一些安全保障。参见 [90 天证书有效期的利弊][10]中的讨论。
### 配置 Apache
现在配置 Apache 以使用你的新证书。如果你遵循[给初学者看的在 Ubuntu Linux 上使用 Apache第 2 部分][11],你所要做的就是修改虚拟主机配置中的 `SSLCertificateFile``SSLCertificateKeyFile`,以指向你的新私钥和公共证书。来自该教程中的 `test.com` 示例现在看起来像这样:
```
SSLCertificateFile /etc/ssl/certs/test-com.pem
SSLCertificateKeyFile /etc/ssl/private/test-com.key
```
CentOS 用户,请参阅在 CentOS wiki 中的[在 CentOS 上设置 SSL 加密的 Web 服务器][12]一文。过程是类似的wiki 会告诉如何处理 SELinux。
### 测试 Apache SSL
一个简单的方法是用你的网络浏览器访问 https://yoursite.com看看它是否可以正常工作。在第一次这样做时你会在你过度保护的 web 浏览器中看到可怕的警告说网站是不安全的,因为它使用的是自签名证书。请忽略你这个敏感的浏览器,并单击屏幕创建永久性例外。 如果你遵循在[给初学者看的在 Ubuntu Linux 上使用 Apache第 2 部分][14]上的示例虚拟主机配置,那么即使你的网站访问者尝试使用纯 HTTP你的网站的所有流量都将强制通过 HTTPS。
一个很好测试方法是使用 OpenSSL。是的有一个漂亮的命令来测试这些东西。试下这个
```
$ openssl s_client -connect www.test.com:443
CONNECTED(00000003)
depth=0 C = US, ST = WA, L = Seattle, O = Alrac Writing Sweatshop,
OU = home dungeon, CN = www.test.com, emailAddress = admin@test.com
verify return:1
---
Certificate chain
0 s:/C=US/ST=WA/L=Seattle/O=Alrac Writing Sweatshop/OU=home
dungeon/CN=www.test.com/emailAddress=admin@test.com
i:/C=US/ST=WA/L=Seattle/O=Alrac Writing Sweatshop/OU=home
dungeon/CN=www.test.com/emailAddress=admin@test.com
---
Server certificate
-----BEGIN CERTIFICATE-----
[...]
```
这里输出了大量的信息。这里有很多关于 `openssl s_client` 的有趣信息; 现在足够我们知道我们的 web 服务器是否使用了正确的 SSL 证书。
### 创建一个证书签名请求
如果你决定使用第三方证书颁发机构CA那么就必须创建证书签名请求CSR。你将它发送给你的新 CA他们将签署并将其发送给您。他们可能对创建你的 CSR 有自己的要求; 这是如何创建一个新的私钥和 CSR 的典型示例:
```
$ openssl req -newkey rsa:2048 -nodes \
-keyout yourdomain.key -out yourdomain.csr
```
你也可以从一个已经存在的 key 中创建一个 CSR
```
$ openssl req -key yourdomain.key \
-new -out domain.csr
```
今天就是这样了。下周我们将[学习如何正确地在 Dovecot 中设置 OpenSSL][15]。
### 额外的教程
- [消灭让人害怕的 web 浏览器 SSL 警告][16]
- [如何在 Linux 上使用 OpenVPN 设置安全远程网络:第一部分][17]
- [如何在 Linux 上使用 OpenVPN 设置安全远程网络:第一部分][18]
提高你的系统管理职业生涯吧查看Linux基金会的[系统管理的要点][8]课程。
--------------------------------------------------------------------------------
via: https://www.linux.com/learn/sysadmin/openssl-apache-and-dovecot
作者:[CARLA SCHRODER][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/cschroder
[1]:https://www.linux.com/licenses/category/creative-commons-zero
[2]:https://www.linux.com/files/images/openssljpg
[3]:https://www.linux.com/learn/apache-ubuntu-linux-beginners
[4]:https://www.linux.com/learn/apache-ubuntu-linux-beginners-part-2
[5]:https://www.linux.com/learn/apache-centos-linux-beginners
[6]:https://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration
[7]:https://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration
[8]:https://training.linuxfoundation.org/linux-courses/system-administration-training/essentials-of-system-administration
[9]:https://www.addtoany.com/share#url=https%3A%2F%2Fwww.linux.com%2Flearn%2Fsysadmin%2Fopenssl-apache-and-dovecot&title=OpenSSL%20For%20Apache%20and%20Dovecot%20
[10]:https://community.letsencrypt.org/t/pros-and-cons-of-90-day-certificate-lifetimes/4621
[11]:https://www.linux.com/learn/apache-ubuntu-linux-beginners-part-2
[12]:https://wiki.centos.org/HowTos/Https
[13]:https://yoursite.com/
[14]:https://www.linux.com/learn/apache-ubuntu-linux-beginners-part-2
[15]:https://www.linux.com/learn/intro-to-linux/openssl-apache-and-dovecot-part-2
[16]:https://www.linux.com/learn/quieting-scary-web-browser-ssl-alerts
[17]:https://www.linux.com/learn/how-set-secure-remote-networking-openvpn-linux-part-1
[18]:https://www.linux.com/learn/how-set-secure-remote-networking-openvpn-linux-part-2

View File

@ -0,0 +1,244 @@
OpenSSL 在 Apache 和 Dovecot 下的使用(二)
============================================================
![OpenSSL](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/key-openssl_0.jpg?itok=FDO3qAOt "OpenSSL")
> 本篇中Carla Schroder 会解释如何使用 OpenSSL 保护你的 Postfix/Dovecot 邮件服务器
[Creative Commons Zero][1]Pixabay
在[上周][11],作为我们 OpenSSL 系列的一部分,我们学习了如何配置 Apache 以使用 OpenSSL 并强制所有会话使用 HTTPS。 今天,我们将使用 OpenSSL 保护我们的 Postfix/Dovecot 邮件服务器。这些示例基于前面的教程; 请参阅最后的参考资料部分,了解本系列中以前的所有教程的链接。
你需要配置 Postfix 以及 Dovecot 都使用 OpenSSL我们将使用我们在[OpenSSL 在 Apache 和 Dovecot 下的使用(一)][12]中创建的密钥和证书。
### Postfix 配置
你必须编辑 `/etc/postfix/main.cf` 以及 `/etc/postfix/master.cf`。实例的 `main.cf` 是完整的配置,基于我们先前的教程。替换成你自己的 OpenSSL 密钥和证书名以及本地网络地址。
```
compatibility_level=2
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu/GNU)
biff = no
append_dot_mydomain = no
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $myhostname
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_domains = /etc/postfix/vhosts.txt
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = hash:/etc/postfix/vmaps.txt
virtual_minimum_uid = 1000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = lmtp:unix:private/dovecot-lmtp
smtpd_tls_cert_file=/etc/ssl/certs/test-com.pem
smtpd_tls_key_file=/etc/ssl/private/test-com.key
smtpd_use_tls=yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_authenticated_header = yes
```
`master.cf` 取消 `submission inet` 部分的注释,并编辑 `smtpd_recipient_restrictions`
```
#submission inet n - y - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o milter_macro_daemon_name=ORIGINATING
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
-o smtpd_tls_wrappermode=no
```
完成后重新加载 Postfix
```
$ sudo service postfix reload
```
### Dovecot 配置
在我们以前的教程中,我们为 Dovecot 创建了一个单一配置文件 `/etc/dovecot/dovecot.conf`,而不是使用多个默认配置文件。这是一个基于我们以前的教程的完整配置。再说一次,使用你自己的 OpenSSL 密钥和证书,以及你自己的 `userdb` 的 home 文件:
```
protocols = imap pop3 lmtp
log_path = /var/log/dovecot.log
info_log_path = /var/log/dovecot-info.log
disable_plaintext_auth = no
mail_location = maildir:~/.Mail
pop3_uidl_format = %g
auth_mechanisms = plain
passdb {
driver = passwd-file
args = /etc/dovecot/passwd
}
userdb {
driver = static
args = uid=vmail gid=vmail home=/home/vmail/studio/%u
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
protocol lmtp {
postmaster_address = postmaster@studio
}
service lmtp {
user = vmail
}
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user=postfix
group=postfix
}
}
ssl=required
ssl_cert = </etc/ssl/certs/test-com.pem
ssl_key = </etc/ssl/private/test-com.key
```
重启 Dovecot:
```
$ sudo service postfix reload
```
### 用 telnet 测试
就像我们以前一样,现在我们可以通过使用 telnet 发送消息来测试我们的设置。 但是等等,你说 telnet 不支持 TLS/SSL那么这样怎么办呢首先通过使用 `openssl s_client` 打开一个加密会话。`openssl s_client` 的输出将显示你的证书及其指纹和大量其它信息,以便你知道你的服务器正在使用正确的证书。会话建立后输入的命令都是不以数字开头的:
```
$ openssl s_client -starttls smtp -connect studio:25
CONNECTED(00000003)
[masses of output snipped]
Verify return code: 0 (ok)
---
250 SMTPUTF8
EHLO studio
250-localhost
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 SMTPUTF8
mail from: <carla@domain.com>
250 2.1.0 Ok
rcpt to: <alrac@studio>
250 2.1.5 Ok
data
354 End data with .subject: TLS/SSL test
Hello, we are testing TLS/SSL. Looking good so far.
.
250 2.0.0 Ok: queued as B9B529FE59
quit
221 2.0.0 Bye
```
你应该可以在邮件客户端中看到一条新邮件,并在打开时要求你验证 SSL 证书。你也可以使用 `openssl s_client` 来测试 Dovecot 的 POP3 和 IMAP 服务。此示例测试加密的 POP3第 5 号消息是我们在 telnet如上中创建的
```
$ openssl s_client -connect studio:995
CONNECTED(00000003)
[masses of output snipped]
Verify return code: 0 (ok)
---
+OK Dovecot ready
user alrac@studio
+OK
pass password
+OK Logged in.
list
+OK 5 messages:
1 499
2 504
3 514
4 513
5 565
.
retr 5
+OK 565 octets
Return-Path: <carla@domain.com>
Delivered-To: alrac@studio
Received: from localhost
by studio.alrac.net (Dovecot) with LMTP id y8G5C8aablgKIQAAYelYQA
for <alrac@studio>; Thu, 05 Jan 2017 11:13:10 -0800
Received: from studio (localhost [127.0.0.1])
by localhost (Postfix) with ESMTPS id B9B529FE59
for <alrac@studio>; Thu, 5 Jan 2017 11:12:13 -0800 (PST)
subject: TLS/SSL test
Message-Id: <20170105191240.B9B529FE59@localhost>
Date: Thu, 5 Jan 2017 11:12:13 -0800 (PST)
From: carla@domain.com
Hello, we are testing TLS/SSL. Looking good so far.
.
quit
+OK Logging out.
closed
```
### 现在做什么?
现在你有一个功能良好的,具有合适的 TLS/SSL 保护的邮件服务器了。我鼓励你深入学习 Postfix 以及 Dovecot 这些教程中的示例尽可能地简单,不包括对安全性、防病毒扫描程序、垃圾邮件过滤器或任何其他高级功能的调整。我认为当你有一个基本工作系统时更容易学习高级功能。
下周回到 openSUSE 包管理备忘录上。
### 资源
* [为 Apache 和 Dovecot 使用 OpenSSL][3]
* [如何在 Ubuntu Linux 上构建电子邮件服务器][4]
* [在 Ubuntu Linux 上构建电子邮件服务器第2部分][5]
* [在 Ubuntu Linux 上构建电子邮件服务器第3部分][6]
* [给初学者看的在 Ubuntu Linux 上使用 Apache][7]
* [给初学者看的在 Ubuntu Linux 上使用 Apache第二部分][8]
* [给初学者看的在 CentOS Linux 上使用 Apache][9]
* [消灭让人害怕的 web 浏览器 SSL 警告][10]
--------------------------------------------------------------------------------
via: https://www.linux.com/learn/intro-to-linux/openssl-apache-and-dovecot-part-2
作者:[CARLA SCHRODER][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/cschroder
[1]:https://www.linux.com/licenses/category/creative-commons-zero
[2]:https://www.linux.com/files/images/key-openssljpg-0
[3]:https://linux.cn/article-8167-1.html
[4]:https://linux.cn/article-8071-1.html
[5]:https://linux.cn/article-8077-1.html
[6]:https://linux.cn/article-8088-1.html
[7]:https://www.linux.com/learn/apache-ubuntu-linux-beginners
[8]:https://www.linux.com/learn/apache-ubuntu-linux-beginners-part-2
[9]:https://www.linux.com/learn/apache-centos-linux-beginners
[10]:https://www.linux.com/learn/quieting-scary-web-browser-ssl-alerts
[11]:https://linux.cn/article-8167-1.html
[12]:https://linux.cn/article-8167-1.html

View File

@ -0,0 +1,88 @@
在 Fedora 上使用 Redshift 改善睡眠
===============================================
![redshift](https://cdn.fedoramagazine.org/wp-content/uploads/2017/01/redshift-945x400.png)
大多数电子设备发射的蓝光被认为对我们的睡眠有负面影响。作为一个尝试,我们可以在黑暗中不再使用我们的电子设备,以改善我们的睡眠。然而,由于这对我们大多数人并不是很适合,更好的方法是根据你周围环境调整屏幕的色温。实现这一点的最流行的方法之一是使用 Redshift。 Redshift 的创建者 Jon Lund Steffensen 这样描述了他的程序:
> Redshift 会根据你周围的环境调整屏幕的色温。如果你在夜间在屏幕前工作,它可以帮助你减少眼睛伤害。
Redshift 在 Fedora Workstation 上仅工作在 X11 会话中。所以如果你使用 Fedora 24Redshift 可以工作在默认登录会话中。然而,在 Fedora 25 上,登录的默认会话是 Wayland因此你将需要替代使用其 GNOME shell 扩展。注意,这个 GNOME Shell 扩展也适用于 X11 会话。
### Redshift 工具
#### 安装
Redshift 在 Fedora 的仓库中,因此我们使用下面的命令安装:
```
sudo dnf install redshift
```
该软件也提供了 GUI。要使用的话就安装 `redshift-gtk`。记住,这个工具只能在 X11 会话中使用:
#### 使用 Redshift 工具
用像下面的命令在命令行中运行:
```
redshift -l 23.6980:133.8807 -t 5600:3400
```
在以上命令中,`-l 23.6980:133.8807` 的意思是我们通知 Redshift 我们当前的位置是南纬 23.6980°,东经 133.8807°。 `-t 5600:3400` 表明你白天想要的色温是 5600晚上是 3400。
色温与发射的蓝光的量成比例:较低的色温意味着较低量的蓝光。我喜欢在白天使用 5600K6500K 是中性日光),在晚上使用 3400K更低的色温让我觉得像盯着番茄一样但你可以随意尝试。
如果你不指定位置Redshift 会尝试使用 Geoclue 方法来确定你的位置坐标。如果此方法不起作用,你可以使用几个[网站][2]和在线地图来查找坐标。
![screenshot1](https://cdn.fedoramagazine.org/wp-content/uploads/2017/01/screenshot1.png)
别忘记将 Redshift 设置为自动启动,查看 [Jon 的网站][3]来获取更多信息。
### Redshift GNOME Shell 扩展
该程序不能在运行 Wayland 显示服务器(这是 Fedora 25 中的标准)的环境中工作。幸运的是,这里有一个方便的 GNOME Shell 扩展可以做到同样的工作。要安装它,请运行以下命令:
```
sudo dnf copr enable mystro256/gnome-redshift
sudo dnf install gnome-shell-extension-redshift
```
从 COPR 仓库安装后,注销并重新登录你的 Fedora Workstation然后在 GNOME Tweak 工具中启用它。关于更多信息,请查看 gnome-redshift 的 [copr 仓库][4]或 [github 仓库][5]。
启用扩展后GNOME shell 右上角会出现一个小小的太阳(或月亮)图标。该扩展还提供了一个设置对话框来调整 redshift 和温度的时间。
![screenshot-from-2017-01-18-15-21-47](https://cdn.fedoramagazine.org/wp-content/uploads/2017/01/Screenshot-from-2017-01-18-15-21-47.jpg)
### 相关软件
#### F.lux
Redshift 可以被看作是 F.lux 的开源变体。现在有一个 [linux 版本的 F.lux][6]。如果你不介意使用闭源软件,或者 Redshift 不能正常工作,你可以考虑使用它。
#### Android 版 Twilight
Twilight 与 Redshift 相似,但是用于 Android。它可以让你在晚上在智能手机或平板上阅读更加舒服。
#### Redshift plasmoid
这是 Redshift GUI 的 KDE 版本。你可以在 [github ][7] 中找到更多信息。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/safe-eyes-redshift/
作者:[novel][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://novel.id.fedoraproject.org/
[1]:https://fedoramagazine.org/safe-eyes-redshift/
[2]:http://www.latlong.net/
[3]:http://jonls.dk/redshift/
[4]:https://copr.fedorainfracloud.org/coprs/mystro256/gnome-redshift/
[5]:https://github.com/benzea/gnome-shell-extension-redshift
[6]:https://justgetflux.com/linux.html
[7]:https://github.com/simgunz/redshift-plasmoid

View File

@ -0,0 +1,86 @@
在 Linux 中安装最新的 Thunderbird 邮件客户端
============================================================
雷鸟Thunderbird 是一个开源自由的跨平台的基于 web 的电子邮件、新闻和聊天客户端应用程序,其旨在处理多个电子邮件帐户和新闻源。
在 2016 年 12 月 28 日Mozilla 团队宣布 Thunderbird 45.6.0 的发布。这个新版本带有如下功能:
### Thunderbird 45.6.0 功能
1. 每次启动 Thunderbird 时都会显示系统集成对话框
2. 各种错误修复和性能改进。
3. 各种安全修复。
查看更多关于 Thunderbird 45.6.0 版本的新功能和已知问题在 [Thunderbird 发行说明][1]中有。
本文将解释如何在 Linux 发行版(如 Fedora、Ubuntu 及其衍生版)中安装 Thunderbird 邮件客户端。
在许多 Linux 发行版中Thunderbird 包已经默认包含在内,并且可以使用默认包管理系统来安装,这样可以:
1. 确保你具有所有需要的库
2. 添加桌面快捷方式以启动 Thunderbird
3. 使 Thunderbird 可供计算机上的所有系统用户访问
4. 它可能不会为你提供最新版本的 Thunderbird
### 在 Linux 中安装 Thunderbird 邮件客户端
要从系统默认仓库中安装 Thunderbird
```
$ sudo apt-get install thunderbird [在基于 Ubuntu 的系统中]
$ dnf install thunderbird [在基于 Fedora 的系统中]
```
如我所说,从默认仓库中安装的话将带给你的是旧版本 Thunderbird。如果要安装最新版本的 Mozilla Thunderbird可以使用 Mozilla 团队维护的 PPA。
在 Ubuntu 及其衍生版中使用 `CTRL + ALT + T` 从桌面打开终端并添加 Thunderbird 仓库。
```
$ sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa
```
接下来,使用 `update` 命令升级软件包。
```
$ sudo apt-get update
```
系统升级完成后,使用下面的命令安装。
```
$ sudo apt-get install thunderbird
```
### Thunderbird 预览
[
![Install Thunderbird in Linux](http://www.tecmint.com/wp-content/uploads/2012/11/Install-Thunderbird-in-Linux.png)
][2]
*在 Linux 中安装 Thunderbird*
就是这样了,你已经成功在 Linux 中安装了 Thunderbird 45.6.0。在 [Thunderbird 下载页][3]中 Thunderbird 还可用于其他操作系统。
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/7badddbc53297b2e8ed7011cf45df0c0?s=256&d=blank&r=g)
我是 Ravi SaiveTecMint 的创建者。一个喜欢在互联网上分享技巧和提示的计算机 Geek 和 Linux 大师。我的大多数服务器运行在 Linux 开源平台上。在 Twitter、Facebook 和 Google+ 上关注我。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-thunderbird-in-ubuntu-fedora-linux/
作者:[Ravi Saive][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/admin/
[1]:https://www.mozilla.org/en-US/thunderbird/45.6.0/releasenotes/
[2]:http://www.tecmint.com/wp-content/uploads/2012/11/Install-Thunderbird-in-Linux.png
[3]:http://www.mozilla.org/en-US/products/thunderbird/

View File

@ -9,55 +9,55 @@ LXD 2.0 系列(六):远程主机及容器迁移
LXD 2.0 支持两种协议:
* LXD 1.0 API这是在客户端和LXD守护进程之间使用的REST API以及在复制/移动镜像和容器时在LXD守护进程之间使用的REST API。
* SimplestreamsSimplestreams协议是LXD客户端和守护进程使用的只读、只有镜像的协议获取镜像信息以及从一些公共镜像服务器如Ubuntu镜像导入镜像。
* LXD 1.0 API这是在客户端和 LXD 守护进程之间使用的 REST API以及在 LXD 守护进程间复制/移动镜像和容器时使用的 REST API。
* SimplestreamsSimplestreams 协议是 LXD 客户端和守护进程使用的只读、仅针对镜像的协议,用于客户端和 LXD 守护进程获取镜像信息以及从一些公共镜像服务器(如 Ubuntu 镜像)导入镜像。
以下所有内容都将使用这两个协议中的第一个。
### 安全
LXD API的验证是通过使用最近的密钥通过TLS 1.2的客户端证书验证。 当两个LXD守护程序必须直接交换信息时,源守护程序生成一个临时令牌,并通过客户端传输到目标守护程序。 此令牌仅可用于访问特定流,并且立即撤销,因此不能重新使用。
LXD API 的验证是通过客户端证书在 TLS 1.2 上使用最近的密钥验证的。 当两个 LXD 守护进程必须直接交换信息时,源守护程序生成一个临时令牌,并通过客户端传输到目标守护程序。 此令牌仅可用于访问特定流,并且会被立即撤销,因此不能重新使用。
为了避免中间人攻击,客户端工具还将源服务器的证书发送到目标。 这意味着对于特定的下载操作目标服务器会被提供源服务器的URL、需要的资源的一次性访问令牌以及服务器应该使用的证书。 这可以防止MITM攻击并且只允许临时访问传输对象。
为了避免中间人攻击,客户端工具还将源服务器的证书发送到目标服务器。这意味着对于特定的下载操作,目标服务器会被提供源服务器的 URL、需资源的一次性访问令牌以及服务器应该使用的证书。 这可以防止中间人攻击,并且只允许临时访问所传输的对象。
### 网络需求
LXD 2.0使用一种模型,它其中操作的目标(接收端)直接连接到源以获取数据。
LXD 2.0 使用这样一种模型,某个操作的目标(接收端)直接连接到源以获取数据。
这意味着你必须确保目标服务器可以直接连接到源、可以更新任何所需的防火墙。
我们有个[允许反向连接的计划][1],允许通过客户端本身代理以应对那些严格的防火墙阻止两台主机之间通信的罕见情况。
我们有个[允许反向连接的计划][1],允许通过客户端代理本身以应对那些严格的防火墙阻止两台主机之间通信的罕见情况。
### 与远程主机交互
LXD使用的是“remotes”的概念而不是让我们的用户总是提供主机名或IP地址然后在他们想要与远程主机交互时验证证书信息。
LXD 使用的是“远程”的概念,而不是让我们的用户总是提供主机名或 IP 地址,然后在他们想要与远程主机交互时验证证书信息。
默认情况下,唯一真正的LXD远程配置是“local:”这也是默认远程所以你不必输入它的名称。本地远程使用LXD REST API通过unix套接字与本地守护进程通信。
默认情况下,唯一真正的 LXD 远程配置是 `local:`,这也是默认的远程(所以你不必输入它的名称)。这个本地(`local:`)远程使用 LXD REST API 通过 unix 套接字与本地守护进程通信。
### 添加一台远程主机
#### 添加一台远程主机
假设你已经有两台装有LXD的机器你的本机以及远程那台我们称为“foo”的主机。
假设你已经有两台装有 LXD 的机器:你的本机以及远程那台我们称为“foo”的主机。
首先你需要确保“foo”正在监听网络并设置了一个密码因此在远程shell上运行:
首先你需要确保“foo”正在监听网络并设置了一个密码以便得到一个远程 shell运行:
```
lxc config set core.https_address [::]:8443
lxc config set core.trust_password something-secure
```
在你本地LXD上你需要使它对网络可见这样我们可以从它传输容器和镜像
在你本地 LXD 上,你需要使它对网络可见,这样我们可以从它传输容器和镜像:
```
lxc config set core.https_address [::]:8443
```
现在守护进程的配置已经在两段完成了你可以添加“foo”到你的本地客户端
现在已经在两端完成了守护进程的配置你可以添加“foo”到你的本地客户端
```
lxc remote add foo 1.2.3.4
```
(将 1.2.3.4 替换成你的IP或者FQDN)
(将 1.2.3.4 替换成你的 IP 或者 FQDN
看上去像这样:
@ -88,11 +88,11 @@ stgraber@dakara:~$ lxc remote list
+-----------------+-------------------------------------------------------+---------------+--------+--------+
```
### 与它交互
#### 与它交互
好了,所以我们已经有了一台定义好的远程服务器,我们现在可以做些什么?
好了就如你看到现在的唯一的不同是你不许告诉LXD要哪台主机运行。
现在,就如你看到的,唯一的不同是你必须告诉 LXD 要哪台主机运行。
比如:
@ -100,13 +100,13 @@ stgraber@dakara:~$ lxc remote list
lxc launch ubuntu:14.04 c1
```
它会在默认主机(“lxc remote get-default”也就是你的本机上运行。
它会在默认主机(`lxc remote get-default`也就是你的本机上运行。
```
lxc launch ubuntu:14.04 foo:c1
```
这个会在foo上运行。
这个会在 foo 上运行。
列出远程主机正在运行的容器可以这么做:
@ -125,13 +125,13 @@ stgraber@dakara:~$ lxc list foo:
lxc launch foo:my-image foo:c2
```
最后就如你希望的那样得到一个远程容器的shell
最后,就如你希望的那样得到一个远程容器的 shell
```
lxc exec foo:c1 bash
```
### 复制容器
#### 复制容器
在两台主机间复制容器就如它听上去那样简单:
@ -146,9 +146,9 @@ lxc snapshot foo:c1 current
lxc copy foo:c1/current c3
```
### 移动容器
#### 移动容器
除非你在做实时更新(将会在之后的文章中覆盖),不然你需要在移动前先停止容器,接着就会如你预料的那样。
除非你在做实时迁移(将会在之后的文章中讲到),不然你需要在移动前先停止容器,接着就会如你预料的那样。
```
lxc stop foo:c1
@ -164,30 +164,29 @@ lxc move foo:c1 c1
### 这些如何工作
正如你期望的那样, 与远程容器的交互时LXD只使用完全相同的HTTPS传输的API而不是通过本地Unix套接字使用REST API
正如你期望的那样, 与远程容器的交互时 LXD 使用的 REST API 并不是通过本地 Unix 套接字,而是通过 HTTPS 传输
当两个守护程序之间交互时会变得有些棘手,如复制和移动的情况。
有有以下这些情况
在这种情况下会发生
1.用户运行“lxc move fooc1 c1”
2.客户端联系本地:远程以检查现有的“c1”容器。
3.客户端从“foo”获取容器信息。
4.客户端从源“foo”守护程序请求迁移令牌。
5.客户端将迁移令牌以及源URL和“foo”证书发送到本地LXD守护程序以及容器配置和周围设备。
6.然后本地LXD守护程序使用提供的令牌直接连接到“foo”
  A.它连接到第一个控制websocket
  B.它协商文件系统传输协议zfs发送/接收btrfs发送/接收或者纯rsync
  C.如果在本地可用,它会解压用于创建源容器的镜像。这是为了避免不必要的数据传输。
  D.然后它会将容器及其任何快照作为增量传输。
7.如果成功客户端会命令“foo”删除源容器。
1. 用户运行`lxc move fooc1 c1`
2. 客户端联系 `local:` 远程以检查是否现有“c1”容器。
3. 客户端从“foo”获取容器信息。
4. 客户端从源“foo”守护程序请求迁移令牌。
5. 客户端将迁移令牌以及源 URL 和“foo”证书发送到本地 LXD 守护程序以及容器配置和周围设备。
6. 然后本地 LXD 守护程序使用提供的令牌直接连接到“foo”
a) 它连接到第一个控制 websocket
   b) 它协商文件系统传输协议zfs 发送/接收btrfs 发送/接收或者纯 rsync
   c) 如果在本地可用,它会解压用于创建源容器的镜像。这是为了避免不必要的数据传输。
   d) 然后它会将容器及其任何快照作为增量传输。
7. 如果成功客户端会命令“foo”删除源容器。
### 在线尝试
没有两台机器来尝试远端交互和复制/移动容器?
没有问题,你可以使用我们的[demo服务][2]。
这里甚至还包括了一步步的指导!
没有问题,你可以使用我们的 [demo 服务][2]。这里甚至还包括了一步步的指导!
### 额外信息
@ -202,11 +201,11 @@ LXD 的 IRC 频道: #lxcontainers on irc.freenode.net
--------------------------------------------------------------------------------
via: https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/
via: https://www.stgraber.org/2016/04/12/lxd-2-0-remote-hosts-and-container-migration-612/
作者:[Stéphane Graber][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织翻译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,146 +0,0 @@
2017 is the year that front-end developers should go back and master the basics
============================================================
![](https://cdn-images-1.medium.com/max/1000/1*1Xsnx4_M8uJc2klBxEtGLQ.jpeg)
In our fast-paced ecosystem, we tend to spend our time trying out the latest inventions, then arguing about them on the internet.
Im not saying we shouldnt do that. But we should probably slow down a bit and take a look at the things that dont change all that much. Not only will this improve the quality of our work and the value we deliverit will actually help us learn these new tools faster.
This post is a mix of my experience and my wishes for the New Year. And I want to hear your suggestions in the comments just as much as I want to share my own.
### Learn how to write readable code
Most of our work lies not in writing new code, but maintaining existing code. That means you end up reading code much more often then writing it, so you need to optimize your code for _the next programmer_, not for the interpreter.
I recommend reading these three amazing booksin this order, from shortest to longest:
* [The Art of Readable Code][1] by Dustin Boswell
* [Clean Code: A Handbook of Agile Software Craftsmanship][2] by Robert C. Martin
* [Code Complete: A Practical Handbook of Software Construction][3] by Steve McConnell
![](https://cdn-images-1.medium.com/max/1000/1*YQGwR6skf705fovSLCbmXQ.jpeg)
### Learn JavaScript deeper
When every week we have a new JavaScript framework thats better than any older framework, its easy to spend most of your time learning frameworks rather than the language itself. If youre using a framework but dont understand how it works, _stop and start learning the language until you understand how the tools you use work_.
* A great start is [Kyle][4] Simpsons book series [You Dont Know JavaScript][5], which you can read online for free.
* [Eric Elliott][6] has a huge list of [JavaScript topics to learn in 2017][7].
* [Henrique Alves][8] has a list of [things you should know before using React][9](actually any framework).
* [JavaScript Developers: Watch Your Language][10] by Mike Pennisiunderstand TC-39 process for new ECMAScript features.
### Learn functional programming
For years we wanted classes in JavaScript. Now we finally have them but dont want to use them anymore. Functions are all we want! We even write HTML using functions (JSX).
* [Functional-Light JavaScript][11] by Kyle Simpson.
* Professor Frisbys [Mostly adequate guide to functional programming ebook][12] and [his free course][13].
![](https://cdn-images-1.medium.com/max/1000/1*Helkj3sq3oVOc-dtjRgrYQ.jpeg)
### Learn design basics
As front-end developers, were closer to users than anybody else on the teammaybe even closer than designers. And if designers have to verify every pixel you put on screen, youre doing something wrong.
* Design for Hackers: [a book][14] and [a free course][15] by [David Kadavy][16].
* [Design for Non-Designers][17] talk by [Tracy Osborn][18].
* [Design of Web Applications][19] by [Nathan Barry][20].
* [On Web Typography][21] by [Jason Santa Maria][22].
* [The Inmates Are Running the Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity][23] by Alan Cooper.
* A few articles on animation in UI: [How to Use Animation to Improve UX][24], [Transitional Interfaces][25].
### Learn how to work with humans
Some of us come to programming because we prefer to interact with computers more than with humans. Unfortunately, thats not how it works.
We rarely work in isolation: we have to talk to other developers, designers, managersand sometimes even users. Thats hard. But its important if you want to really understand what youre doing and why, because thats where the value in what we do lies.
* [Soft Skills: The software developers life manual][26] by [John Sonmez][27].
* [The Clean Coder: A Code of Conduct for Professional Programmers][28] by Robert C. Martin.
* [Start with No: The Negotiating Tools that the Pros Dont Want You to Know][29] by Jim Camp.
![](https://cdn-images-1.medium.com/max/1000/1*zv6BXllLujNl-vDqkXQMqw.jpeg)
### Learn how to write for humans
A big portion of communication with our colleagues and other people are textual: task descriptions and comments, code comments, Git commits, chat messages, emails, tweets, blog posts, etc.
Imagine how much time people spend reading and understanding all that. If you can reduce this time by writing more clearly and concisely, the world will be a better place to work.
* [On Writing Well: The Classic Guide to Writing Nonfiction][30] by William Zinsser.
* [The Elements of Style][31] by William Strunk and E. B. White.
* [Orwells rules on writing][32].
* In Russian: awesome [Glavred course][33].
### Learn the old computer science wisdom
Front-end development isnt just animated dropdown menus any more. Its more complicated than ever before. Part of that notorious “JavaScript fatigue” stems from the increased complexity of the tasks we have to solve.
This, however, means that its time to learn from all wisdom that non-front-end developers have built up over the decades. And this is where I want to hear your recommendations the most.
Here are a couple resources I personally would recommend on this:
* [Learn To Think Like A Computer Scientist][34] course at Coursera.
* [The five programming books that meant most to me][35] by [DHH][36]
* * *
What would you recommend? What are you going to learn in 2017?
--------------------------------------------------------------------------------
作者简介:
![](https://cdn-images-1.medium.com/fit/c/60/60/0*FXw8cxdKYar82R9X.jpeg)
Web developer, passionate photographer and owner of crazy dogs.
--------------------------------------------------------------------------------
via: https://medium.freecodecamp.com/what-to-learn-in-2017-if-youre-a-frontend-developer-b6cfef46effd#.ss9xbwrew
作者:[Artem Sapegin][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://medium.freecodecamp.com/@sapegin
[1]:https://www.amazon.com/gp/product/0596802293/
[2]:https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/
[3]:https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670/
[4]:https://medium.com/u/5dccb9bb4625
[5]:https://github.com/getify/You-Dont-Know-JS
[6]:https://medium.com/u/c359511de780
[7]:https://medium.com/javascript-scene/top-javascript-frameworks-topics-to-learn-in-2017-700a397b711#.zhnbn4rvg
[8]:https://medium.com/u/b6c3841651ac
[9]:http://alves.im/blog/before-dive-into-react.html
[10]:https://bocoup.com/weblog/javascript-developers-watch-your-language
[11]:https://github.com/getify/Functional-Light-JS
[12]:https://github.com/MostlyAdequate/mostly-adequate-guide
[13]:https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript
[14]:https://www.amazon.com/Design-Hackers-Reverse-Engineering-Beauty-ebook/dp/B005J578EW
[15]:http://designforhackers.com/
[16]:https://medium.com/u/5377a93ef640
[17]:https://youtu.be/ZbrzdMaumNk
[18]:https://medium.com/u/e611097a5bd4
[19]:http://nathanbarry.com/webapps/
[20]:https://medium.com/u/ac3090433602
[21]:https://abookapart.com/products/on-web-typography
[22]:https://medium.com/u/8eddcb9e4ac4
[23]:https://www.amazon.com/Inmates-Are-Running-Asylum-Products-ebook/dp/B000OZ0N62/
[24]:http://babich.biz/how-to-use-animation-to-improve-ux/
[25]:https://medium.com/@pasql/transitional-interfaces-926eb80d64e3#.igcwawszz
[26]:https://www.amazon.com/Soft-Skills-software-developers-manual/dp/1617292397/
[27]:https://medium.com/u/56e8cba02b
[28]:https://www.amazon.com/Clean-Coder-Conduct-Professional-Programmers/dp/0137081073/
[29]:https://www.amazon.com/Start-No-Negotiating-Tools-that-ebook/dp/B003EY7JEE/
[30]:https://www.amazon.com/gp/product/0060891548/
[31]:https://www.amazon.com/Elements-Style-4th-William-Strunk/dp/0205313426/
[32]:http://www.economist.com/blogs/prospero/2013/07/george-orwell-writing
[33]:http://maximilyahov.ru/glvrd-pro/
[34]:https://www.coursera.org/specializations/algorithms
[35]:https://signalvnoise.com/posts/3375-the-five-programming-books-that-meant-most-to-me
[36]:https://medium.com/u/54bcbf647830

View File

@ -1,150 +0,0 @@
#rusking translating
How to get started as an open source programmer
============================================================
![How to get started as an open source programmer](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/programming_keys.jpg?itok=_VDcN66X "How to get started as an open source programmer")
Image credits : 
Zagrev on [Flickr][1]. [CC BY-SA 2.0][2]
Looking out at the world of technology is exciting. It has a lot of moving parts, and it seems the further you dig into it, the deeper it gets, and then it's [turtles all the way down][3]. For that very reason, technology is also overwhelming. Where do you start if you're keen to join in and help shape the way the modern world functions? What's the first step? What's the twentieth step?
The first thing to understand is that open source is open. This might seem obvious, but the phrase "open source" is thrown around so often these days that sometimes people forget it's just a description of a cultural phenomenon, not the name of a Fortune 500 company. Unlike other jobs or groups, you don't have to interview or complete a sign-up sheet or registration form to become an open source programmer. All you do to become an open source programmer is _program_and then share your code, ideally with a guarantee that the code remains open regardless of how it's used.
That's it. You're an open source programmer!
You now have your destination, but what about the logistics?
### Skill trees
Have you ever played an RPG? In these games, there's the concept of linear "skill trees". When you play, you acquire basic skills that you build upon to "level up" and get new skills, which you use to acquire new ones and "level up" again. And so on.
Becoming a programmer is a little like adding to your skill tree. You get some basic skills, you practice them until they're second nature, and then you get new skills, and so on, and then you are progressing along your chosen skill tree.
You'll find you'll encounter more than one skill tree. Open source has many entry points and many individuals with their own unique strengths, talents, and interests. However, certain definable skills contribute to being a great programmer, and developing them is an important part of participating successfully in open source projects.
### Scripting
![Scroll--How to program ](https://opensource.com/sites/default/files/scroll.png "Scroll--How to program")
One of the biggest advantages of a POSIX system like Linux or BSD is that every time you use your computer, you've got the opportunity to practice a little programming. If you have no idea where to start programming, then begin with how you work. Find repetitive tasks that you perform every day, and start automating them. This step can be something simple, like converting or re-sizing batches of photos, checking email, or even just getting the five applications you use each day launched with one click. Whatever the task, take the time to automate something for yourself.
If you can do something from a terminal, then it can be scripted. Learn `bash` or `tsch` and let system scripting be your introduction to writing code and to how your system works.
### Sysadmin
![Caesar head](https://opensource.com/sites/default/files/caesar_0.png "Caesar head")
From this point, you can continue on to become a programmer, or you can cross over to a different skill tree entirely: that of systems administration. The two careers have some overlap (a good sysadmin ought to have a little programming experience, and should be ready to wield Python, Perl, or a similar language to develop unique solutions), but a _programmer_ is someone who builds with code day in and day out.
### Programmer
![Wizard hat--How to program](https://opensource.com/sites/default/files/pointy-hat.png "Wizard hat--How to program")
Open source is a great way to learn programming skills; you get to look at other people's code, borrow ideas and techniques, learn from their mistakes, get a critique of your own code, and if you use Linux or BSD, the _entire_ stack is open to you—as far as the eye can see, it's all yours for the taking.
That's what the travel brochure says, anyway. The reality is that you're probably not going to start digging into the source code of a project and come out the other side with the sudden realization that you accidentally learned to code. Programming is hard work. If it wasn't, everyone would do it.
Luckily, programming is logical and structured, so it builds upon itself. You might not fall into programming, but the more you poke at it, the more you start to understand it.
Understanding how to control and automate a computer is one thing, but knowing how to write the stuff that other people want to automate is the point that you cross over into the realm of _programming_.
### Polyglot
![Parrot--How to Program](https://opensource.com/sites/default/files/parrot-head.png "Parrot--How to Program")
All programming languages aim to do the same thing: make computers compute. Choosing one is a mix of what you think you want to do, what (if any) language is in common use in the industry you are targeting, and what language you happen to best understand given the materials available to you and your learning style.
With a little bit of research, you can get a good idea of a language's complexity, and then decide what to try first based on your own level of comfort.
Another way to choose a language is to look at your goal, find out if other people are working toward the same thing, and then look at what they're using. If your aim is to develop desktop tools, you might learn C and Vala for one, or C++ for another.
At the end of the day, though, don't get overwhelmed with all the available choices. Languages stack well. Once you learn one programming language well enough to fall back on it when you need to get something done, you'll find it a lot easier to pick up another one. A "language" is just a set of syntax and rules, after all; learn one, and it's fairly trivial to superimpose new rules over the same theory.
The primary goal is to learn a language. Pick the one that makes sense to you or the one that's most appealing to you or the one that your friends are using or the one that has the documentation you understand best, but focus on one and learn it.
### Open Whazzit?
Whether or not you're just learning to program or you're an old pro just getting into open source, before jumping head first into this brave new world, you need to learn what makes open source, well, "open source."
Claiming software is open source is the latest marketing approach some software vendors are wielding. Unfortunately, some vendors just mean they've released a public API or that they're receptive ("open") to suggestions from their users. The word "open" isn't trademarked and no committee governs how or when the word is used. However, the [Open Source Initiative][4], co-founded by the late Ian Murdock of Debian Linux, [defines][5] what open source means (licenses that "allow software to be freely used, modified, and shared"), and formally approves and [tracks][6]licenses deemed truly "open."
Apply one of those licenses to your code, and you're an open source programmer. Congratulations!
### Community
![Community--How to program](https://opensource.com/sites/default/files/minions.png "Community--How to program")
Ask any open source enthusiast and they'll tell you the most important thing about open software is the people. Without motivated contributors, software stagnates. Computers need users, bug reporters, designers, and programmers.
If you want to join or cultivate the global open source community, you need to become a part of the community, even if you're not a people person. This usually encompasses subscribing to mailing lists, joining IRC channels, or hopping onto forums, and starting at the bottom of the totem pole. Any mature community has been around long enough to see prospective members come and go, so you have to understand that when you saunter in ready to change their world, before they all agree to your master plan, you have to prove that you're not going to disappear after three months when something sparkly on the other side of the Net catches your eye. Be ready for the long haul if you aspire to something big.
If you're just around to lend a hand, then that's acceptable, too. I myself have submitted small patches to projects, and sometimes the project leads think these are good and other times they reject them. If the rejected patch is important to me, I maintain it for myself and clients, and otherwise I move forward.
It's part of the process.
Where do these communities exist? It depends on the project. Some projects have dedicated community managers who help bring everyone together in public spaces for everyone to see. Other projects form around forums, use mailing lists, or even issue trackers. Look for the communities, and you'll find them.
Just as importantly, though, look at the code! They call it open "source" for a reason, so be sure to find the code and take a peek. Even if it's still above your level of full comprehension, it gives you an idea of how the software project organizes itself and possibly where they might need assistance. How is the code organized? Does the code have comments? Is it tidy with a consistent style? Review the documentation, particularly the README, LICENSE, or COPYING files.
Don't under estimate the importance of following through on the promise of open code. It's the reason you're getting involved, so look at it critically from every angle to see what you can learn from it and how you might contribute.
Finding the best community is a lot like dating, but specifically it's like dating in [Groundhog Day][7]. It takes time, and the first couple of tries might fall flat. The more you go through the process, the more you start to feel déjà vu. Eventually, though, you learn enough about yourself and your interests, you find the right combination of other people, and you settle in somewhere. Have patience, and let it happen naturally.
### Actions > Words
![Wingfoot--How to Program](https://opensource.com/sites/default/files/wingfoot.png "Wingfoot--How to Program")
Being an open source programmer is about the code (the "source" part of open source), and ideas are a dime a dozen. What speaks volumes is producing. You need to show you know what you're doing, willing to get your hands dirty, spend your time on the project, and can back up your ideas with something that compiles.
To do that effectively, of course, you should do your homework on the project itself, including learning how a project prefers to receive submissions and which branches are the stable and development ones.
To approach getting started:
* Get familiar with a project and its development culture, and be respectful of it.
* Write patches, bug fixes, or small, requested features, and submit them.
* Don't get discouraged if your work is rejected. You are not being rejected personally, your work was evaluated and the development team made a call.
* Don't get discouraged if your work is accepted, but changed beyond recognition.
* Rinse, repeat, and try new and bigger changes.
![Leaderboard--How to program](https://opensource.com/sites/default/files/leaderboard.png "Leaderboard--How to program")
There is no leaderboard in open source. Some sites try to make it seem like they have such a thing, but there isn't one. Participate, contribute, add to the pool of ideas, add to the stash of commits, and you're doing it right.
### Develop
![Treasure Map--How to Program](https://opensource.com/sites/default/files/treasure-map.png "Treasure Map--How to Program")
Programming in any environment is always, ultimately, about personal development. Whether you're searching for new ways of solving problems, looking for new ways to optimize code, learning a new language, or learning how to deal with other people better, you never want to stop growing. The more you develop yourself, the more a project benefits.
Growth, both personal and professional, is the final one on the list, but it actually persists through the entire process. Becoming an open source programmer isn't like getting a government job; it's a process. You learn, you share, you keep learning, you get distracted and write a [Game of Life][8] implementation, and you learn some more.
This process is what open source is about: the freedom to develop, in every sense of the word. So go find your skill tree, choose your super powers, pay your dues, level up, and get involved.
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/penguinmedallion200x200.png?itok=ROQSR50J)
Seth Kenlon - Seth Kenlon is an independent multimedia artist, free culture advocate, and UNIX geek. He is one of the maintainers of the Slackware-based multimedia production project, http://slackermedia.ml
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/how-get-started-open-source-programmer
作者:[Seth Kenlon][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/seth
[1]:https://www.flickr.com/photos/zagrev/79470567/in/photolist-82iQc-pijuye-9CmY3Z-c1EJAf-4Y65Zt-dhLziB-51QVc-hjqkN-4rNTuC-5Mbvqi-5MfK13-7dh6AW-2fiSu7-48R7et-5sC5ck-qf1TE9-48R6qv-pXuSG9-KFBLJ-95jQ8U-jBR7-dhLpfV-5bCZVH-9vsPTT-bA2nvP-bn7cWw-d7j8q-ubap-pij32X-7WT6iw-dcZZm2-3knisv-4dgN2f-bc6V1-E9xar-EovvU-6T71Mg-pi5zwE-5SR26m-dPKXrn-HFyzb-3aJF9W-7Rvz19-zbewj-xMsv-7MFi3u-2mVokJ-nsVAx-7g5k-4jCbbP
[2]:https://creativecommons.org/licenses/by-nc-sa/2.0/
[3]:https://en.wikipedia.org/wiki/Turtles_all_the_way_down
[4]:http://opensource.org/
[5]:https://opensource.org/licenses
[6]:https://opensource.org/licenses/category
[7]:https://en.wikipedia.org/wiki/Groundhog_Day_(film)
[8]:https://en.wikipedia.org/wiki/Conway's_Game_of_Life

View File

@ -1,105 +0,0 @@
# rusking translating
What engineers and marketers can learn from each other
============================================================
### Marketers think engineering is all math; engineers think marketing is all fluff. They're both wrong.
![What engineers and marketers can learn from each other](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_fortunecookie3.png?itok=dlRX4vO9 "What engineers and marketers can learn from each other")
Image by : 
opensource.com
After many years of practicing marketing in the B2B tech world, I think I've heard just about every misconception that engineers seem to have about marketers. Here are some of the more common:
* "Marketing is a waste of money that we should be putting into actual product development."
* "Those marketers just throw stuff against the wall and hope it sticks. Where's the discipline?"
* "Does anyone actually read this stuff?"
* "The best thing a marketer can tell me is how to unsubscribe, unfollow, and unfriend."
And here's my personal favorite:
_"Marketing is all fluff."_
That last one is simply incorrect—but more than that, It's actually a major impediment to innovation in our organizations today.
Let me explain why.
### Seeing my own reflection
I think these comments from engineers bother me so much because I see a bit of my former self in them.
You see, I was once as geeky as they come—and was proud of it. I hold a Bachelor's in electrical engineering from Rensselaer Polytechnic Institute, and began my professional career as an officer in the US Air Force during Desert Storm. There, I was in charge of developing and deploying a near real-time intelligence system that correlated several sources of data to create a picture of the battlefield.
After I left the Air Force, I planned to pursue a doctorate from MIT. But my Colonel convinced me to take a look at their business school. "Are you really going to be in a lab?" he asked me. "Are you going to teach at a university? Jackie, you are gifted at orchestrating complex activities. I think you really need to look at MIT Sloan."
So I took his advice, believing I could still enroll in a few tech courses at MIT. Taking a marketing course, however, would certainly have been a step too far—a total waste of time. I continued to bring my analytical skills to bear on any problem put in front of me.
Soon after, I became a management consultant at The Boston Consulting Group. Throughout my six years there, I consistently heard the same feedback: "Jackie, you're not visionary enough. You're not thinking outside the box. You assume your analysis is going to point you to the answer."
And of course, I agreed with them—because that's the way the world works, isn't it? What I realize now (and wish I'd discovered out far earlier) is that by taking this approach I was missing something pivotal: the open mind, the art, the emotion—the human and creative elements.
All this became much more apparent when I joined Delta Air Lines soon after September 11, 2001, and was asked to help lead consumer marketing. Marketing _definitely_ wasn't my thing, but I was willing to help however they needed me to.
But suddenly, my rulebook for achieving familiar results was turned upside down. Thousands of people (both inside and outside the airline) were involved in this problem. Emotions were running high. I was facing problems that required different kinds of solutions, answers I couldn't reach simply by crunching numbers.
That's when I learned—and quickly, because we had much work to do if we were going to pull Delta back up to where it deserved to be—that marketing can be as much a strategic, problem-oriented and user-centered function as engineering is, even if these two camps don't immediately recognize it.
### Two cultures
That "great divide" between engineering and marketing is deep indeed—so entrenched that it resembles what C.P. Snow once called[ the "two cultures" problem][1]. Scientifically minded engineers and artistically minded marketers tend to speak different languages, and they're acculturated to believe they value divergent things.
But the fact is that they're more similar than they might think.[ A recent study][2] from the University of Washington (co-sponsored by Microsoft, Google, and the National Science Foundation) identified "what makes a great software engineer," and (not surprisingly) the list of characteristics sounds like it could apply to great marketers, too. For example, the authors list traits like:
* Passion
* Open-mindedness
* Curiosity
* Cultivation of craft
* Ability to handle complexity
And these are just a few! Of course, not every characteristic on the list applies to marketers—but the Venn diagram connecting these "two cultures" is tighter than I believe most of us think. _Both_ are striving to solve complex user and/or customer challenges. They just take a different approach to doing it.
Reading this list got me thinking: _What if these two personalities understood each other just a little bit more? Would there be power in that?_
You bet. I've seen it firsthand at Red Hat, where I'm surrounded by people I'd have quickly dismissed as "crazy creatives" during my early days. And I'd be willing to bet that a marketer has (at one time or another) looked at an engineer and thought, "Look at this data nerd. Can't see the forest beyond the trees."
I now understand the power of having both perspectives in the same room. And in reality, engineers and marketers are _both_ working at the _intersection of customers, creativity, and analytics_. And if they could just learn to recognize the ways their personalities compliment each other, we could see tremendously positive results—results far more surprising and innovative than we'd see if we kept them isolated from one another.
### Listening to the crazies (and the nerds)
Case in point: _The Open Organization_.
In my role at Red Hat I spent much of my day thinking about how to extend and amplify our brand—but never in a million years would I have thought to do it by asking our CEO to write a book. That idea came from a cross-functional team of those "crazy creatives," a group of people I rely on to help me imagine new and innovative solutions to branding challenges.
When I heard the idea, I recognized it right away as a quintessentially Red Hat approach to our work: something that would be valuable to a community of practitioners, and something that helps spread the message of openness just a little farther. By prioritizing these two goals above all others, we'd reinforce Red Hat's position as a positive force in the open source world, a trusted expert ready to help customers navigate the turbulence of[ digital disruption][3].
Here's the clincher: _That's exactly the same spirit guiding Red Hat engineers tackling problems of code._ The group of Red Hatters urging me to help make _The Open Organization_ a reality demonstrated one of the very same motivations as the programmers that make up our internal and external communities: a desire to share.
In the end, bringing _The Open Organization_ to life required help from across the spectrum of skills—both the intensely analytic and the beautifully artistic. Everyone pitched in. The project only cemented my belief that engineers and marketers are more alike than different.
But it also reinforced something else: The realization that openness shows no bias, no preference for a culture of engineering or a culture of marketing. The idea of a more open world can inspire them both equally, and the passion it ignites ripples across the artificial boundaries we draw around our groups.
That hardly sounds like fluff to me.
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/portrait_jackieyeaney_400x600.jpg?itok=zV4bnrzI)
Jackie Yeaney - Chief Marketing Officer at Ellucian
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/17/1/engineers-marketers-can-learn
作者:[Jackie Yeaney][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jackie-yeaney
[1]:https://en.wikipedia.org/wiki/The_Two_Cultures#Implications_and_influence
[2]:https://faculty.washington.edu/ajko/papers/Li2015GreatEngineers.pdf
[3]:https://opensource.com/open-organization/16/7/future-belongs-open-leaders

View File

@ -1,131 +0,0 @@
translating by ypingcn
How to choose your first programming language
============================================================[
][1]
![How to choose your first programming language](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDU_OSDC_IntroOS_520x292_FINAL.png?itok=va-tdc8j "How to choose your first programming language")
Image by : 
opensource.com
The reasons for learning to program are as a varied as the people who want to learn. You might have a program you want to make, or maybe you just want to jump in. So, before choosing your first programming language, ask yourself: Where do you want that program to run? What do you want that program to do?
Your reasons for learning to code should inform your choice of a first language.
_In this article, I use "code," "program," and "develop" interchangeably as verbs, while "code," "program," "application," and "app" interchangeably as nouns. This is to reflect language usage you may hear._
### Know your device
Where your programs will run is a defining factor in your choice of language.
Desktop applications are the traditional software programs that run on a desktop or laptop computer. For these you'll be writing code that only runs on a single computer at a time. Mobile applications, known as apps, run on portable communications devices using iOS, Android, or other operating systems. Web applications are websites that function like applications.
Web development is often broken into two subcategories, based on the web's client-server architecture:
* Front-end programming, which is writing code that runs in the web browser itself. This is the part that faces the user, or the "front end" of the program. It's sometimes called "client-side" programming, because the web browser is the client half of the web's client-server architecture. The web browser runs on your local computer or device.
* Back-end programming, which is also known as "server-side" programming, the code written runs on a server, which is a computer you don't have physical access to.
### What to create
Programming is a broad discipline and can be used in a variety of fields. Common examples include:
* data science,
* web development,
* game development, and
* work automation of various types.
Now that we've looked at why and where you want to  program, let's look at two great languages for beginners.
### Python
[Python][2] is one of the most popular languages for first-time programmers, and that is not by accident. Python is a general-purpose language. This means it can be used for a wide range of programming tasks. There's almost _nothing_ you can't do with Python. This lets a wide range of beginners make practical use of the language. Additionally, Python has two key design features that make it great for new programmers: a clear, English-like [syntax][3] and an emphasis on code [readability][4].
A language's syntax is essentially what you type to make the language perform. This can include words, special characters (like `;`, `$`, `%`, or `{}`), white space, or any combination. Python uses English for as much of this as possible, unlike other languages, which often use punctuation or special characters. As a result, Python reads much more like a natural, human language. This helps new programmers focus on solving problems, and they spend less time struggling with the specifics of the language itself.
Combined with that clear syntax is a focus on readability. When writing code, you'll create logical "blocks" of code, sections of code that work together for some related purpose. In many languages, those blocks are marked (or delimited) by special characters. They may be enclosed in `{}` or some other character. The combination of block-delimiting characters and your ability to write your code in almost any fashion can decrease readability. Let's look at an example.
Here's a small function, called "fun," which takes a number, `x` as its input. If `x`equals **0**, it runs another function called `no_fun` (which does something that's no fun). That function takes no input. Otherwise, it runs the function `big_fun`, using the same input, `x`.
This function defined in the ["C" language][5] could be written like this:
```
void fun(int x)
{
if (x == 0) {
no_fun();
} else {
big_fun(x);
}
}
```
or, like this:
```
void fun(int x) { if (x == 0) {no_fun(); } else {big_fun(x); }}
```
Both are functionally equivalent and both will run. The `{}` and `;` tell us where different parts of the block are; however, one is _clearly_ more readable to a human. Contrast that with the same function in Python:
```
def fun(x):
if x == 0:
no_fun()
else:
big_fun(x)
```
In this case, there's only one option. If the code isn't structured this way, it won't work, so if you have code that works, you have code that's readable. Also, notice the difference in syntax. Other than `def`, the words in the Python code are English and would be clear to a broad audience. In the C language example `void` and `int` are less intuitive.
Python also has an excellent ecosystem. This means two things. First, you have a large, active community of people using the language you can turn to when you need help and guidance. Second, it has a large number of preexisiting libraries, which are chunks of code that perform special functions. These range from advanced mathematical processing to graphics to computer vision to almost anything you can imagine.
Python has two drawbacks to it being your first language. The first is that it can sometimes be tricky to install, especially on computers running Windows. (If you have a Mac or a Linux computer, Python is already installed.) Although this issue isn't insurmountable, and the situation is improving all the time, it can be a deterrent for some people. The second drawback is for people who specifically want to build websites. While there are projects written in Python (like [Django][6] and [Flask][7]) that let you build websites, there aren't many options for writing Python that will run in a web browser. It is primarily a back-end or server-side language.
### JavaScript
If you know your primary reason for learning to program is to build websites, [JavaScript][8] may be the best choice for you. JavaScript is _the_ language of the web. Besides being the default language of the web, JavaScript has a few advantages as a beginner language.
First, there's nothing to install. You can open any text editor (like Notepad on Windows, but not a word processor like Microsoft Word) and start typing JavaScript. The code will run in your web browser. Most modern web browsers have a JavaScript engine built in, so your code will run on almost any computer and a lot of mobile devices. The fact that you can run your code immediately in a web browser provides a _very_ fast feedback loop, which is good for new coders. You can try something and see the results very quickly.
While JavaScript started life as a front-end language, an environment called [Node.js][9] lets you write code that runs in a web browser or on a server. Now JavaScript can be used as a front-end or back-end language. This has led to an increase in its popularity. JavaScript also has a huge number of packages that provide added functionality to the core language, allowing it to be used as a general-purpose language, and not just as the language of web development. Like Python, JavaScript has a vibrant, active ecosystem.
Despite these strengths, JavaScript is not without its drawbacks for new programmers. The [syntax of JavaScript][10] is not as clear or English-like as Python. It's much more like the C example above. It also doesn't have readability as a key design principle.
### Making a choice
It's hard to go wrong with either Python or JavaScript as your first language. The key factor is what you intend to do. Why are you learning to code? Your answer should influence your decision most heavily. If you're looking to make contributions to open source, you will find a _huge_ number of projects written in both languages. In addition, many projects that aren't primarily written in JavaScript still make use of it for their front-end component. As you're making a choice, don't forget about your local community. Do you have friends or co-workers who use either of these languages? For a new coder, having live support is very important.
Good luck and happy coding.
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/kojo_headshot_pro_square.jpg?itok=jv1kT8T0)
Kojo Idrissa - I'm a new software developer (1 year) who changed careers from accounting and university teaching. I've been a fan of Open Source software since around the time the term was coined, but I didn't have a NEED to do much coding in my prior careers. Tech-wise, I focus on Python, automated testing, and learning Django. I hope to learn more JavaScript soon. Topic-wise, I like to focus on helping new people get started with programing or getting involved in contributing to Open Source projects. I also focus on inclusive culture in tech environments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/choosing-your-first-programming-language
作者:[Kojo Idrissa][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/transitionkojo
[1]:https://opensource.com/article/17/1/choosing-your-first-programming-language?rate=fWoYXudAZ59IkAKZ8n5lQpsa4bErlSzDEo512Al6Onk
[2]:https://www.python.org/about/
[3]:https://en.wikipedia.org/wiki/Python_syntax_and_semantics
[4]:https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Indentation
[5]:https://en.wikipedia.org/wiki/C_(programming_language
[6]:https://www.djangoproject.com/
[7]:http://flask.pocoo.org/
[8]:https://en.wikipedia.org/wiki/JavaScript
[9]:https://nodejs.org/en/
[10]:https://en.wikipedia.org/wiki/JavaScript_syntax#Basics

View File

@ -1,3 +1,6 @@
translating by ynmlml
Tips for non-native English speakers working on open source projects
============================================================
![Tips for non-native English speakers working on open source projects](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/world_hands_diversity.png?itok=LMT5xbxJ "Tips for non-native English speakers working on open source projects")

View File

@ -0,0 +1,76 @@
Translating by scoutydren
Can academic faculty members teach with Wikipedia?
============================================================
![Can academic faculty members teach with Wikipedia?](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDU_academics_520x292_ma.png?itok=9xFWOct6 "Can academic faculty members teach with Wikipedia?")
Image by : 
opensource.com
Since 2010, 29,000 students have completed the Wiki Ed program. They have added 25 million words to Wikipedia, or the equivalent of 85,000 printed pages of content. This is 66% of the total words in the last print edition of Encyclopedia Britannica. When Wiki Ed students are most active, they are contributing 10% of all the content being added to underdeveloped, academic content areas on Wikipedia.
Eager to learn more I contacted LiAnna Davis, director of Programs for Wiki Ed, who enthusiastically agreed to answer my questions.
Bonus: [Wiki Education Foundation (Wiki Ed)][1]'s platform is built on free software; find it at [WikiEdu Dashboard GitHub][2].
**How did Wiki Ed get started? Tell us a little bit about your background and how you got involved.**
In 2010, the [Wikimedia Foundation][3] (WMF, the nonprofit that runs Wikipedia) noticed a trend that university faculty who were also Wikipedia editors (Wikipedians) were successfully incorporating Wikipedia editing assignments into their classes. WMF created a pilot program to answer the question: Can non-Wikipedian faculty members teach with Wikipedia if they have enough support for the Wikipedia editing portion of the course?
I was part of the team hired in 2010 to work on the pilot and the answer we provided was a resounding "Yes." In 2013, the WMF spun off the American and Canadian versions of the program into a new nonprofit organization, the Wiki Education Foundation (Wiki Ed); I moved from WMF to Wiki Ed. Since we became our own organization, we've been able to focus on the program and grow its impact from 75 classes each year when the program was with WMF to 275 classes this term.
**People automatically assume that college students are savvy in all things tech related, especially the Internet, but your website says, "University undergraduates may be tech-savvy, but that doesn't always mean they're digitally literate." Can you explain that?**
Just because someone can figure out how to use their iPhone doesn't mean they can tell whether something they read online is trustworthy or not. As a [Stanford study][4] ("Evaluating Information: The Cornerstone of Civic Online Reasoning November 22, 2016.") recently showed, students aren't very media literate. However, when students are writing Wikipedia articles, they have to be. They need to follow Wikipedia's [Reliable Source][5] guideline, which says information on Wikipedia must be cited to a source that goes through some sort of fact checking, is independent, etc. For many students, such sourcing is the first time they've had to do more than just Google their topic and cite the first source they see. They need to understand which sources are reliable and which aren't, and they become more digitally literate consumers of information.
**What do you say to those who make the statement: "Wikipedia isn't a reliable source."**
Wikipedia is an encyclopedia, which is by definition a tertiary source. By the time students reach undergrad, they should be consulting primary and secondary sources, not tertiary sources, so no, students shouldn't be citing Wikipedia. But it's a great place to start your research, to give yourself a broad overview of a subject, and discover links to sources at the bottom of the article that you can consult. As we like to say, "Don't cite it! Write it!"
>It puts students into the position of producers of knowledge, not just consumers of knowledge...
**How can a professor's involvement in Wiki Ed change a student's learning experience higher education?**
By teaching with Wikipedia, instructors provide students with valuable media literacy, critical thinking, online communications, and writing skills that they need to succeed, whether they continue in academia or enter the workforce upon graduation. It puts students into the position of producers of knowledge, not just consumers of knowledge, and gives them a meaningful assignment that actually makes a difference in the world, not just a rote academic exercise that gets thrown away at the end of a term.
We're actively onboarding new classes for the spring term. Interested faculty should visit [the Wikipedia Education Foundation's Teach page][6] to get started.
**What staff development is needed for a teacher to participate? How much training is necessary for students?**
When you sign up on [the Wikipedia Education Foundation's Teach page][7], Wiki Ed provides an online orientation for new faculty on the basics of how to teach with Wikipedia. We also have a series of online training modules that we automatically assign to students based on the specific assignment (for example, if you want your students to add images, they'll get a module on images; if you don't, they won't). In a dozen disciplines, we also have specific guidebooks showing how to edit in that topic area on Wikipedia. In addition, we have staff who are experienced Wikipedia editors who can help answer students' and instructors' questions. Our system is quite extensive now; we supported more than 6,300 students this fall term, and we're used to working with faculty who have no experience editing Wikipedia, so that shouldn't keep anyone from doing the assignment.
**What are Visiting Scholars?**
Our program to encourage teaching with Wikipedia isn't the only connection we make between Wikipedia and academia. In the Visiting Scholars program, a university library or department will open up access to their collection to an established Wikipedia editor (called a "Visiting Scholar") who is lacking sources. Using this university login, the Visiting Scholar will have access to sources, so they can improve articles in broad subject areas of interest to the institution. It's a small but mighty program, because it takes a lot of work to get set up, but the Scholars produce a lot of truly fabulous content on Wikipedia.
**Who are your partners and how important is their involvement to your success now and in the future?**
We partner with academic associations who see the value in our work as a service to their discipline. Let's face it: when people want information about a topic, they don't go read the peer-reviewed journal articles published by those associations, they go to Wikipedia. By encouraging faculty in these associations to teach with Wikipedia, they're improving information on Wikipedia in those subject matters. Our partners enable us to reach large numbers of potential new faculty members, and enable us to dramatically improve content in a specific subject area through a partnership.
We welcome donations at [on our Support Us page][8] if your readers want to support our work.
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/donw2-crop.jpg?itok=OqOYd3A8)
Don Watkins - Educator, education technology specialist, entrepreneur, open source advocate. M.A. in Educational Psychology, MSED in Educational Leadership, Linux system administrator, CCNA, virtualization using Virtual Box and VMware. Follow me at @Don_Watkins .
via: https://opensource.com/article/17/1/Wiki-Education-Foundation
作者:[Don Watkins][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/don-watkins
[1]:https://wikiedu.org/
[2]:https://github.com/WikiEducationFoundation/WikiEduDashboard
[3]:https://wikimediafoundation.org/wiki/Home
[4]:https://sheg.stanford.edu/upload/V3LessonPlans/Executive%20Summary%2011.21.16.pdf
[5]:https://en.wikipedia.org/wiki/Wikipedia:Identifying_reliable_sources
[6]:https://teach.wikiedu.org/
[7]:http://teach.wikiedu.org/
[8]:http://wikiedu.org/donate

View File

@ -0,0 +1,311 @@
#rusking translating
# Arch Linux on a Lenovo Yoga 900
_Warning: this is about 5,500 words with plenty of interesting links, so wait till youve got something to drink and some time._
After 3 years running Arch Linux on a [Lenovo Yoga 2][2], I decided to upgrade to a Yoga 900:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-1.jpg)
_Lenovo Yoga 900 [Amazon special][1] for $925 8GB RAM, 256GB SSD, 3200×1800, Intel Skylake 3.2GHz + Iris Graphics_
Dell charges $1650 for a [similar XPS 13][3] albeit with the next generation of Intel chip. The current model of Yoga is the 910, and that laptop costs $1300\. However, I didnt even consider it because they screwed the pooch on the keyboard. Lots of reviews start with the color and feel of the materials on the outside, but Im going to start on the keyboard layout.
### Keyboard
The Yoga 2 Pro and the Yoga 900 have the same design. It is inferior in several ways compared to the traditional and well-regarded IBM Thinkpad keyboards, but not the worst keyboard out there and I got used to it over the 3 years. Unfortunately, Lenovo made things worse in the 910.
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-2.png)
_Yoga 2 and Yoga 900 keyboard layout _
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-3.png)
_Yoga 910 keyboard_
The problem with the 910 keyboard is that the right-shift key is in the wrong place, and impossible to reach without moving your hand. It is in a different position than every keyboard Ive ever used going back to 9<sup>th</sup> grade typing class on the IBM Selectric. Id expect such a mistake from a company like Asus or Dell, not a company with the legacy of building typewriters that generations of Americans learned and worked on.
Every year the Yoga team has made changes to the layout. Imagine if every year in the 20<sup>th</sup> century, IBM had changed the layout of their typewriters, and then bragged about the “[efficiency][4]” gains. The company wouldnt even be around today!
I probably could get used to the Yoga 910 page up / page down overloaded with arrow keys, and some of the other changes, but the shift-key is a deal breaker and Id rather not bother with the others.
There are many ways for Lenovo to truly improve their keyboard, such as making the volume-up key not so close to application-close. And re-thinking whether they really need an easy way to (accidentally) turn off the screen given there is already a way to dim it. And figuring out how to put in an overloaded number pad. Does Lenovo think only businesses deal with numbers?
The 910 keyboard has so many changes, they might not ever go back to their old layouts again. Im hoping this hardware will last me years. Id rather have a great keyboard than a computer 10 times faster.
I see in the Yoga 910 reviews on the Lenovo website that some people are returning the computer because of the keyboard. Lenovo should have a policy: if an employee wanted to make an alteration to the keyboard, they should have to write down a **very ****good** reason, and then sacrifice one of their fingers in solidarity with the pain it will cause customers. A rule like that would decrease this needless churn. Lenovo went through a lot of work make the Yoga 910, but f*cked it up with the input mechanism.
### Overall
The Yoga 2 was generally fast enough for everything I needed to do. An SSD is nice for various reasons, but it is almost overkill on Arch. People who only use Windows might not realize how bloated it is:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-4.png)
In the late 90s, youd get a new computer every few years because the processors were doubling in speed every 18 months, and the software was doubling in size frequently as well. Things are very different now. The new Yoga is 30% faster than my Yoga 2 running integer benchmarks. This is a 3.2 GHz machine whereas the old one maxed out at 2.6 GHz so most of the difference is the faster frequency.
Haswell was introduced in 2013, and Skylake was introduced in 2015 so two years of advancement is the other part of the improvements. The big benefit of the new processor is that it is built in 14nm instead of 22nm which means less heat and longer battery life. My old Yoga 2 battery was still giving me about 3.5 hours of battery life with moderate brightness, but this should give me 7.
The Yoga 2 hinge is starting to weaken and fall apart, and there is no way to tighten it, only to try to find one on the Internet or mail it to Lenovo:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-5.png)
The hinge on Yogas is designed to let you lay the device flat, and even fold it back as a tablet, but I found it a heavy and awkward and so never bothered. Im just happy if Ill be able to open and close it daily for years.
The Yoga 900 hinge is a more solid watchband design and should last longer:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-6-1.jpg)
The only very minor downside is that if you shake it, it sounds like youve got broken parts rattling around inside, which usually is something to be worried about for electronics! However, its just a false alarm of the 800 pieces sliding.
The Yoga 2 Pro was overall a quite well-built device, but if I hold it in one hand with the screen open, it sags a bit, and sometimes the keyboard backlight goes out. Both Yogas are thin and light, but the 900 feels more solid.
### Clickpad
The biggest problem with the Yoga 2 was the Synaptics Clickpad it used. It actually wasnt the hardware, it was the driver, which is basically unmaintained, and of course had some bugs. Its a shame because Synaptics could easily afford one engineer to help maintain a few thousand lines of code. They actually wrote another driver, they just never released it freely so it could be included with the kernel.
However, a new library called [Libinput][5] was created, and they support Clickpads and things work well out of the box now. The best thing about Libinput is that they fixed the bug where if you have your left finger touching in the mouse-click area, it will now register pointer movements by your right finger. Its hard to believe, but that basic functionality was broken for many years with Synaptics hardware on Linux.
The Clickpad hardware was still working fine, but it didnt give any audible click sound anymore. That actually isnt a problem, but it did make me wonder if it was going to wear out at some point. The old Thinkpads had multiple left and right mouse buttons, so if one broke, you could use the other while you ordered a new part, but since theres only one button here, there is no backup except to plug a mouse in. (Lenovo expects you to mail in the computer to get a new mouse.)
### Kernel Support
When I bought the Haswell laptop, the hardware design was brand new, so I ran into a lot of Linux driver problems initially that took months to resolve. In this generation, Skylake crashing bugs were still being fixed [8 months after the architecture was introduced,][6] but now it appears theyve all been resolved. And even when those were fixed, there were still problems with [power management support,][7] but today these also appear to be improved. The laptop will settle into the lower power C6-C10 states if nothing is going on. (This is verifiable with **powertop**.)
The power management features are important not only for battery life, but because these very small circuits eventually wear out because of something known as [electromigration][8]. Intel even warns that: “Long term reliability cannot be assured unless all the Low-Power Idle States are enabled.” By running in lower power mode, and therefore using the circuits less, they will last longer.
Linuxs Haswell support is very reliable now, but it was definitely flakey for a long time. I wrote about some of the issues at the beginning and after the first year, but I can say finally that things are great for Haswell and Skylake.
### Lenovo BIOS Linux Incompatibility
Before I could install Linux on the Yoga 900, I had to flash a new BIOS in Windows. In fact, I had to install 2 BIOSes. The latest Yoga 900 BIOS didnt [include][9] the necessary fix I needed, so after scratching my head for a while I eventually discovered and [installed][10] a separate “Linux-only” BIOS update, which also says that Windows is no longer supported by Lenovo: “Are we not [merciful][11]?”
As people who followed the Linux news are aware, the Yoga 900 and certain other recent models of Lenovo laptops were impossible to install Linux on, because it couldnt even [detect the hard drive][12]. Lenovos first reply was that the laptops didnt work on Linux because it uses a [new RAID controller mode][13]. However, RAID is meant for multiple disks, and this laptop only has one hard drive, and there isnt even room to install another.
Heres some more of Lenovos [official explanation][14]:
> “To support our Yoga products and our industry-leading 360-hinge design in the best way possible we have used a storage controller mode that is unfortunately not supported by Linux and as a result, does not allow Linux to be installed.”
I found it funny that the reason for their different storage controller is because of their hinge! It would be like a car company saying they had to change their rims because of their new radio.
This turned into a controversy thanks to the efforts of [Baron][15][H][16][K][17] on Reddit who wrote about it, provided information to the media, and contacted his local Attorney General in Illinois. Searching for “[Lenovo Yoga ][18][L][19][inux compatibility][20]” turns up 300,000 results. Lenovo could be criminally liable for selling a “general purpose” PC that didnt let you install your own operating system. The default OS is meaningless on a machine that is truly mine.
Hackers got involved, and they eventually discovered via playing with the UEFI settings, that the machine still supported the AHCI controller mode, it was just disabled. In short, Lenovo took away Linux compatibility for no good purpose. Because of all the information people learned, if this case had ever gone to court, Lenovo would have gotten their ass handed to them.
Fortunately, all the news got their attention, and they eventually updated the BIOS. I type this on a Yoga 900 running Linux, so we should celebrate this victory. Lets hope they learn a lesson, but Im not optimistic. They ought to offer you an option to choose the operating system for your machine. They would have found this bug long before any customers did. Id wait an extra week to get a custom computer. They could also do a better job setting up the partitions and letting people customize lots of things, and grabbing all the latest software, rather than using a generic old image which needs lots of updates.
Some people like Lenovo said it was Linuxs fault for not supporting this new RAID driver mode. However, AHCI is a very popular standard, and the Linux kernel team rejected Intels code for this hardware as “[too ugly to live][21]”! The team also asked Intel for a specification describing the devices behavior, but wasnt given this information.
### Heat Dissipation
The Yoga 2 could get hot when pushing the CPUs hard. I charred the bottom of the plastic case while compiling LibreOffice on a blanket, which was an eyesore and made me look like a homeless programmer. I tried a metal brush and some turpentine to get the worst of it off, but it didnt really improve the situation:
![](http://keithcu.com/wordpress/wp-content/uploads/2015/04/20150327_135649-2.jpg)
This new computer has a metal case which shouldnt get discolored, and Skylake definitely runs cooler than Haswell. It also seems to do better job of pushing heat out sideways through the hinge, instead of down which could easily be obstructed.
One of the annoying things about the Yoga 2 over time is that the fan blades had collected dust over the years, but it sounded like sand! It was uneven and distracting and made it much louder. I did take the laptop apart and vacuum everything, but the blades are hidden. Id have to replace the fans. They dont run on the Yoga 2 for typical tasks of word processing and web browsing, but when they do spin up its annoying if Im not wearing headphones.
The Yoga 900 fans are higher pitch, but it is just a smooth whir and not distracting. The Yoga 900 fans seem to run all the time, but at a low speed that is quiet. The sound of my refrigerator and air filter are louder unless the fans crank up under load, and even then it is not a big deal.
### Graphics
The Yoga 2 had a great screen, but it also had widely reported issues because the yellow looked like orange. However, everything looked so crisp and all the other colors looked fine. The Yoga 900 screen has fixed the yellow issue. Its not true 4K, being only 3200×1800, but the pixels are smaller than 4K on a 15.6” monitor, so that it looks very sharp.
When I first got the Yoga 2, Haswell was still a new chipset, so I saw various Intel graphics display glitches which went away within a couple of months. However, I eventually discovered a memory leak that could crash Linux, and this bug was in there for years.
My computer ran out of RAM a number of times skipping through video in VLC (shift + arrow). The memory didnt show up as in use by VLC, but my computer ran out of RAM, so clearly it was kernel memory. Eventually I setup a swap file which gave more time, but even then a couple of times it filled up when I wasnt keeping track. Eventually the bug disappeared, and Linux is very stable right now, but it was there for years.
Everyone says Intel has the best Linux drivers, but they seem like a skunkworks project inside Microsoft. The driver developers working on Linux at Intel are good, there just arent enough of them. They should be perfecting the drivers before they release the hardware! Intel produced [1][22][13][23] [processors][24] as part of Skylake, with subtle feature differences. That sounds like a lot, but they released 256 chips during the [Haswell generation][25], so maybe things are getting more focused. I was told 10 years ago by an Intel employee that they invested 1% into Linux compared to Windows, and today that still seems to be true.
The only performance issue I ran into with the Yoga 2 was that it couldnt play 4K video reliably. It would often show screen glitches, or just do around 5 frames per second:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/VlcGlitch.jpg)
The Yoga 2 would even sometimes struggle playing 1920×1080 video, which it was supposed to be able to handle at 60fps. Part of this is probably because I always have other applications like Firefox and LibreOffice running.
The Skylake processor is speced to do 4K video at 60 fps for H.264, VP9, and other codecs. In fact, the processor has a lot of hardware accelerated [multimedia][26][capabilities][27]. I tried out hardware encoding of H264 with **ffmpeg** and found it was 4 times faster while using just 1 CPU. Its cool to see this feature. Unfortunately, it is a little annoying to setup because you have to use a number of additional command line parameters:
“**-threads 1 -vaapi_device /dev/dri/renderD128 -vcodec h264_vaapi -vf format=nv12|vaapi,hwupload**”
I tried to find a way to have **ffmpeg** remember these for me so I wouldnt have to type it in every time, but couldnt. I cant just pass those in automatically either, as other things need to go before and after. I also discovered that it wont resize video while using the hardware, and will just ignore the request, so only sometimes can it be used. It would be really great if **ffmpeg** could figure this out automatically. There is a lot of unused hardware because users dont know or cant be bothered. Unfortunately [its kind of a mess][28] for video encoding and decoding as there are multiple APIs for Linux and Windows.
Skylake does a much better job playing 4K video, but it will still glitch sometimes and briefly drop down to 10 fps. I think part of it is X. I tried playing 4K videos in Wayland, and it was smoother, so Im hopeful. It is great to see that the OpenGL support has improved. On this hardware, Intel supports version 4.5 which is the latest version from 2014.
My Yoga 900 (-13ISK2) is actually a revised version of the original offering with an Iris 540 graphics co-processor which is supposed to be [faster][29] than the stock 520 because of 24 more shader units. However, it can only play SuperTuxKart with moderate settings running 1600×900 at 20 fps, so I wouldnt say its anything to brag about yet. Speaking of which, the game has improved tremendously over the years and is beautiful now:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Screenshot-from-2017-01-10-17-03-57.png)
There is an Intel team in China working on [enabling][30] support OpenCL using the graphics card. However, I dont see any mention of people using it in Blender yet, so I wonder the status and whether it is just demoware. Intels OpenCL support has been missing for so long, people doing serious work with Blender already use NVidia or AMD cards, and even when Intel finally writes the code, theres not much testing or interest.
One thing that was surprising to me is that I did some experiments on another machine, and found that a quad-core processor is faster than the NVidia 960M for ray-tracing with the Cycles engine. Apparently the 640 CUDA cores arent enough to beat 4 Intel CPUs on that task. Newer processors have 2000+ cores and those provide faster performance.
### HiDPI
The situation has gotten better for Linux on these high-res screens over the last 3 years, but it still has a ways to go. The good news is that Gnome is almost perfect with HiDPI in current versions. Firefox generally looks great if you set the **layout.css.devPixelsPerPx** to 2\. However because this 13.3” screens pixels are so small, I also install a No-Squint Plus plugin and have it render everything at 120% to make it a bit easier to read.
I was happy to help LibreOffice look better on these screens with [some patches][31] that were shipped in April, 2014, and the work has continued since. The biggest issue remaining is that LibreOffice is still doubling toolbar icons. A number of themes have SVG icons, but they arent packaged and shipped with the product. SVGs are much slower to load compared to PNGs and need to be cached. [Tomaž Vajngerl has done some more work][32] in this area, but it hasnt released yet. Even so, LibreOffice looks better than many other Linux apps which dont have recognizable icons.
Applications are generally improving with regards to detecting and being usable on high-res screens, but even some of the most popular such as Gimp and Audacity and Inkscape are still hard to use. I installed a large custom theme for Gimp, but all the icons are different so even though they are bigger, it takes time to recognize them.
The unfortunate thing about Linuxs 1.5% marketshare is that these sorts of issues dont get much priority. Many codebases are moving to GTK 3, but in Audacitys case, it seems to be [stalled][33]. I talked in my first review about a long tail of applications that will need improvements but 3 years later, even some of the most popular apps still need work.
### SSD
The old hard drive was doing fine because of the various optimizations I did, especially to Firefox. I also kept in mind that the **/tmp** directory had automatically been setup as a RAM drive, and so I would usually save downloads there first. Sometimes Id find a 500 MB video I want to grab a short 20 MB clip from, or convert to another format, so by doing it in /tmp I saved a lot of writes. It is more work, and possibly unnecessary, but its faster to work in RAM.
I had written to each cell 25 times over the 3 years, which meant the drive could last for 350 years. The vast majority of the writes were for Arch updates. It gets new LibreOffice builds every month, and a new “stable” kernel release every week. It was great to be up to date all the time, but it did cost 100 times more writes compared to running Debian stable. However, given that each component has their own release cycle, it was necessary.
The new Samsung drive diagnostics dont tell the number of times it has written to each cell. In fact, I cant even find out what cell type it is and how many writes it is specified to handle. I believe the “Percentage Used” value will me the age of the drive, but perhaps it relates only to the number of spare cells. I havent found any documentation so I can only guess:
|||
|--|--|
| **Model Number:** | **SAMSUNG MZVLV256HCHP-000L2** |
| **Firmware Updates (0x06):** | **3 Slots** |
| **Available Spare:** | **100%** |
| **Available Spare Threshold:** | **10%** |
| **Percentage Used:** | **0%** |
| ****Data Units Written:**** | **198,997 [101 GB]** |
| **Data Units Written:** | **305,302 [156 GB]** |
| **Host Read Commands:** | **3,480,816** |
| **Host Write Commands:** | **10,176,457** |
| **Error Information Log Entries:** | **5** |
### Broken Left-Ctrl Key
One thing I noticed after just a few hours of use is that the left-control key pops off if pressed in the upper-left corner:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/Yoga900-7-1.png)
_Broken Yoga 900 key: Note the tiny cylinder missing in the left box vs the right
_
The layout of the Yoga 900 keyboard is the same as the Yoga 2 Pro, but the internals are different. The keys of the Yoga 2 Pro cannot be removed and replaced individually, and there is no way to pop off any of the keys without doing permanent damage. The Yoga 900 has the old style Thinkpad keys: which can be detached, and replaced individually.
However, there is a defect and one of the 4 tiny cylinder notches in the hinge was missing so that it only connects to the key top at 3 points, and if you dont press the key in the middle, it will slip off.
I contacted Lenovo about this. Even though the keys are replaceable and serviceable, they will only replace the entire keyboard, and refuse to mail out any parts. They recommend I mail the computer in, or take it to the Geek Squad service center. I knew that mailing it in would take 2 weeks, so I called my local store to ask if they had Yoga keyboard parts in stock. They told me they dont take the computers apart, they just mail them to Atlanta. There used to be places that could make many repairs to IBM laptops, and stocked the common parts, but that industry is apparently gone.
I noticed this mistake within a couple of hours of using the computer, so Im pretty sure it was a manufacturing defect. It is such a tiny piece of plastic that was deformed or broke off during assembly.
Even though the computer is under warranty and could be fixed for free, I didnt want to wait for something so minor, so I just went on the Internet and found a website called laptopkey.com and ordered a replacement key and hinge. It was actually tricky because there are 3 types of hinges! It took me several minutes to figure out which one my computer has because yall look the same to me:
![](http://keithcu.com/wordpress/wp-content/uploads/2017/01/BigHinges-2.jpg)
So I ordered the part, but I read it would arrive in about a week. It was very frustrating because I use left-Ctrl all the time when doing copy/paste, skipping through video or by word in text editors, etc. so I thought maybe I could swap the hinge from the right-ctrl, which I never use.
So I tried to remove this key following instructions I found on the Internet: I got my fingernail under the upper left corner, and lifted till it clicked. And then I put my nail under the upper right corner, and did the same thing. But another one of those tiny pieces of plastic broke off, so now I have two broken hinges. It might not be possible to remove the keys without breaking these very tiny clips. These keyboards are serviceable perhaps only in theory.
So I decided to go old-school and use superglue. Id rather have the damn key stay on and have no urgent plans to replace them. It was tricky because I needed a small dab of glue about 1mm in diameter: too much in there it could gum up the works.
My experience building R/C airplanes came in handy and I fixed it and now the left-Ctrl key is holding on. The right one still slips off but I hardly use it. I was happy again! This is a long sidetrack, but it is important to keep in mind maintenance of a machine.
### Antergos vs. Arch
After 3 years with Arch Linux, I had no interest in trying anything else. The Intel drivers had regressions, but otherwise Arch has been painless to run on a daily basis, and it got a little better every week. Its exciting to be up to date with everything. I often had packages newer than what was in Ubuntu on their release date. Ubuntu users can find newer software in custom PPAs, but there isnt any testing or coordination across them, so that people who use multiple run into problems.
People also complain about Ubuntu upgrades hosing the machine and forcing a re-install, so even though their installation process is quicker, the ongoing maintenance isnt. Every time Ive read about someone borking an Arch installation, they would always admit it was a user error or something like btrfs corruption.
I wanted to install [Antergos][34], which provides a GUI installer for Arch. However, the setup looked unreadable on my screen, and it didnt recognize the Clickpad in their minimal install, which is the only one I had space for on my old 1GB USB key. So I decided to just install Arch old-school again. Thankfully, the Yoga still supports legacy BIOS, so I didnt have to mess with [UEFI][35].
I was sorry I didnt try out Antergos, because I think it could be a great distro for less technical people or those who want to quickly get into Arch Linux. The Arch wiki is filled with tips for best running Linux. Id love to have something which setup weekly TRIM for my SSD, [Profile-Sync-Daemon][36], Android support, hardware-accelerated video playback, etc. There are quite a few things that nearly all users would want, and are just a few lines to detect and enable.
Manjaro is a very popular Arch-based distribution with a GUI installer, but having run Arch for 3 years, I trust their packagers to work out issues between components. Ive read a number of comments on Reddit from people who found their Manjaro installation broken after an update.
My only complaint about my Arch installation now is the ugly unreadable bootloader screen. I just need to copy over the **grub.cfg** from my old machine.
### Arch Install
At first I just wanted to just move the hard drive from one laptop to the next so that I wouldnt even have to install anything, but after taking the computers apart, I noticed the M.2 SSDs are a different shape. I could have done a low-level block copy, but just decided to start from scratch because it would be a good refresher. It had been 3 years. I had installed a lot of random crap over the years, and even when I remembered to un-install it there were all kinds of digital remnants.
The Arch install went quite smoothly this time because the hardware had been around for so long. I still needed to do **rfkill unblock wifi**, but other than that everything else just worked. Apparently Linux still doesnt know how to properly read the rfkill information from this model. Fortunately **systemd** has the ability to restore rfkill values on startup.
### Kernel Buglist
One of the things that continues to surprise me is that the Linux buglist is a mess. I know there are all of these people and this great rate of change, but what isnt changing is the worst case scenario for a bug report. I dont know why bugs sit around for years, but there clearly is no escalation process.
I wrote an analogy in my last review I think is useful. Imagine if it took an airline 1-2 years to return your lost luggage. Would you use trust that company? In fact, whats the point of making a new release if youve still got thousands of known bugs and hundreds of regressions? If 1% of every Boeing airplane crashed, would they just keep continuing like that for years?
Maybe the Linux Foundation should hire some engineers to work on all the bugs that everyone else seems to be ignoring. There are a lot of people paid to work on Linux, and there are a lot of old bugs which is usually what amateurs do. In my opinion the kernel would be better off not releasing anything for months until the bug count was under 50\. Right now it is 4672\. That would be a good reason to increment the major release number.
There is something contradictory about making a new stable release every week, but theyve been doing it that way for years, and they have critical fixes every time, so they are clearly doing something valuable. The kernel gets better at a great rate, so far be it for me to criticize, but I do think they should try something different.
At least, bugs should get resolved within a specific timeframe. If that is exceeded, than it should escalate up to the maintainer and eventually to Linus. If there is a problem area with a lot of old bugs in a place that no one is working on, then Linus can point this out and crack the whip on the relevant parties. They need to think more like Boeing.
### Lenovo
Many Linux users hammer Lenovo for their lack of support on their consumer laptops, but they build quality hardware at a good price. As I wrote years ago, it was obvious not one person at Lenovo had bothered to install Linux on the Yoga 2 before they released it, and it is true for the Yoga 900 because it was impossible.
I think everyone in their company should be dual-booting. It isnt that hard to setup, and their customers might want that. Lenovo has 60,000 employees. At least, they need to hire a few people on their Yoga team willing to try out this thing called **Linux**. Windows is painful to use compared to Linux in various ways. Windows runs more applications, but I think perhaps half of their users would be happier with a properly configured Linux installation.
While it is bad how Lenovo is still ignoring Linux, their problems apply to more than the software. On many models, the RAM chips are soldered on. In some devices, there are whitelists and only pre-approved cards can be installed. The Yogas dont have a discrete graphics card, but even Lenovos that do provide no mechanism to upgrade the card, like you can with a desktop. I think someone needs to put a horse head in the bed of the Lenovo CEO.
### Conclusion
This Yoga 900 is an amazing laptop for the price, and its a definite step up from the Yoga 2 with the improvements. A similar Apple Macbook Pro is $1500, but it has 40% less pixels.
Windows is adopting some of the best features of Linux, but they still dont have native support for a package manager with all of the interesting free software components pre-compiled. Installing **ffmpeg** on Windows is a huge pain because of all the [dependent libraries][37] it uses.
Microsoft built a Windows store, which is sort of like a repository, but it doesnt handle inter-package dependencies, and isnt setup to manage individual libraries. Microsoft also has a new package manager called [NuGet][38], but it seems to be used mostly for .Net software. It did have a package for ffmpeg, but it didnt have any dependencies for the codecs so even after installing it, it wont do anything useful yet.
Last March, [Microsoft demonstrated][39] the ability to run Ubuntu command-line applications, which is quite a revolution. (They should have [started with Debian][40].) Theres even [a discussion][41] in their buglist to add support for more distros which could be quite tempting.
For me at least, I have no need for Windows apps, and the extra maintenance time. Fixing issues in Windows involves hunting down things in lots of different places. Linux still has a fair number of places to configure a system, but overall its much simpler.
I have friends who install 3<sup>rd</sup> party software on Windows just to keep their drivers up to date, because it grabs code from many more websites than just Microsofts. Windows has gotten better over the years, and it has more games and desktop applications, but it is an aging, closed system.
I find Gnome classic a streamlined experience. I wish it wasnt written in the clunky [fad Javascript][42], and they re-enabled a community around custom themes and color schemes. Its also still missing some nice features from Gnome 2 and Windows 10, and could be a bit more stable. Gnome 3.0 in 2011 was a step backwards, but six years later were up to Gnome 3.22, and things are mature again.
Gnome Classic is one of the best GUIs, but there are a [number of good ones][43] and all are getting better. This machine is working quite well now and Im just going to sit back and keep waiting for the HiDPI and other improvements! Im looking forward to deep learning inside the grammar checker of LibreOffice.
--------------------------------------------------------------------------------
via: http://keithcu.com/wordpress/?p=3739
作者:[keithccurtis][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://twitter.com/keithccurtis
[1]:https://www.amazon.com/Lenovo-13-3-inch-Multitouch-Convertible-Platinum/dp/B01NA6ANNK/
[2]:http://keithcu.com/wordpress/?p=3270
[3]:http://configure.us.dell.com/dellstore/config.aspx?oc=cax13w10ph5122&model_id=xps-13-9360-laptop&c=us&l=en&s=bsd&cs=04
[4]:http://blog.lenovo.com/en/blog/why-you-should-give-in-to-the-new-thinkpad-keyboard
[5]:https://www.freedesktop.org/wiki/Software/libinput/
[6]:https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=762ce4458974534a2407cc924db05840c89105df
[7]:https://mjg59.dreamwidth.org/41713.html
[8]:https://en.wikipedia.org/wiki/Electromigration
[9]:http://support.lenovo.com/us/en/products/Laptops-and-netbooks/Yoga-Series/yoga-900-13isk2/80UE/downloads/DS112754
[10]:http://support.lenovo.com/us/en/products/laptops-and-netbooks/yoga-series/yoga-900-13isk2/downloads/ds119354
[11]:https://linux.slashdot.org/comments.pl?sid=9861381&cid=53241071
[12]:https://www.reddit.com/r/linux/comments/54gtpc/letter_to_the_federal_trade_commission_regarding/
[13]:http://venturebeat.com/2016/09/21/lenovo-confirms-that-linux-wont-work-on-yoga-900-and-900s-laptops/
[14]:http://venturebeat.com/2016/09/21/lenovo-confirms-that-linux-wont-work-on-yoga-900-and-900s-laptops/
[15]:https://www.reddit.com/user/baronhk/
[16]:https://www.reddit.com/user/baronhk/
[17]:https://www.reddit.com/user/baronhk/
[18]:https://duckduckgo.com/?q=lenovo+yoga+linux+compatibility&t=hs&ia=web
[19]:https://duckduckgo.com/?q=lenovo+yoga+linux+compatibility&t=hs&ia=web
[20]:https://duckduckgo.com/?q=lenovo+yoga+linux+compatibility&t=hs&ia=web
[21]:https://www.spinics.net/lists/linux-ide/msg53370.html
[22]:http://ark.intel.com/products/codename/37572/Skylake
[23]:http://ark.intel.com/products/codename/37572/Skylake
[24]:http://ark.intel.com/products/codename/37572/Skylake
[25]:http://ark.intel.com/products/codename/42174/Haswell#@All
[26]:http://www.anandtech.com/show/9562/intels-skylake-gpu-analyzing-the-media-capabilities
[27]:http://www.anandtech.com/show/9562/intels-skylake-gpu-analyzing-the-media-capabilities
[28]:https://trac.ffmpeg.org/wiki/HWAccelIntro
[29]:http://www.game-debate.com/gpu/index.php?gid=3295&gid2=3285&compare=iris-graphics-540-mobile-vs-intel-hd-graphics-520-mobile
[30]:https://www.freedesktop.org/wiki/Software/Beignet/
[31]:http://keithcu.com/wordpress/?p=3444
[32]:https://cgit.freedesktop.org/libreoffice/core/log/?qt=grep&q=hidpi
[33]:http://wiki.audacityteam.org/wiki/Linux_Issues#Hi-DPI
[34]:https://antergos.com/
[35]:https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface
[36]:https://wiki.archlinux.org/index.php/Profile-sync-daemon
[37]:https://ffmpeg.zeranoe.com/builds/
[38]:https://www.nuget.org/
[39]:https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/
[40]:http://keithcu.com/wordpress/?page_id=558
[41]:https://github.com/Microsoft/BashOnWindows/issues/992
[42]:http://notes.ericjiang.com/posts/751
[43]:https://wiki.archlinux.org/index.php/Desktop_environment

View File

@ -0,0 +1,128 @@
Be a force for good in your community
============================================================
>Find out how to give the gift of an out, learn about the power of positive intent, and more.
![Be a force for good in your community](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/people_remote_teams_world.png?itok=wI-GW8zX "Be a force for good in your community")
>Image by : opensource.com
Passionate debate is among the hallmark traits of open source communities and open organizations. On our best days, these debates are energetic and constructive. They are heated, yet moderated with humor and goodwill. All parties remain focused on facts, on the shared purpose of collaborative problem-solving, and driving continuous improvement. And for many of us, they're just plain fun.
On our worst days, these debates devolve into rehashing the same old arguments on the same old topics. Or we turn on one another, delivering insults—passive-aggressive or outright nasty, depending on our style—and eroding the passion, trust, and productivity of our communities.
We've all been there, watching and feeling helpless, as a community conversation begins to turn toxic. Yet, as [DeLisa Alexander recently shared][1], there are so many ways that each and every one of us can be a force for good in our communities.
In the first article of this "open culture" series, I will share a few strategies for how you can intervene, in that crucial moment, and steer everyone to a more positive and productive place.
### Don't call people out. Call them up.
Recently, I had lunch with my friend and colleague, [Mark Rumbles][2]. Over the years, we've collaborated on a number of projects that support open culture and leadership at Red Hat. On this day, Mark asked me how I was holding up, as he saw I'd recently intervened in a mailing list conversation when I saw the debate was getting ugly.
Fortunately, the dust had long since settled, and in fact I'd almost forgotten about the conversation. Nevertheless, it led us to talk about the challenges of open and frank debate in a community that has thousands of members.
>One of the biggest ways we can be a force for good in our communities is to respond to conflict in a way that compels everyone to elevate their behavior, rather than escalate it.
Mark said something that struck me as rather insightful. He said, "You know, as a community, we are really good at calling each other out. But what I'd like to see us do more of is calling each other _up_."
Mark is absolutely right. One of the biggest ways we can be a force for good in our communities is to respond to conflict in a way that compels everyone to elevate their behavior, rather than escalate it.
### Assume positive intent
We can start by making a simple assumption when we observe poor behavior in a heated conversation: It's entirely possible that there are positive intentions somewhere in the mix.
This is admittedly not an easy thing to do. When I see signs that a debate is turning nasty, I pause and ask myself what Steven Covey calls The Humanizing Question:
"Why would a reasonable, rational, and decent person do something like this?"
Now, if this is one of your "usual suspects"—a community member with a propensity toward negative behavior--perhaps your first thought is, "Um, what if this person _isn't_ reasonable, rational, or decent?"
Stay with me, now. I'm not suggesting that you engage in some touchy-feely form of self-delusion. It's called The Humanizing Question not only because asking it humanizes the other person, but also because it humanizes _you_.
And that, in turn, helps you respond or intervene from the most productive possible place.
### Seek to understand the reasons for community dissent
When I ask myself why a reasonable, rational, and decent person might do something like this, time and again, it comes down to the same few reasons:
* They don't feel heard.
* They don't feel respected.
* They don't feel understood.
One easy positive intention we can apply to almost any poor behavior, then, is that the person wants to be heard, respected, or understood. That's pretty reasonable, I suppose.
By standing in this more objective and compassionate place, we can see that their behavior is _almost certainly _**_not_**_ going to help them get what they want, _and that the community will suffer as a result . . . without our help.
For me, that inspires a desire to help everyone get "unstuck" from this ugly place we're in.
Before I intervene, though, I ask myself a follow-up question: _What other positive intentions might be driving this behavior?_
Examples that readily jump to mind include:
* They are worried that we're missing something important, or we're making a mistake, and no one else seems to see it.
* They want to feel valued for their contributions.
* They are burned out, because of overworking in the community or things happening in their personal life.
* They are tired of something being broken and frustrated that no one else seems to see the damage or inconvenience that creates.
* ...and so on and so forth.
With that, I have a rich supply of positive intent that I can ascribe to their behavior. I'm ready to reach out and offer them some help, in the form of an out.
### Give the gift of an out
What is an out? Think of it as an escape hatch. It's a way to exit the conversation, or abandon the poor behavior and resume behaving like a decent person, without losing face. It's calling someone up, rather than calling them out.
You've probably experienced this, as some point in your life, when _you_ were behaving poorly in a conversation, ranting and hollering and generally raising a fuss about something or another, and someone graciously offered _you_ a way out. Perhaps they chose not to "take the bait" by responding to your unkind choice of words, and instead, said something that demonstrated they believed you were a reasonable, rational, and decent human being with positive intentions, such as:
> _So, uh, what I'm hearing is that you're really worried about this, and you're frustrated because it seems like no one is listening. Or maybe you're concerned that we're missing the significance of it. Is that about right?_
And here's the thing: Even if that wasn't entirely true (perhaps you had less-than-noble intentions), in that moment, you probably grabbed ahold of that life preserver they handed you, and gladly accepted the opportunity to reframe your poor behavior. You almost certainly pivoted and moved to a more productive place, likely without even recognizing it.
Perhaps you said something like, "Well, it's not that exactly, but I just worry that we're headed down the wrong path here, and I get what you're saying that as community, we can't solve every problem at the same time, but if we don't solve this one soon, bad things are going to happen…"
In the end, the conversation almost certainly began to move to a more productive place, or you all agreed to disagree.
We all have the opportunity to offer an upset person a safe way out of that destructive place they're operating from. Here's how.
### Bad behavior or bad actor?
If the person is particularly agitated, they may not hear or accept the first out you hand them. That's okay. Most likely, their lizard brain--that prehistoric amygdala that was once critical for human survival—has taken over, and they need a few more moments to recognize you're not a threat. Just keep gently but firmly treating them as if they _were_ a rational, reasonable, decent human being, and watch what happens.
In my experience, these community interventions end in one of three ways:
Most often, the person actually _is_ a reasonable person, and soon enough, they gratefully and graciously accept the out. In the process, everyone breaks out of the black vs. white, "win or lose" mindset. People begin to think up creative alternatives and "win-win" outcomes that benefit everyone.
>Why would a reasonable, rational, and decent person do something like this?
Occasionally, the person is not particularly reasonable, rational, or decent by nature, but when treated with such consistent, tireless, patient generosity and kindness (by you), they are shamed into retreating from the conversation. This sounds like, "Well, I think I've said all I have to say. Thanks for hearing me out." Or, for less enlightened types, "Well, I'm tired of this conversation. Let's drop it." (Yes, please. Thank you.)
Less often, the person is what's known as a _bad actor_, or in community management circles, a pot-stirrer. These folks do exist, and they thrive on drama. Guess what? By consistently engaging in a kind, generous, community-calming way, and entirely ignoring all attempts to escalate the situation, you effectively shift the conversation into an area that holds little interest for them. They have no choice but to abandon it. Winners all around.
That's the power of assuming positive intent. By responding to angry and hostile words with grace and dignity, you can diffuse a flamewar, untangle and solve tricky problems, and quite possibly make a new friend or two in the process.
Am I successful every time I apply this principle? Heck, no. But I never regret the choice to assume positive intent. And I can vividly recall a few unfortunate occasions when I assumed negative intent and responded in a way that further contributed to the problem.
Now it's your turn. I'd love to hear about some strategies and principles you apply, to be a force for good when conversations get heated in your community. Share your thoughts in the comments below.
Next time, we'll explore more ways to be a force for good in your community, and I'll share some tips for handling "Mr. Grumpy."
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/headshot-square_0.jpg?itok=FS97b9YD)
Rebecca Fernandez is a Principal Employment Branding + Communications Specialist at Red Hat, a contributor to The Open Organization book, and the maintainer of the Open Decision Framework. She is interested in open source and the intersection of the open source way with business management models. Twitter: @ruhbehka
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/17/1/force-for-good-community
作者:[Rebecca Fernandez][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/rebecca
[1]:https://opensource.com/business/15/5/5-ways-promote-inclusive-environment
[2]:https://twitter.com/leadership_365

View File

@ -0,0 +1,54 @@
The Many, the Humble, the Ubuntu Users
============================================================
#### The proverbial “better mousetrap” isnt one that takes a certified biologist to use. Like Ubuntu, it just needs to do its job extremely well and with little fuss.
### Roblimos Hideaway
![Ubuntu Unity](https://i0.wp.com/fossforce.com/wp-content/uploads/2017/01/UbuntuDesktop.png?resize=524%2C295)
I have never been much of a leading-edge computing person. In fact, I first got mildly famous online writing a weekly column titled “This Old PC” for Time/Life about making do with used gear — often by installing Linux on it — and after that an essentially identical column for Andover.net titled “Cheap Computing,” which was also about saving money in a world where most online computing columns seemed to be about getting you to spend until you had no money left to spend on food.
Most of the early Linux adopters I knew were infatuated with their computers and the software that made them useful. They loved poring over source code and making minor changes. They were, for the most part, computer science students or worked as IT people. Their computers and computer networks fascinated them, as they should have.
I was (and still am) a writer, not a computer science guy. For me, computers have always been tools. I want them to sit quietly until I tell them to do something, then follow my orders with the minimum possible fuss and bother. I like a GUI, since I dont administer my PC or network often enough to memorize long command strings. Sure, I can look them up and type them in, but Id really rather be at the beach.
There was a time when, in Linux circles, mere _users_ were rare. “What do you mean, you just want to use your computer to type articles and maybe add a little HTML to them?” the developer and admin types seemed to ask, as if all fields of endeavor other than coding were inferior to what they did.
But despite the sneers, I kept hammering a theme in speech after speech and conversation after conversation that went sort of like this: “Instead of scratching only your own itches, why not scratch your girlfriends itch? How about your coworkers? And people who work at your favorite restaurant? And what about your doctor? Dont you want him to spend his time doctoring, not worrying about apt get this and grep that?”
So yes, since I wanted easy-to-use Linux, I was an [early Mandrake user][1]. And today, I am a happy Ubuntu user.
Why Ubuntu? Hey! Why not?! Its the Toyota Camry (or maybe Honda Civic) of Linux distros. Plain-jane. So popular that support is easy to find on IRC, Linux Questions, and Ubuntus own extensive forums, and many other places.
Sure, its cooler to use Debian or Fedora, and Mint looks jazzier out of the box, but Im _still_ mostly interested in writing stories and adding a little HTML to them, along with reading this and that in my browser, editing work in Google Docs for a corporate client or two, keeping up with my email, doing this or that with a picture now and then…. all basic computer user stuff.
And with all this going on, the appearance of my desktop is meaningless. I cant see it! Its covered with application windows! And Im talking two monitors, not just one. I have, lets see…. 17 Chrome tabs open in two windows. And GIMP running. And [Bluefish][2], which Im using right now, to type this essay.
So for me Ubuntu is the path of least resistance. Mint may be a little cuter, but when you come right down to it, and strip away the trim, isnt it really Ubuntu? So if I use the same few programs over and over, which I do, and cant see the desktop anyway, who cares if its brown?
Some studies say Mint is more popular. Others say Debian. But they all show Ubuntu in the top few, year after year.
So call me mass-average. Call me boring. Call me one of the many, the humble, the Ubuntu users — at least for now…
--------------------------------------------------------------------------------
作者简介:
![](http://0.gravatar.com/avatar/f861a631676e6d4d2f4e4de2454f230e?s=80&d=blank&r=pg)
Robin "Roblimo" Miller is a freelance writer and former editor-in-chief at Open Source Technology Group, the company that owned SourceForge, freshmeat, Linux.com, NewsForge, ThinkGeek and Slashdot, and until recently served as a video editor at Slashdot. He also publishes the blog Robin Roblimo Millers Personal Site. @robinAKAroblimo
--------------------------------------------------------------------------------
via: http://fossforce.com/2017/01/many-humble-ubuntu-users/
作者:[Robin "Roblimo" Miller][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.roblimo.com/
[1]:https://linux.slashdot.org/story/00/11/02/2324224/mandrake-72-in-wal-mart-a-good-idea
[2]:http://bluefish.openoffice.nl/index.html

View File

@ -0,0 +1,83 @@
How is your community promoting diversity?
============================================================
> Open source foundation leaders weigh in.
![How is your community promoting diversity?](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/world_hands_diversity.png?itok=LMT5xbxJ "How is your community promoting diversity?")
Image by : opensource.com
Open source software is a great enabler for technology innovation. Diversity unlocks innovation and drives market growth. Open source and diversity seem like the ultimate winning combination, yet ironically open source communities are among the least diverse tech communities. This is especially true when it comes to inherent diversity: traits such as gender, age, ethnicity, and sexual orientation.
It is hard to get a true picture of the diversity of our communities in all the various dimensions. Gender diversity, by virtue of being noticeably lacking and more straight forward to measure, is the starting point and current yardstick for measuring diversity in tech communities.
For example, it is estimated that around 25% of all software developers are women, but [only 3% work][5] in free and open software. These figures are consistent with my personal experience working in open source for over 10 years.
Even when individuals in the community are [doing their best][6] (and I have worked with many who are), it seems to make little difference. And little has changed in the last ten years. However, we are, as a community, starting to have a better understanding of some of the factors that maintain this status quo, things like [unconscious bias][7] or [social graph and privilege][8] problems.
In order to overcome the gravity of these forces in open source, we need combined efforts that are sustained over the long term and that really work. There is no better example of how diversity can be improved rapidly in a relatively short space of time than the Python community. PyCon 2011 consisted of just 1% women speakers. Yet in 2014, 33% of speakers at PyCon were women. Now Python conferences regularly lay out [their diversity targets and how they intend to meet them][9].
What did it take to make that dramatic improvement in women speaker numbers? In her great talk at PyCon 2014, [Outreach Program for Women: Lessons in Collaboration][10], Marina Zhurakhinskaya outlines the key ingredients:
* The importance of having a Diversity Champion to spearhead the changes over the long term; in the Python community Jessica McKellar was the driving force behind the big improvement in diversity figures
* Specifically marketing to under-represented groups; for example, how GNOME used outreach programs, such as [Outreachy][1], to market to women specifically
We know diversity issues, while complex are imminently fixable. In this way, open source foundations can play a huge role in the sustaining efforts to promote initiatives. Are other open source communities also putting efforts into diversity? To find out, we asked a few open source foundation leaders:
### How does your foundation promote diversity in its open source community?
**Mike Milinkovich, executive director of the Eclipse Foundation:**
> "The Eclipse Foundation is committed to promoting diversity in its open source community. But that commitment does not mean that we are satisfied with where we are today. We have a long way to go, particularly in the area of gender diversity. That said, some of the tangible steps we've taken in the last couple of years are: (a) we put into place a [Community Code of Conduct][2] that covers all of our activities, (b) we are consciously recruiting women for our conference program committees, (c) we are consciously looking for women speakers for our conferences, including keynotes, and (d) we are supporting community channels to discuss diversity topics. It's been great to see members of our community step up to assume leadership roles on this topic, and we're looking forward to making a lot of progress in 2017."
**Abby Kearns, executive director for the Cloud Foundry:**
> "For Cloud Foundry we promote diversity in a variety of ways. For our community, this includes a heavy focus on diversity events at our summit, and on our keynote stage. I'm proud to say we doubled the representation by women and people of color at our last event. For our contributors, this takes on a slightly different meaning and includes diversification across company and role."
 A recent Cloud Foundry Summit featured a [diversity luncheon][11] as well as a [keynote on diversity][12], which highlighted how [gender parity had been achieved][13] by one member company's team.
**Chris Aniszczyk, COO of the Cloud Native Computing Foundation:**
> "The Cloud Native Computing Foundation (CNCF) is a very young foundation still, and although we are only one year old as of December 2016, we've had promoting diversity as a goal since our inception. First, every conference hosted by CNCF has [diversity scholarships][3] available, and there are usually special diversity lunches or events at the conference to promote inclusion. We've also sponsored "[contribute your first patch][4]" style events to promote new contributors from all over. These are just some small things we currently do. In the near future, we are discussing launching a Diversity Workgroup within CNCF, and also as we ramp up our certification and training programs, we are discussing offering scholarships for folks from under-representative backgrounds."
Additionally, Cloud Native Computing Foundation is part of the [Linux Foundation][14] as a formal Collaborative Projects (along with other foundations, including Cloud Foundry Foundation). The Linux Foundation has extensive [Diversity Programs][15] and as an example, recently [partnered with the Girls In Tech][16] not-for-profit to improve diversity in open source. In the future, the CNCF actively plans to participate in these Linux Foundation wide initiatives as they arise.
For open source to thrive, companies need to foster the right environment for innovation. Diversity is a big part of this. Seeing open source foundations making the conscious decision to take action is encouraging. Dedicated time, money, and resources to diversity is making a difference within communities, and we are slowly but surely starting to see the effects. Going forward, communities can collaborate and learn from each other about what works and makes a real difference.
If you work in open source, be sure to ask and find out what is being done in your community as a whole to foster and promote diversity. Then commit to supporting these efforts and taking the steps toward making a real difference. It is exciting to think that the next ten years might be a huge improvement over the last 10, and we can start to envision a future of truly diverse open source communities, the ultimate winning combination.
--------------------------------------------------------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/dsc_0182.jpg?itok=c_u-wggj)
Tracy Miranda - Tracy Miranda is a software developer and founder of Kichwa Coders, a software consultancy specializing in Eclipse tools for scientific and embedded software. Tracy has been using Eclipse since 2003 and is actively involved in the community, particularly the Eclipse Science Working Group. Tracy has a background in electronics system design. She mentors young coders at the festival of code for Young Rewired State. Follow Tracy on Twitter @tracymiranda.
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/take-action-diversity-tech
作者:[ Tracy Miranda][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/tracymiranda
[1]:https://www.gnome.org/outreachy/
[2]:https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php
[3]:http://events.linuxfoundation.org/events/cloudnativecon-and-kubecon-north-america/attend/scholarship-opportunities
[4]:http://conferences.oreilly.com/oscon/oscon-tx-2016/public/schedule/detail/53257
[5]:https://www.linux.com/blog/how-bring-more-women-free-and-open-source-software
[6]:https://trishagee.github.io/post/what_can_men_do/
[7]:https://opensource.com/life/16/3/sxsw-diversity-google-org
[8]:https://opensource.com/life/15/8/5-year-plan-improving-diversity-tech
[9]:http://2016.pyconuk.org/diversity-target/
[10]:https://www.youtube.com/watch?v=CA8HN20NnII
[11]:https://www.youtube.com/watch?v=LSRrc5B1an0&list=PLhuMOCWn4P9io8gtd6JSlI9--q7Gw3epW&index=48
[12]:https://www.youtube.com/watch?v=FjF8EK2zQU0&list=PLhuMOCWn4P9io8gtd6JSlI9--q7Gw3epW&index=50
[13]:https://twitter.com/ab415/status/781036893286854656
[14]:https://www.linuxfoundation.org/about/diversity
[15]:https://www.linuxfoundation.org/about/diversity
[16]:https://www.linux.com/blog/linux-foundation-partners-girls-tech-increase-diversity-open-source

View File

@ -0,0 +1,85 @@
A 5-step plan to encourage your team to make changes on your project
============================================================
![A 5-step plan to encourage your team to make changes on your project](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_Maze2.png?itok=egeRn990 "A 5-step plan to encourage your team to make changes on your project")
Image by : opensource.com
Purpose is the first thing to consider when you're assembling any team. If one person could achieve that purpose, then forming the team would be unnecessary. And if there was no main purpose, then you wouldn't need a team at all. But as soon as the task requires more expertise than a single person has, we encounter the issue of collective participation—an issue that, if not handled properly, could derail you.
Imagine a group of people trapped in a cave. No single person has full knowledge of how to get out, so everyone will need to work together, be open, and act collaboratively if they're going to do it. After (and only after) assembling the right task force can someone create the right environment for achieving the team's shared purpose.
But some people are actually very comfortable in the cave and would like to just stay there. In organizations, how do leaders handle individuals who actually _resist_ productive change, people who are comfortable in the cave? And how do they go about finding people who do share their purpose but aren't in their organizations?
I made a career conducting sales training internationally, but when I began, few people even thought my work had value. So, I somehow devised a strategy for convincing them otherwise. That strategy was so successful that I decided to study it in depth and [share it][2] with others.
### Gaining support
In established companies with strong corporate cultures, there are people that will fight change and, from behind the scenes, will fight any proposal for change. They want everyone to stay in that comfortable cave. When I was first approached to give overseas sales training, for example, I received heavy resistance from some key people. They pushed to convince others that someone in Tokyo could not provide sales training—only basic product training would be successful.
I somehow solved this problem, but didn't really know how I did it at the time. So, I started studying what consultants recommend about how to change the thinking in companies that resisted to change. From one study by researcher [Laurence Haughton][3], I learned that for the average change proposal, 83% of people in your organization will not support you from the beginning. Roughly 17% _will_ support you from the beginning, but 60% of the people would support you only after seeing a pilot case succeed, when they can actually see that the idea is safe to try. Lastly, there are some people who will fight any change, no matter how good it is.
Here are the steps I learned:
* Start with a pilot project
* Outsmart the CAVE people
* Follow through fast
* Outsmart the CAVE bosses
* Move to full operation.
### 1\. Start with a pilot project
Find a project with both high value and a high chance for success—not a large, expensive, long-term, global activity. Then, find key people who can see the value of the project, who understand its value, and who will fight for it. These people should not just be "nice guys" or "friends"; they must believe in its purpose and have some skills/experience that will help move the project forward. And don't shoot for a huge success the first time. It should be just successful enough to permit you to learn and keep moving forward.
In my case, I held my first sales seminar in Singapore at a small vehicle dealership. It was not a huge success, but it was successful enough that people started talking about what quality sales training could achieve. At that time, I was stuck in a cave (a job I didn't want to do). This pilot sales training was my road map to get out of my cave.
### 2\. Outsmart the CAVE people
CAVE is actually an acronym I learned from Laurence Haughton. It stands for Citizens Against Virtually Everything.
You must identify these people, because they will covertly attempt to block any progress in your project, especially in the early stages when it is most vulnerable. They're easy to spot: They are always negative. They use "but," "if," and "why," in excess, just to stall you. They ask for detailed information when it isn't available easily. They spend too much time on the problem, not looking for any solution. They think every failure is the beginning of a trend. They often attack people instead of studying the problem. They make statements that are counterproductive but cannot be confirmed easily.
Avoid the CAVE people; do not let them into the discussion of the project too early. They've adopted the attitude they have because they don't see value in the changes required. They are comfortable in the cave. So try to get them to do something else. You should seek out key people in the 17% group I mentioned above, people that want change, and have very private preparation meetings with them.
When I was in Isuzu Motors (partly owned by General Motors), the sales training project started in a joint venture distribution company that sold to the smaller countries in the world, mainly in Africa, Southeast Asia, Latin America and the Middle East. My private team was made up of a GM person from Chevrolet, an Isuzu product planning executive and that distribution company's sales planning staff. I kept everyone else out of the loop.
### 3\. Follow through fast
CAVE people like to go slowly, so act quickly. Their ability to negatively influence your project will weaken if you have a small success story before they are involved—if you've managed to address their inevitable objections before they can even express them. Again, choose a pilot project with a high chance of success, something that can show quick results. Then promote that success, like a bold headline on an advertisement.
Once the word of my successful seminar in Singapore began to circulate, other regions started realizing the benefits of sales training. Just after that Singapore seminar, I was commissioned to give four more in Malaysia.
### 4\. Outsmart CAVE bosses
Once you have your first mini-project success, promote the project in a targeted way to key leaders who could influence any CAVE bosses. Get the team that worked on the project to tell key people the success story. Front line personnel and/or even customers can provide powerful testimonials as well. CAVE managers often concern themselves only with sales and profits, so promote the project's value in terms of cost savings, reduced waste, and increased sales.
From that first successful seminar in Singapore and others that followed, I promoted heavily their successes to key front line sales department staff handling Isuzu's direct sales channels and General Motors channels that really wanted to see progress. After giving their acceptance, they took their training requests to their superiors sighting the sales increase that occurred in the distribution company.
### 5\. Move to full operation
Once top management is on board, announce to the entire organization the successful pilot projects. Have discussions for expanding on the project.
Using the above procedures, I gave seminars in more than 60 countries worldwide over a 21-year career. So I did get out of the cave—and really saw a lot of the world.
--------------------------------------------------------------------------------
作者简介:
Ron McFarland - Ron McFarland has been working in Japan for 40 years, and he's spent more than 30 of them in international sales, sales management training, and expanding sales worldwide. He's worked in or been to more than 80 countries. Over the past 14 years, Ron has established distributors in the United States and throughout Europe for a Tokyo-headquartered, Japanese hardware cutting tool manufacturer.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/17/1/escape-the-cave
作者:[Ron McFarland][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/ron-mcfarland
[1]:https://opensource.com/open-organization/17/1/escape-the-cave?rate=dBJIKVJy720uFj0PCfa1JXDZKkMwozxV8TB2qJnoghM
[2]:http://www.slideshare.net/RonMcFarland1/creating-change-58994683
[3]:http://www.laurencehaughton.com/
[4]:https://opensource.com/user/68021/feed
[5]:https://opensource.com/open-organization/17/1/escape-the-cave#comments
[6]:https://opensource.com/users/ron-mcfarland

View File

@ -0,0 +1,72 @@
How to join a technical community
============================================================
### Following a few simple steps can ease your transition into a community.
![How to join a technical community](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BIZ_DebucketizeOrgChart_A.png?itok=oBdRm8vc "How to join a technical community")
Image by : opensource.com
Joining a new community can be a daunting task for a myriad of reasons. The angst can be especially strong when joining a new technical community, some of which have a reputation for being acrimonious and tough on new members.
While it's possible to stumble into a den of iniquity, I think you'll find most technical communities to be fairly reasonable, and following a few simple steps can ease your transition from non-member to member.
### A good fit
The process begins well before you actually join a community. The first step is to ensure the community is a good fit for you, and you are a good fit for the community.
This sounds simple, but every community has a distinct culture, attitude, philosophy, and accepted norms. If you're new to a topic, a community aimed at industry professionals is not an ideal place to start. Similarly, if you are a grizzled expert looking for an answer to an in-depth, extremely complicated problem, a community for beginners is almost certainly not a good fit. Either way, the impedance mismatch will almost certainly lead to frustration on both sides. Similarly, some communities are going to be very business oriented and formal, while others will be extremely lax and laid back. Many are in the middle. Picking a community that suits your personality, or minimally isn't an anathema to you, will help ensure you enjoy participating long term—which leads me to the first step.
### Lurk around
Browsing around and participating in the community in a read-only mode initially is a good idea. This doesn't mean you shouldn't immediately create an account or join, just that you need to get a feel for a place (be it virtual or physical) by browsing around a bit. Lurking for a little while will help you acclimate to the community's rules and culture, and you can ascertain whether you think it's a good fit for you.
### Introduce yourself
Depending on the venue, the details of what introducing yourself will mean can vary widely. Once again, be sure to do this in a way that is consistent with what is acceptable to the community you're joining.
Some places may have a dedicated outlet for introductions, while in some communities it may imply filling out your profile with meaningful and relevant information. If the community is a mailing list or IRC channel, a brief introduction included with your initial query may make more sense. This will give the community an idea of who you are, why you'd like to be a part of the community, and will also let them know a little about yourself and your level of technical proficiency.
### Be respectful
While what is acceptable will vary largely from community to community, you should always be is respectful. Avoid flame wars and personal attacks, and always try to be constructive. Remember, once you post something on the Internet, it's there forever, and for everyone to see.
### Questions
### Asking
Remember that well-crafted questions receive better answers quicker, as I pointed out in my October column, [The Queue][2].
### Answering
Once you know a topic well, forgetting that at some point you didn't know the basics either is all too easy. The "be respectful" mantra applies here just as much when answering a question as it does when asking. A lengthy technically correct answer given in a condescending manner isn't the way you want to introduce yourself to a new community.
### Doing neither
Even in a technical community, not all discussion is a question or an answer. In those cases, remember that differing opinions and challenging others' point of view is healthy when done in a respectful and thoughtful way, and without insult or personal attack.
### Enjoy yourself
The most important thing about participating in a community long term is to remember to enjoy your time there. Participating in a vibrant community is a great opportunity to learn, grow, challenge yourself, and improve. It's not always easy, but it is worth it.
--------------------------------------------------------------------------------
作者简介:
Jeremy Garcia - Jeremy Garcia is the founder of LinuxQuestions.org and an ardent but realistic open source advocate. Follow Jeremy on Twitter: @linuxquestions
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/how-join-technical-community
作者:[Jeremy Garcia][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jeremy-garcia
[1]:https://opensource.com/article/17/1/how-join-technical-community?rate=SfjMzwYInmhZiq6Yva3D87kngE-ocLOVraCD0wWbBss
[2]:https://opensource.com/life/16/10/how-ask-technical-questions
[3]:https://opensource.com/user/86816/feed
[4]:https://opensource.com/article/17/1/how-join-technical-community#comments
[5]:https://opensource.com/users/jeremy-garcia

View File

@ -0,0 +1,111 @@
Be the open source supply chain
============================================================
### Learn why you should be a supply chain influencer.
![Be the open source supply chain](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/OSDC_BUS_ArchitectureOfParticipation_520x292.png?itok=tzfeycyR "Be the open source supply chain")
Image by : 
opensource.com
I would bet that whoever is best at managing and influencing the open source supply chain will be best positioned to create the most innovative products. In this article, Ill explain why you should be a supply chain influencer, and how your organization can be an active participant in your supply chain.
In my previous article, [Open source and the software supply chain][2], I discussed the basics of supply chain management, and where open source fits in this model. I left readers with this illustration of the model:
![supply chain](https://opensource.com/sites/default/files/f1_520_0.png "supply chain")
The question to ask your employer and team(s) is: How do we best take advantage of this? After all, if Apple can set the stage for its dominance by creating a better hardware supply chain, then surely one can do the same with software supply chains.
### Evaluating supply chains
Having worked with developers and product teams in many companies, I learned that the process for selecting components that go into a product is haphazard. Sometimes there is an official bake-off of one or two components against each other, but the developers often choose to work with a product based on "feel". When determining the best components, you must evaluate based on those projects longevity, stage of development, and enough other metrics to form the basis of a "build vs. buy" decision. Number of users, interested parties, commercial activity, involvement of development team in support, and so on are a few considerations in the decision-making process.
Over time, technology and business needs change, and in the world of open source software, even more so. Not only must an engineering and product team be able to select the best component at that time, they must also be able to switch it out for something else when the time comes—for example, when the community managing the old component moves on, or when a new component with better features emerges.
### What not to do
When evaluating supply chain components, teams are prone to make a number of mistakes, including these common ones:
* **Not Invented Here (NIH)**: I cant tell you how many times engineering teams decided to "fix" shortcomings in existing supply chain components by deciding to write it themselves. I wont say "never ever do that," but I will warn that if you take on the responsibility of writing an infrastructure component, understand that youre chucking away all the advantages of the open source supply chain—namely upstream testing and upstream engineering—and deciding to take on those tasks, immediately saddling your team (and your product) with technical debt that will only grow over time. Youre making the choice to be less efficient, and you had better have a compelling reason for doing so.
* **Carrying patches forward**: Any open source-savvy team understands the value of contributing patches to their respective upstream projects. When doing so, contributed code goes through that projects automated testing procedures, which, when combined with your own teams existing testing infrastructure, makes for a more hardened end product. Unfortunately, not all teams are open source-savvy. Sometimes these teams are faced with onerous legal requirements that deter them from seeking permission to contribute fixes upstream. In that case, encourage (i.e., nag) your manager to get blanket legal approval for such things, because the alternative is carrying all those changes forward, incurring significant technical debt, and applying patches until the day your project (or you) dies.
* **Think youre only a user**: Using open source components as part of your software supply chain is only the first step. To reap the rewards of open source supply chains, you must dive in and be an influencer. (More on that shortly.)
### Effective supply chain management example: Red Hat
Because of its upstream-first policies, [Red Hat][3] is an example of how both to utilize and influence software supply chains. To understand the Red Hat model, you must view their products through a supply chain perspective.
Products supported by Red Hat are composed of open source components often vetted by multiple upstream communities, and changes made to these components are pushed to their respective upstream projects, often before they land in a supported product from Red Hat. The work flow look somewhat like:
![workflow diagram](https://opensource.com/sites/default/files/f2_520_0.png "workflow diagram")
There are multiple reasons for this kind of workflow:
* Testing, testing, testing: By offloading some initial testing, a company like Red Hat benefits from both the upstream communitys testing, as well as the testing done by other ecosystem participants, including competitors.
* Upstream viability: The Red Hat model only works as long as upstream suppliers are viable and self-sustaining. Thus, its in Red Hats interest to make sure those communities stay healthy.
* Engineering efficiency: Because Red Hat offloads common tasks to upstream communities, their engineers spend more time adding value to products for customers.
To understand the Red Hat approach to supply chain, lets look at their approach to product development with OpenStack.
Curiously, Red Hats start with OpenStack was not to create a product or even to announce one; rather, they started pushing engineering resources into strategic projects in OpenStack (starting with Nova, Keystone, and Cinder). This list grew to include several other projects in the OpenStack community. A more traditional product management executive might look at this approach and think, "Why on earth would we contribute so much engineering to something that isnt established and has no product? Why are we giving our competitors our work for free?"
Instead, here is the open source supply chain thought process:
### Step 1
Look at growth areas in the business or largest product gaps that need filling. Is there an open source community that fits a strategic gap? Or can we build a new project from scratch to do the same? In this case, Red Hat looked at the OpenStack community and eventually determined that it would fill a gap in the product portfolio.
### Step 2
Gradually turn up the dial on engineering resources. This does a couple of things. First, it helps the engineering team get a sense of the respective projects prospects for success. If prospects arent not good, the company can stop contributing, with minimal investment spent. Once the project is determined to be worth in the investment, to the company can ensure its engineers will influence current and future development. This helps the project with quality code development, and ensures that the code meets future product requirements and acceptance criteria. Red Hat spent a lot of time slinging code in OpenStack repositories before ever announcing an OpenStack product, much less releasing one. But this was a fraction of the investment that would have been made if the company had developed an IaaS product from scratch.
### Step 3
Once the engineering investments begin, start a product management roadmap and marketing release plan. Once the code reaches a minimum level of quality, fork the upstream repository and start working on product-specific code. Bug fixes are pushed upstream to openstack.org and into product branches. (Remember: Red Hats model depends on upstream viability, so it makes no sense not to push fixes upstream.)
Lather, rinse, repeat. This is how you manage an open source software supply chain.
### Don't accumulate technical debt
If needed, Red Hat could decide that it would simply depend on upstream code, supply necessary proprietary product glue, and then release that as a product. This is, in fact, what most companies do with upstream open source code; however, this misses a crucial point I made previously. To develop a really great product, being heavily involved in the development process helps. How can an organization make sure that the code base meets its core product criteria if theyre not involved in the day-to-day architecture discussions?
To make matters worse, in an effort to protect backwards compatibility and interoperability, many companies fork the upstream code, make changes and don't contribute them upstream, choosing instead to carry them forward internally. That is a big no-no, saddling your engineering team forever with accumulated technical debt that will only grow over time. In that scenario, all the gains made from upstream testing, development and release go away in a whiff of stupidity.
### Red Hat and OpenShift
Once you begin to understand Red Hats approach to supply chain, which you can see manifested in its approach to OpenStack, you can understand its approach to OpenShift. Red Hat first released OpenShift as a proprietary product that was also open sourced. Everything was homegrown, built by a team that joined Red Hat as part of the [Makara acquisition][4] in 2010.
The technology initially suffered from NIH—using its own homegrown clustering and container management technologies, in spite of the recent (at the time) release of new projects: Kubernetes, Mesos, and Docker. What Red Hat did next is a testament to the companys commitment to its open source supply chain model: Between OpenShift versions 2 and 3, developers rewrote it to utilize and take advantage of new developments from the Kubernetes and Docker communities, ditching their NIH approach. By restructuring the project in that way, the company took advantage of economies of scale that resulted from the burgeoning developer communities for both projects. I
Instead of Red Hat fashioning a complete QC/QA testing environment for the entire OpenShift stack, they could rely on testing infrastructure supplied by the Docker and Kubernetes communities. Thus, Red Hat contributions to both the Docker and Kubernetes code bases would undergo a few rounds of testing before ever reaching the companys own product branches:
1. The first round of testing is by the Docker and Kubernetes communities .
2. Further testing is done by ecosystem participants building products on either or both projects.
3. More testing happens on downstream code distributions or products that "embed" both projects.
4. Final testing happens in Red Hats own product branch.
The amount of upstream (from Red Hat) testing done on the code ensures a level of quality that would be much more expensive for the company to do comprehensively and from scratch. This is the trick to open source supply chain management: Dont just consume upstream code, minimally shimming it into a product. That approach wont give you any of the advantages offered by open source development practices and direct participation for solving your customers problems.
To get the most benefit from the open source software supply chain, you must **be** the open source software supply chain.
--------------------------------------------------------------------------------
作者简介:
John Mark Walker - John Mark Walker is Director of Product Management at Dell EMC and is responsible for managing the ViPR Controller product as well as the CoprHD open source community. He has led many open source community efforts, including ManageIQ,
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/be-open-source-supply-chain
作者:[John Mark Walker][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/johnmark
[1]:https://opensource.com/article/17/1/be-open-source-supply-chain?rate=sz6X6GSpIX1EeYBj4B8PokPU1Wy-ievIcBeHAv0Rv2I
[2]:https://opensource.com/article/16/12/open-source-software-supply-chain
[3]:https://www.redhat.com/en
[4]:https://www.redhat.com/en/about/press-releases/makara
[5]:https://opensource.com/user/11815/feed

View File

@ -0,0 +1,63 @@
Book review: Ours to Hack and to Own
============================================================
![Book review: Ours to Hack and to Own](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/EDUCATION_colorbooks.png?itok=liB3FyjP "Book review: Ours to Hack and to Own")
Image by : opensource.com
It seems like the age of ownership is over, and I'm not just talking about the devices and software that many of us bring into our homes and our lives. I'm also talking about the platforms and services on which those devices and apps rely.
While many of the services that we use are free, we don't have any control over them. The firms that do, in essence, control what we see, what we hear, and what we read. Not only that, but many of them are also changing the nature of work. They're using closed platforms to power a shift away from full-time work to the [gig economy][2], one that offers little in the way of security or certainty.
This move has wide-ranging implications for the Internet and for everyone who uses and relies on it. The vision of the open Internet from just 20-odd-years ago is fading and is rapidly being replaced by an impenetrable curtain.
One remedy that's becoming popular is building [platform cooperatives][3], which are digital platforms that their users own. The idea behind platform cooperatives has many of the same roots as open source, as the book "[Ours to Hack and to Own][4]" explains.
Scholar Trebor Scholz and writer Nathan Schneider have collected 40 essays discussing the rise of, and the need for, platform cooperatives as tools ordinary people can use to promote openness, and to counter the opaqueness and the restrictions of closed systems.
### Where open source fits in
At or near the core of any platform cooperative lies open source; not necessarily open source technologies, but the principles and the ethos that underlie open source—openness, transparency, cooperation, collaboration, and sharing.
In his introduction to the book, Trebor Scholz points out that:
> In opposition to the black-box systems of the Snowden-era Internet, these platforms need to distinguish themselves by making their data flows transparent. They need to show where the data about customers and workers are stored, to whom they are sold, and for what purpose.
It's that transparency, so essential to open source, which helps make platform cooperatives so appealing and a refreshing change from much of what exists now.
Open source software can definitely play a part in the vision of platform cooperatives that "Ours to Hack and to Own" shares. Open source software can provide a fast, inexpensive way for groups to build the technical infrastructure that can power their cooperatives.
Mickey Metts illustrates this in the essay, "Meet Your Friendly Neighborhood Tech Co-Op." Metts works for a firm called Agaric, which uses Drupal to build for groups and small business what they otherwise couldn't do for themselves. On top of that, Metts encourages anyone wanting to build and run their own business or co-op to embrace free and open source software. Why? It's high quality, it's inexpensive, you can customize it, and you can connect with large communities of helpful, passionate people.
### Not always about open source, but open source is always there
Not all of the essays in this book focus or touch on open source; however, the key elements of the open source way—cooperation, community, open governance, and digital freedom—are always on or just below the surface.
In fact, as many of the essays in "Ours to Hack and to Own" argue, platform cooperatives can be important building blocks of a more open, commons-based economy and society. That can be, in Douglas Rushkoff's words, organizations like Creative Commons compensating "for the privatization of shared intellectual resources." It can also be what Francesca Bria, Barcelona's CTO, describes as cities running their own "distributed common data infrastructures with systems that ensure the security and privacy and sovereignty of citizens' data."
### Final thought
If you're looking for a blueprint for changing the Internet and the way we work, "Ours to Hack and to Own" isn't it. The book is more a manifesto than user guide. Having said that, "Ours to Hack and to Own" offers a glimpse at what we can do if we apply the principles of the open source way to society and to the wider world.
--------------------------------------------------------------------------------
作者简介:
Scott Nesbitt - Writer. Editor. Soldier of fortune. Ocelot wrangler. Husband and father. Blogger. Collector of pottery. Scott is a few of these things. He's also a long-time user of free/open source software who extensively writes and blogs about it. You can find Scott on Twitter, GitHub
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/review-book-ours-to-hack-and-own
作者:[Scott Nesbitt][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/scottnesbitt
[1]:https://opensource.com/article/17/1/review-book-ours-to-hack-and-own?rate=dgkFEuCLLeutLMH2N_4TmUupAJDjgNvFpqWqYCbQb-8
[2]:https://en.wikipedia.org/wiki/Access_economy
[3]:https://en.wikipedia.org/wiki/Platform_cooperative
[4]:http://www.orbooks.com/catalog/ours-to-hack-and-to-own/
[5]:https://opensource.com/user/14925/feed
[6]:https://opensource.com/users/scottnesbitt

View File

@ -0,0 +1,74 @@
Developing open leaders
============================================================
> "Off-the-shelf" leadership training can't sufficiently groom tomorrow's organizational leaders. Here's how we're doing it.
![Developing open leaders](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_community2.png?itok=ILQK65F1 "Developing open leaders")
Image by : opensource.com
At Red Hat, we have a saying: Not everyone needs to be a people manager, but everyone is expected to be a leader.
For many people, that requires a profound mindset shift in how to think about leaders. Yet in some ways, it's what we all intuitively know about how organizations really work. As Red Hat CEO Jim Whitehurst has pointed out, in any organization, you have the thermometers—people who reflect the organizational "temperature" and sentiment and direction—and then you have the thermostats—people who _set_ those things for the organization.
Leadership is about maximizing influence and impact. But how do you develop leadership for an open organization?
In the first installment of this series, I will share the journey, from my perspective, on how we began to build a leadership development system at Red Hat to enable our growth while sustaining the best parts of our unique culture.
### Nothing 'off the shelf'
In an open organization, you can't just buy leadership development training "off the shelf" and expect it to resonate with people—or to reflect and reinforce your unique culture. But you also probably won't have the capacity and resources to build a great leadership development system entirely from scratch.
Early on in our journey at Red Hat, our leadership development efforts focused on understanding our own philosophy and approach, then taking a bit of an open source approach: sifting through the what people had created for conventional organizations, then configuring those ideas in a way that made them feasible for an open organization.
Looking back, I can also see we spent a lot of energy looking for ways to plug specific capability gaps.
Many of our people managers were engineers and other subject matter experts who stepped into management roles because that's what our organization needed. Yet the reality was, many had little experience leading a team or group. So we had some big gaps in basic management skills.
We also had gaps—not just among managers but also among individual contributors—when it came to navigating tough conversations with respect. In a company where passion runs high and people love to engage in open and heated debate, making your voice heard without shouting others down wasn't always easy.
We couldn't find any end-to-end leadership development systems that would help train people for leading in a culture that favors flatness and meritocracy over hierarchy and seniority. And while we could build some of those things ourselves, we couldn't build everything fast enough to meet our growing organization's needs.
So when we saw a need for improved goal setting, we introduced some of the best offerings available—like Closing the Execution Gap and the concept of SMART goals (i.e. specific, measurable, attainable, relevant, and time-bound). To make these work for Red Hat, we configured them to pull through themes from our own culture that could be used in tandem to make the concepts resonate and become even more powerful.
### Considering meritocracy
In a culture that values meritocracy, being able to influence others is critical. Yet the passionate open communication and debate that we love at Red Hat sometimes created hard feelings between individuals or teams. We introduced [Crucial Conversations][2] to help everyone navigate those heated and impassioned topics, and also to help them recognize that those kinds of conversations provide the greatest opportunity for influence.
After building that foundation with Crucial Conversations, we introduced [Influencer Training][3] to help entire teams and organizations communicate and gain traction for their ideas across boundaries.
We also found a lot of value in Marcus Buckingham's strengths-based approach to leadership development, rather than the conventional models that encouraged people to spend their energy shoring up weaknesses.
Early on, we made a decision to make our leadership offerings available to individual contributors as well as managers, because we saw that these skills were important for everyone in an open organization.
Looking back, I can see that this gave us the added benefit of developing a shared understanding and language for talking about leadership throughout our organization. It helped us build and sustain a culture where leadership is expected at all levels and in any role.
At the same time, training was only part of the solution. We also began developing processes that would help entire departments develop important organizational capabilities, such as talent assessment and succession planning.
Piece by piece, our open leadership system was beginning to take shape. The story of how it came together is pretty remarkable—at least to me!—and over the next few months, I'll share the journey with you. I look forward to hearing about the journeys of other open organizations, too.
_(An earlier version of this article appeared in _[The Open Organization Leaders Manual][4]_, now available as a free download from Opensource.com.)_
--------------------------------------------------------------------------------
作者简介:
DeLisa Alexander - DeLisa Alexander | DeLisa is Executive Vice President and Chief People Officer at Red Hat. Under her leadership, this team focuses on acquiring, developing, and retaining talent and enhancing the Red Hat culture and brand. In her nearly 15 years with the company, DeLisa has also worked in the Office of General Counsel, where she wrote Red Hat's first subscription agreement and closed the first deals with its OEMs.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/17/1/developing-open-leaders
作者:[DeLisa Alexander][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/delisa
[1]:https://opensource.com/open-organization/17/1/developing-open-leaders?rate=VU560k86SWs0OAchgX-ge2Avg041EOeU8BrlKgxEwqQ
[2]:https://www.vitalsmarts.com/products-solutions/crucial-conversations/
[3]:https://www.vitalsmarts.com/products-solutions/influencer/
[4]:https://opensource.com/open-organization/resources/leaders-manual
[5]:https://opensource.com/user/10594/feed
[6]:https://opensource.com/open-organization/17/1/developing-open-leaders#comments
[7]:https://opensource.com/users/delisa

View File

@ -1,230 +0,0 @@
alim0x translating
### Android 6.0 Marshmallow
In October 2015, Google brought Android 6.0 Marshmallow into the world. For the OS's launch, Google commissioned two new Nexus devices: the [Huawei Nexus 6P and LG Nexus 5X][39]. Rather than just the usual speed increase, the new phones also included a key piece of hardware: a fingerprint reader for Marshmallow's new fingerprint API. Marshmallow was also packing a crazy new search feature called "Google Now on Tap," user controlled app permissions, a new data backup system, and plenty of other refinements.
#### The new Google App
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/32-1-150x150.jpg)
][3]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/app-drawer-150x150.jpg)
][4]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-01-19.01.201-150x150.png)
][5]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/Untitled-3-150x150.gif)
][6]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/google-now-home-150x150.jpg)
][7]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/typing-150x150.jpg)
][8]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/serp-150x150.jpg)
][9]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/voice-150x150.jpg)
][10]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/icons-150x150.jpg)
][11]
Marshmallow was the first version of Android after [Google's big logo redesign][40]. The OS was updated accordingly, mainly with a new Google app that added a colorful logo to the search widget, search page, and the app icon.
Google reverted the app drawer from a paginated horizontal layout back to the single, vertically scrolling sheet. The earliest versions of Android all had vertically scrolling sheets until Google changed to a horizontal page system in Honeycomb. The scrolling single sheet made finding things in a large selection of apps much faster. A "quick scroll" feature, which let you drag on the scroll bar to bring up letter indexing, helped too. This new app drawer layout also carried over to the widget drawer. Given that the old system could easily grow to 15+ pages, this was a big improvement.
The "suggested apps" bar at the top of Marshmallow's app drawer made finding apps faster, too.
This bar changed from time to time and tried to surface the apps you needed when you needed them. It used an algorithm that took into account app usage, apps that are normally launched together, and time of day.
#### Google Now on Tap—a feature that didn't quite work out
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/ontap-150x150.jpg)
][12]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/onta3p-150x150.jpg)
][13]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/now-on-tap-150x150.jpg)
][14]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/fail1-150x150.jpg)
][15]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/youtube-150x150.jpg)
][16]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/apps-150x150.jpg)
][17]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/fail2-150x150.jpg)
][18]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/hangouts-150x150.jpg)
][19]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/voice-context-150x150.jpg)
][20]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/wrongstephen-150x150.jpg)
][21]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/assist-api-980x576-150x150.jpg)
][22]
One of Marshmallow's headline features was "Google Now on Tap." With Now on Tap, you could hold down the home button on any screen and Android would send the entire screen to Google for processing. Google would then try to figure out what the screen was about, and a special list of search results would pop up from the bottom of the screen.
Results yielded by Now on Tap weren't the usual 10 blue links—though there was always a link to a Google Search. Now on Tap could also deep link into other apps using Google's App Indexing feature. The idea was you could call up Now on Tap for a YouTube music video and get a link to the Google Play or Amazon "buy" page. Now on Tapping (am I allowed to verb that?) a news article about an actor could link to his page inside the IMDb app.
Rather than make this a proprietary feature, Google built a whole new "Assistant API" into Android. The user could pick an "Assist App" which would be granted scads of information upon long-pressing the home button. The Assist app would get all the text that was currently loaded by the app—not just what was immediately on screen—along with all the images and any special metadata the developer wanted to include. This API powered Google Now on Tap, and it also allowed third parties to make Now on Tap rivals if they wished.
Google hyped Now on Tap during Marshmallow's initial presentation, but in practice, the feature wasn't very useful. Google Search is worthwhile because you're asking it an exact question—you type in whatever you want, and it scours the entire Internet looking for the answer or web page. Now on Tap made things infinitely harder because it didn't even know what question you were asking. You opened Now on Tap with a very specific intent, but you sent Google the very unspecific query of "everything on your screen." Google had to guess what your query was and then tried to deliver useful search results or actions based on that.
Behind the scenes, Google was probably processing like crazy to brute-force out the result you wanted from an entire page of text and images. But more often than not, Now on Tap yielded what felt like a list of search results for every proper noun on the page. Sifting through the list of results for multiple queries was like being trapped in one of those Bing "[Search Overload][41]" commercials. The lack of any kind of query targeting made Now on Tap feel like you were asking Google to read your mind, and it never could. Google eventually patched in an "Assist" button to the text selection menu, giving Now on Tap some of the query targeting that it desperately needed.
Calling Now on Tap anything other than a failure is hard. The shortcut to access Now on Tap—long pressing on the home button—basically made it a hidden, hard-to-discover feature that was easy to forget about. We speculate the feature had extremely low usage numbers. Even when users did discover Now on Tap, it failed to read your mind so often that, after a few attempts, most users probably gave up on it.
With the launch of the Google Pixels in 2016, the company seemingly admitted defeat. It renamed Now on Tap "Screen Search" and demoted it in favor of the Google Assistant. The Assistant—Google's new voice command system—took over On Tap's home button gesture and related it to a second gesture once the voice system was activated. Google also seems to have learned from Now on Tap's poor discoverability. With the Assistant, Google added a set of animated colored dots to the home button that helped users discover and be reminded about the feature.
#### Permissions
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/33-1-150x150.jpg)
][23]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/34-1-150x150.jpg)
][24]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/perm-150x150.jpg)
][25]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/denied-1-150x150.jpg)
][26]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/denied-2-150x150.jpg)
][27]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/apps-150x150.jpg)
][28]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/overlay-150x150.jpg)
][29]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/system-permisions-150x150.jpg)
][30]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/warning-150x150.jpg)
][31]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/Google_IO_2015_-_Android_M_Permissions_-_YouTube_-_Google_Chrome_2015-09-04_12-31-49-150x150.jpg)
][32]
Android 6.0 finally introduced an app permissions system that gave users granular control over what data apps had access to.
Apps no longer gave you a huge list of permissions at install. With Marshmallow, apps installed without asking for any permissions at all. When apps needed a permission—like access to your location, camera, microphone, or contact list—they asked at the exact time they needed it. During your usage of an app, an "Allow or Deny" dialog popped up anytime the app wanted a new permission. Some app setup flow tackled this by asking for a few key permissions at startup, and everything else popped up as the app needed it. This better communicated to the user what the permissions are for—this app needs camera access because you just tapped on the camera button.
Besides the in-the-moment "Allow or Deny" dialogs, Marshmallow also added a permissions setting screen. This big list of checkboxes allowed data-conscious users to browse which apps have access to what permissions. They can browse not only by app, but also by permission. For instance, you could see every app that has access to the microphone.
Google had been experimenting with app permissions for some time, and these screens were basically the rebirth of the hidden "[App Ops][42]" system that was accidentally introduced in Android 4.3 and quickly removed.
While Google experimented in previous versions, the big difference with Marshmallow's permissions system was that it represented an orderly transition to a permission OS. Android 4.3's App Ops was never meant to be exposed to users, so developers didn't know about it. The result of denying an app a permission in 4.3 was often a weird error message or an outright crash. Marshmallow's system was opt-in for developers—the new permission system only applied to apps that were targeting the Marshmallow SDK, which Google used as a signal that the developer was ready for permission handling. The system also allowed for communication to users when a feature didn't work because of a denied permission. Apps were told when they were denied a permission, and they could instruct the user to turn the permission back on if you wanted to use a feature.
#### The Fingerprint API
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/finger1-150x150.jpg)
][33]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/fingerlock-150x150.jpg)
][34]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-16-17.19.36-150x150.png)
][35]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/fingerprintplaystore-150x150.jpg)
][36]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/confirm-150x150.jpg)
][37]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/2015-09-04_16-38-31-150x150.png)
][38]
Before Marshmallow, few OEMs had come up with their own fingerprint solution in response to [Apple's Touch ID][43]. But with Marshmallow, Google finally came up with an ecosystem-wide API for fingerprint recognition. The new system included UI for registering fingerprints, a fingerprint-guarded lock screen, and APIs that allowed apps to protect content behind a fingerprint scan or lock-screen challenge.
The Play Store was one of the first apps to support the API. Instead of having to enter your password to purchase an app, you could just use your fingerprint. The Nexus 5X and 6P were the first phones to support the fingerprint API with an actual hardware fingerprint reader on the back.
Later the fingerprint API became one of the rare examples of the Android ecosystem actually cooperating and working together. Every phone with a fingerprint reader uses Google's API, and most banking and purchasing apps are pretty good about supporting it.
--------------------------------------------------------------------------------
作者简介:
Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.
--------------------------------------------------------------------------------
via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/
作者:[RON AMADEO][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://arstechnica.com/author/ronamadeo
[1]:https://www.youtube.com/watch?v=f17qe9vZ8RM
[2]:https://www.youtube.com/watch?v=VOn7VrTRlA4&list=PLOU2XLYxmsIJDPXCTt5TLDu67271PruEk&index=11
[3]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[4]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[5]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[6]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[7]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[8]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[9]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[10]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[11]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[12]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[13]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[14]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[15]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[16]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[17]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[18]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[19]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[20]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[21]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[22]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[23]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[24]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[25]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[26]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[27]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[28]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[29]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[30]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[31]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[32]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[33]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[34]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[35]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[36]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[37]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[38]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/#
[39]:http://arstechnica.com/gadgets/2015/10/nexus-5x-and-nexus-6p-review-the-true-flagships-of-the-android-ecosystem/
[40]:http://arstechnica.com/gadgets/2015/09/google-gets-a-new-logo/
[41]:https://www.youtube.com/watch?v=9yfMVbaehOE
[42]:http://www.androidpolice.com/2013/07/25/app-ops-android-4-3s-hidden-app-permission-manager-control-permissions-for-individual-apps/
[43]:http://arstechnica.com/apple/2014/09/ios-8-thoroughly-reviewed/10/#h3

View File

@ -1,171 +0,0 @@
# Behind-the-scenes changes
Marshmallow expanded on the power-saving JobScheduler APIs that were originally introduced in Lollipop. JobScheduler turned app background processing from a free-for-all that frequently woke up the device to an organized system. JobScheduler was basically a background-processing traffic cop.
In Marshmallow, Google added a "Doze" mode to save even more power when a device is left alone. If a device was stationary, unplugged, and had its screen off, it would slowly drift into a low-power, disconnected mode that locked down background processing. After a period of time, network access was disabled. Wake locks—an app's request to keep your phone awake so it can do background processing—got ignored. System Alarms (not user-set alarm clock alarms) and the [JobScheduler][25] shut down, too.
If you've ever put a device in airplane mode and noticed the battery lasts forever, Doze was like an automatic airplane mode that kicked in when you left your device alone—it really did boost battery life. It worked for phones that were left alone on a desk all day or all night, and it was great for tablets, which are often forgotten about on the coffee table.
The only notification that could punch through Doze mode was a "high priority message" from Google Cloud Messaging. This was meant for texting services so, even if a device is dozing, messages still came through.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/inactive-apps-150x150.jpg)
][1]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/battery-optimizations-150x150.jpg)
][2]
"App Standby" was another power saving feature that more-or-less worked quietly in the background. The idea behind it was simple: if you stopped interacting with an app for a period of time, Android deemed it unimportant and took away its internet access and background processing privileges.
For the purposes of App Standby, "interacting" with an app meant opening the app, starting a foreground service, or generating a notification. Any one of these actions would reset the Standby timer on an app. For every other edge case, Google added a cryptically-named "Battery Optimizations" screen in the settings. This let users whitelist apps to make them immune from app standby. As for developers, they had an option in Developer Settings called "Inactive apps" which let them manually put an app on standby for testing.
App Standby basically auto-disabled apps you weren't using, which was a great way to fight battery drain from crapware or forgotten-about apps. Because it was completely silent and automatically happened in the background, it helped even novice users have a well-tuned device.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/autobackup-150x150.jpg)
][3]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/07/backup2-150x150.jpg)
][4]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/BACKUP1-150x150.jpg)
][5]
Google tried many app backup schemes over the years, and in Marshmallow it [took another swing][26]. Marshmallow's brute force app backup system aimed to dump the entire app data folder to the cloud. It was possible and technically worked, but app support for it was bad, even among Google apps. Setting up a new Android phone is still a huge hassle, with countless sign-ins and tutorial popups.
In terms of interface, Marshmallow's backup system used the Google Drive app. In the settings of Google Drive, there's now a "Manage Backups" screen, which showed app data not only from the new system, but also every other app backup scheme Google has tried over the years.
![Android's App Linking settings, basically a URL forwarding system for apps. ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/app-linkingf-980x576-980x576.jpg)
Buried in the settings was a new "App linking" feature, which could "link" an app to a website. Before app linking, opening up a Google Maps URL on a fresh install usually popped up an "Open With" dialog box that wanted to know if it should open the URL in a browser or in the Google Maps app.
This was a silly question, since of course you wanted to use the app instead of the website—that's why you had the app installed. App linking let website owners associate their app with their webpage. If users had the app installed, Android would suppress the "Open With" dialog and use that app instead. To activate app linking, developers just had to throw some JSON code on their website that Android would pick up.
App linking was great for sites with an obvious app client, like Google Maps, Instagram, and Facebook. For sites with an API and multiple clients, like Twitter, the App Linking settings screen gave users control over the default app association for any URL. Out-of-the-box app linking covered 90 percent of use cases though, which cut down on the annoying pop ups on a new phone.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/adopt1-150x150.jpg)
][6]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/setup-150x150.jpg)
][7]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/format1-150x150.jpg)
][8]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/move-data-150x150.jpg)
][9]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/downloads-150x150.jpg)
][10]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/removingisbad-150x150.jpg)
][11]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/explorer-150x150.jpg)
][12]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/sort-options-150x150.jpg)
][13]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/gridorlist-150x150.jpg)
][14]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/file-mange-150x150.jpg)
][15]
Adoptable storage was one of Marshmallow's best features. It turned SD cards from a janky secondary storage pool into a perfect merged-storage solution. Slide in an SD card, format it, and you instantly had more storage in your device that you never had to think about again.
Sliding in a SD card showed a setup notification, and users could choose to format the card as "portable" or "internal" storage. The "Internal" option was the new adoptable storage mode, and it paved over the card with an ext4 file system. The only downside? The card and the data were both "locked" to your phone. You couldn't pull the card out and plug it into anything without formatting it first. Google was going for a set-it-and-forget-it use case with internal storage.
If you did yank the card out, Android did its best to deal with things. It popped up a message along the lines of "You'd better put that back or else!" along with an option to "forget" the card. Of course "forgetting" the card would result in all sorts of data loss, and it was not recommended.
The sad part of adoptable storage is that devices that could actually use it didn't come for a long time. Neither Nexus device had an SD card, so for the review we rigged up a USB stick as our adoptable storage. OEMs initially resisted the feature, with [LG and Samsung][27] disabling it on their early 2016 flagships. Samsung stated that "We believe that our users want a microSD card to transfer files between their phone and other devices," which was not possible once the card was formatted to ext4.
Google's implementation let users choose between portable and internal formatting options. But rather than give users that choice, OEMs completely took the internal storage feature away. Advanced users were unhappy about this, and of course the Android modding scene quickly re-enabled adoptable storage. On the Galaxy S7, modders actually defeated Samsung's SD card lockdown [a day before][28] the device was even officially released!
#### Volume and Notifications
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/1-2-150x150.jpg)
][16]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/2-4-150x150.jpg)
][17]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/dnd1-150x150.jpg)
][18]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/2015-09-13-05.13.49-150x150.png)
][19]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/2015-09-08-19.58.51-150x150.png)
][20]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/dnd11-150x150.jpg)
][21]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/dnd4-150x150.jpg)
][22]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/10/3-3-150x150.jpg)
][23]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/2015-09-08-19.23.13-150x150.png)
][24]
Google walked back the priority notification controls that were in the volume popup in favor of a simpler design. Hitting the volume key popped up a single slider for the current audio source, along with a drop down button that expanded the controls to show all three audio sliders: Notifications, media, and alarms. All the priority notification controls still existed—they just lived in a "do not disturb" quick-settings tile now.
One of the most relieving additions to the notification controls gave users control over Heads-Up notifications—now renamed "Peek" notifications. This feature let notifications pop up over the top portion of the screen, just like on iOS. The idea was that the most important notifications should be elevated over your normal, everyday notifications.
However, in Lollipop, when this feature was introduced, Google had the terrible idea of letting developers decide if their apps were "important" or not. Of course, every developer thinks its app is the most important thing in the world. So while the feature was originally envisioned for instant messages from your closest contacts, it ended up being hijacked by Facebook "Like" notifications. In Marshmallow, every app got a "treat as priority" checkbox in the notification settings, which gave users an easy ban hammer for unruly apps.
--------------------------------------------------------------------------------
作者简介:
Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.
--------------------------------------------------------------------------------
via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/
作者:[RON AMADEO][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://arstechnica.com/author/ronamadeo
[1]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[2]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[3]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[4]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[5]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[6]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[7]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[8]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[9]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[10]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[11]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[12]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[13]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[14]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[15]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[16]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[17]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[18]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[19]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[20]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[21]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[22]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[23]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[24]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/#
[25]:http://arstechnica.com/gadgets/2014/11/android-5-0-lollipop-thoroughly-reviewed/6/#h2
[26]:http://arstechnica.com/gadgets/2015/10/android-6-0-marshmallow-thoroughly-reviewed/6/#h2
[27]:http://arstechnica.com/gadgets/2016/02/the-lg-g5-and-galaxy-s7-wont-support-android-6-0s-adoptable-storage/
[28]:http://www.androidpolice.com/2016/03/10/modaco-manages-to-get-adoptable-sd-card-storage-working-on-the-galaxy-s7-and-galaxy-s7-edge-no-root-required/

View File

@ -1,185 +0,0 @@
# Monthly security updates
[
![Check out that new "Android security patch level" field. ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5-980x957.jpg)
][31]
A few months before the release of Marshmallow, [vulnerabilities][32] in Android's "Stagefright" media server were disclosed to the public, which could allow for remote code execution on older versions of Android. Android took a beating in the press, with [a billion phones][33] affected by the newly discovered bugs.
Google responded by starting a monthly Android security update program. Every month it would round up bugs, fix them, and push out new code to AOSP and Nexus devices. OEMs—who were already struggling with updates (possibly due to apathy)—were basically told to "deal with it" and keep up. Every other major operating system has frequent security updates—it's just the cost of being such a huge platform. To accommodate OEMs, Google give them access to the updates a full month ahead of time. After 30 days, security bulletins are posted and Google devices get the updates.
The monthly update program started two months before the release of Marshmallow, but in this major OS update Google added an "Android Security Patch Level" field to the About Phone screen. Rather than use some arcane version number, this was just a date. This let anyone easily see how out of date their phone was, an acted as a nice way to shame slow OEMs.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/text-150x150.jpg)
][2]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/extra-150x150.jpg)
][3]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/translate-150x150.jpg)
][4]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/chromecustomtab-150x150.jpg)
][5]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/CCT_Large-2-150x150.gif)
][6]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-5-150x150.jpg)
][7]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-1-150x150.jpg)
][8]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings2-150x150.jpg)
][9]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-3-150x150.jpg)
][10]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/nearby-150x150.jpg)
][11]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-6-150x150.jpg)
][12]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-7-150x150.jpg)
][13]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-8-150x150.jpg)
][14]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-9-150x150.jpg)
][15]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-03-18.21.17-150x150.png)
][16]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-04-05.32.23-150x150.png)
][17]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/easter-egg-150x150.jpg)
][18]
The text selection menu is now a floating toolbar that pops up right next to the text you're selecting. This wasn't just the regular "cut/copy/paste" commands, either. Apps could put special options on the toolbar, like the "add link" option in Google Docs.
After the standard text commands, an ellipsis button would expose a second menu, and it was here that apps could add extra features to the text selection menu. Using a new "text processing" API, it was now super easy to ship text directly to another app. If you had Google Translate installed, a "translate" option would show up in this menu. Eventually Google Search added an "Assist" option to this menu for Google Now on Tap.
Marshmallow added a hidden settings section called the "System UI Tuner." This section would turn into a catch-all for power user features and experimental items. To access this you had to pull down the notification panel and hold down on the "settings" button for several seconds. The settings gear would spin, and eventually you'd see a message indicating that the System UI Tuner was unlocked. Once it was turned on, you could find it as the bottom of the system settings next to Developer Options.
In this first version of the System UI Tuner, users would add custom tiles to the Quick Settings panel, a feature that would later be refined into an API apps could use. For now the feature was very rough, basically allowing users to type a custom command into a text box. System status icons could be individually turned on and off, so if you really hated knowing you were connected to Wi-Fi, you could kill the icon. A popular power user addition was the option for embedding a percentage readout into the battery icon. There was also a "demo" mode for screenshots, which would replace the normal status bar with a fake, clean version.
### Android 7.0 Nougat, Pixel Phones, and the future
[Android 7.0 Nougat][34] and [the Pixel Phones][35] came out just a few months ago, and you can read our full reviews for both of them. Both still have a ton of features and implications that we have not seen come to fruition yet, so we'll save a deep "history" dive for when they are actually "history." 
### FURTHER READING
[Android 7.0 Nougat review—Do more on your gigantic smartphone][25]
Nougat made serious changes to the [graphics and sensor pipeline][36] for Daydream VR, Google's upcoming smartphone-powered VR experience [we tried][37] but have yet to log any serious time with. A new "Seamless update" feature borrowed an update mechanism from Chrome OS, which uses dual system partitions to quietly update one partition in the background while you're still using the other one. Considering the Pixel phones are the only devices to launch with this and haven't gotten an update yet, we're not sure what that looks like, either.
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.21.22-150x150.png)
][19]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.20.59-150x150.png)
][20]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/Android-N_1-150x150.jpg)
][21]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/03/2016-03-20-19.26.55-150x150.png)
][22]
* [
![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/pip-active-150x150.png)
][23]
One of the most interesting additions to Nougat is a revamp of the app framework to allow for resizable apps. This allowed Google to implement split screen on phones and tablets, picture-in-picture on Android TV, and a mysterious floating windowed mode. We've been able to access the floating window mode with some software trickery, but we've yet to see Google use it in an actual product. Is it being aimed at desktop computing?
Android and Chrome OS also continue to grow together. Android apps [can run][38] on some Chromebooks now, giving the "Web-only" OS the Play Store and a serious app ecosystem. Rumors continue to swirl that the future of Chrome OS and Android will come even closer together, with the name "[Andromeda][39]"—a portmanteau of "Android" and "Chrome"—being tossed around as the codename for a merged Chrome/Android OS.
We have yet to see how the historical legacy of the Pixel phones will shake out. Google dove into the hardware pool with the launch of two new smartphone flagships, the Pixel and Pixel XL, only recently. Google had produced co-branded Nexus phones with partners before, but the Pixel line is a "Google" branded product. The company claims it is a full hardware OEM now, using HTC as a contract manufacturer similarly to the way Apple uses Foxconn.
### FURTHER READING
[Google Pixel review: The best Android phone, even if it is a little pricey][26]</aside>
With its own hardware comes a change in how Google makes software. The company created the "Google Assistant" as the future of the "OK Google" voice command system. But rather than ship it out to every Android device, the Assistant is an exclusive Pixel feature. Google made some changes to the interface, with a custom "Pixel launcher" home screen app and a new System UI, both of which are Pixel exclusives. We'll have to wait to see what the balance of future features are between "Android" and "Pixel" going forward.
### FURTHER READING
[Chatting with Googles Hiroshi Lockheimer about Pixel, Android OEMs, and more][27]</aside>
With these changes, we're probably at the most uncertain point in Android's history. But ahead of the platform's recent October 2016 event, [Hiroshi Lockheimer][40], SVP of Android, Chrome OS, and Google Play, said he believed we'll all look back fondly on these latest Android developments. Lockheimer is essentially the current king of software at Google, and he thought the newest updates could be the most significant Android happening since the OS debuted eight years earlier. While he wouldn't elaborate much on this sentiment after the unveilings, the fact remains that this time next year we _might_ not even be talking about Android—it could be an Android/Chrome OS hybrid! So as has always been the case since 2008, the next chapter in Android's history looks to be nothing if not interesting.
--------------------------------------------------------------------------------
作者简介:
Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.
--------------------------------------------------------------------------------
via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/
作者:[RON AMADEO][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://arstechnica.com/author/ronamadeo
[1]:http://android-developers.blogspot.com/2015/09/chrome-custom-tabs-smooth-transition.html
[2]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[3]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[4]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[5]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[6]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[7]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[8]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[9]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[10]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[11]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[12]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[13]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[14]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[15]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[16]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[17]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[18]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[19]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[20]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[21]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[22]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[23]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[24]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[25]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[26]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[27]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[28]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[29]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[30]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[31]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[32]:http://arstechnica.com/security/2015/07/950-million-android-phones-can-be-hijacked-by-malicious-text-messages/
[33]:http://arstechnica.com/security/2015/10/a-billion-android-phones-are-vulnerable-to-new-stagefright-bugs/
[34]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[35]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[36]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/11/#h1
[37]:http://arstechnica.com/gadgets/2016/10/daydream-vr-hands-on-googles-dumb-vr-headset-is-actually-very-clever/
[38]:http://arstechnica.com/gadgets/2016/05/if-you-want-to-run-android-apps-on-chromebooks-youll-need-a-newer-model/
[39]:http://arstechnica.com/gadgets/2016/09/android-chrome-andromeda-merged-os-reportedly-coming-to-the-pixel-3/
[40]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/

View File

@ -1,125 +0,0 @@
Tarnslating by Yinr
The Beginners Guide to Start Using Vim
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/03/vim-beginner-guide-featured.jpg "The Beginner's Guide to Start Using Vims")
This article is part of the [VIM User Guide][12] series:
* The Beginners Guide to Start Using Vim
* [Vim Keyboard Shortcuts Cheatsheet][3]
* [5 Vim Tips and Tricks for Experienced Users][4]
* [3 Useful VIM Editor Tips and Tricks for Advanced Users][5]
Choosing a text editor is a very important decision for a programmer. This is partly because of the plethora of variables: graphical/non-graphical interfaces, different shortcuts, language specializations, plugins, customizations, etc. My advice is not to try to search for the best one. Instead, choose the one that corresponds best to your habits and your tasks. If you want to work in a group, its generally best to select the same editor as your co-worker. That way, if you have a problem, you will be able to find some help.
It is exactly for that reason that I started using Vim a few years ago. Traditionally, Vim is placed in conflict with the legendary Emacs. I confess that I know very little about Emacs, but what you have to know about these two text editors is that they can both be fully customized, and very confusing at first. This tutorial will not explain everything about Vim but will try to give you the basics to use it correctly in the first place, and then present a few tips that will (I hope) allow you to learn on your own.
Vim comes from “VI iMproved”. Vi is a non-graphical text editor widely distributed in Unix systems. It comes by default with Linux. Vim is an enhancement of this original editor. However, unlke Vi, Vim is not installed by default on every distribution.
### Installation
To install Vim on Ubuntu, use the command:
```
sudo apt-get install vim
```
If you are already interested in some plugins, use the command:
```
sudo apt-cache search vim
```
This will give you a long list of packages related to Vim. Among them are some for various programming languages, addon managers, etc.
For this tutorial, I will be using the latest version of Vim (7.3.154) on Ubuntu. You can use any other version though.
### Warming Up
Type the command `vim` in a terminal. You should see a nice welcome screen.
![vim-welcome](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-welcome.jpg "vim-welcome")
And if youve never used Vi or Vim before, it is very likely that you dont even know how to exit… Yes, its true. **None of the shortcuts you normally use will work in Vim**.
First of all, to use any menu-type function like save or exit, your command should begin with a colon (:). Saving is `:w` and quitting is `:q`. If you want to quit a file without saving, use the force quit command `:q!`. A cool thing with Vim is that you dont have to type commands separately. In other words, if you want to save and then quit, you can directly use `:wq`.
So for now, quit Vim and open it on a sample text file. Simply add the name of the text file that you want to edit after the command:
```
vim [text file name]
```
![vim-file](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-file.jpg "vim-file")
By default, when you open a text file, you are in visual mode. It is quite specific to Vim and confusing at the beginning. Vim is composed mainly of two modes: visual and editing. The visual mode is for viewing a text and using some commands. To go into editing mode, just press `i` to insert and `a` to add some text. To go back into the visual mode and access all the menu-type functions, press the “Escape” key. The difference between insertion and addition is simply whether you want the text you type to appear before or after the cursor in visual mode. To understand this fully, you should really try it yourself. My advice is: add at the end of lines, and insert in other cases.
To move the cursor within a text, whether you are in visual or editing mode, you can generally use the keyboard arrows. A real purist would tell you to use the keys _h_ for left, _j_for down, _k_ for up, and _l_ for right.
Now that you are warmed up and know how to control Vim at a basic level, lets go to the core.
### A few basic commands
Now that you master the transformation from visual to editing mode, here are a few commands that you can use in visual mode:
* _x_: to delete a character
* _u_: to undo an action (the equivalent of Ctrl+z)
* _dd_: to delete a line
* _dw_: to delete a word
* _yy_: to copy a line
* _yw_: to copy a word
* _p_: to paste the previously deleted or copied line or word
* _e _: to move to the next word (faster than just moving with the arrow keys)
* _r_: to replace a letter (press _r_, then the new letter)
And of course, there are more, but this is enough for now. If you master all of them, you will already be very fluent with Vim.
As a side note for those who always want more, you can type a number before any of these commands and the command will be executed that number of times. For example, _5x_ will delete five characters in a row, while _3p_ will paste three times.
### Advanced Commands
Finally, as a bonus and an appetizer for your own research, here are a few advanced and very useful commands:
* _/searched_word _: to search for a word within the text
* _:sp name_of_a_text_file_: will split the screen in half horizontally, showing the new text file in the other half. To shift the focus from the right to the left window, use the shortcut Ctrl+w
![vim-sp](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-sp.jpg "vim-sp")
* _:vsp name_of_a_text_file_: same as before, but splits the screen vertically
* Ctrl+Shift+C and Ctrl+Shift+V: to copy and paste text in a terminal
* _:! name_of_a_command_: to launch a command external to Vim, directly into your shell. For example, `:! ls` will display the files within the directory you are currently working in, without quitting the editor
![vim-ls](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2012/02/vim-ls.jpg "vim-ls")
### Conclusion
I think you now have every tool you need to start using Vim. You can go even further by installing the various plugins, editing the _.vimrc_ file, or even using the interactive tutor by typing the command _vimtutor_.
If you have any other commands that you would like to share about Vim, please let us know in the comments.
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/start-with-vim-linux/
作者:[Himanshu Arora][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/adrienbrochard/
[2]:https://www.maketecheasier.com/start-with-vim-linux/#comments
[3]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[4]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[5]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fstart-with-vim-linux%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fstart-with-vim-linux%2F&text=The+Beginner%26%238217%3Bs+Guide+to+Start+Using+Vim
[9]:mailto:?subject=The%20Beginner%E2%80%99s%20Guide%20to%20Start%20Using%20Vim&body=https%3A%2F%2Fwww.maketecheasier.com%2Fstart-with-vim-linux%2F
[10]:https://www.maketecheasier.com/turn-dropbox-into-a-blogging-tool-with-scriptogram/
[11]:https://www.maketecheasier.com/4-sms-back-up-applications-to-keep-your-messages-safe-android/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343

View File

@ -1,216 +0,0 @@
Vim Keyboard Shortcuts Cheatsheet
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2013/12/vim-shortcut-cheatsheet-featured.jpg "Vim Keyboard Shortcuts Cheatsheets")
This article is part of the [VIM User Guide][12] series:
* [The Beginners Guide to Start Using Vim][3]
* Vim Keyboard Shortcuts Cheatsheet
* [5 Vim Tips and Tricks for Experienced Users][4]
* [3 Useful VIM Editor Tips and Tricks for Advanced Users][5]
The Vim editor is a command-line based tool thats an enhanced version of the venerable vi editor. Despite the abundance of graphical rich text editors, familiarity with Vim will help every Linux user — from an experienced system administrator to a newbie Raspberry Pi user.
The light-weight editor is a very powerful tool. In the hands of an experienced operator, it can do wonders. Besides regular text editing functions, the editor also supports advanced features such as find & replace based on regular expressions and encoding conversion as well as programming features such as syntax highlighting and code folding.
One important thing to note when using Vim, is that the function of a key depends on the “mode” the editor is in. For example, pressing the alphabet “j” will move the cursor down one line in the “command mode”. Youll have to switch to the “insert mode” to make the keys input the character they represent.
Heres a cheatsheet to help you get the most out of Vim.
### Main
| Shortcut Keys | Function |
| --- | --- |
| Escape key | Gets out of the current mode into the “command mode”. All keys are bound of commands. |
| i | “Insert mode” for inserting text. Keys behave as expected. |
| : | “Last-line mode” where Vim expects you to enter a command such as to save the document. |
### Navigation keys
| Shortcut Keys | Function |
| --- | --- |
| h | moves the cursor one character to the left. |
| j or Ctrl + J | moves the cursor down one line. |
| k or Ctrl + P | moves the cursor up one line. |
| l | moves the cursor one character to the right. |
| 0 | moves the cursor to the beginning of the line. |
| $ | moves the cursor to the end of the line. |
| ^ | moves the cursor to the first non-empty character of the line |
| w | move forward one word (next alphanumeric word) |
| W | move forward one word (delimited by a white space) |
| 5w | move forward five words |
| b | move backward one word (previous alphanumeric word) |
| B | move backward one word (delimited by a white space) |
| 5b | move backward five words |
| G | move to the end of the file |
| gg | move to the beginning of the file. |
### Navigate around the document
| Shortcut Keys | Function |
| --- | --- |
| ( | jumps to the previous sentence |
| ) | jumps to the next sentence |
| { | jumps to the previous paragraph |
| } | jumps to the next paragraph |
| [[ | jumps to the previous section |
| ]] | jumps to the next section |
| [] | jump to the end of the previous section |
| ][ | jump to the end of the next section |
### Insert text
| Shortcut Keys | Function |
| --- | --- |
| a | Insert text after the cursor |
| A | Insert text at the end of the line |
| i | Insert text before the cursor |
| o | Begin a new line below the cursor |
| O | Begin a new line above the cursor |
### Special inserts
| Shortcut Keys | Function |
| --- | --- |
| :r [filename] | Insert the file [filename] below the cursor |
| :r ![command] | Execute [command] and insert its output below the cursor |
### Delete text
| Shortcut Keys | Function |
| --- | --- |
| x | delete character at cursor |
| dw | delete a word. |
| d0 | delete to the beginning of a line. |
| d$ | delete to the end of a line. |
| d) | delete to the end of sentence. |
| dgg | delete to the beginning of the file. |
| dG | delete to the end of the file. |
| dd | delete line |
| 3dd | delete three lines |
### Simple replace text
| Shortcut Keys | Function |
| --- | --- |
| r{text} | Replace the character under the cursor with {text} |
| R | Replace characters instead of inserting them |
### Copy/Paste text
| Shortcut Keys | Function |
| --- | --- |
| yy | copy current line into storage buffer |
| ["x]yy | Copy the current lines into register x |
| p | paste storage buffer after current line |
| P | paste storage buffer before current line |
| ["x]p | paste from register x after current line |
| ["x]P | paste from register x before current line |
### Undo/Redo operation
| Shortcut Keys | Function |
| --- | --- |
| u | undo the last operation. |
| Ctrl+r | redo the last undo. |
### Search and Replace keys
| Shortcut Keys | Function |
| --- | --- |
| /search_text | search document for search_text going forward |
| ?search_text | search document for search_text going backward |
| n | move to the next instance of the result from the search |
| N | move to the previous instance of the result |
| :%s/original/replacement | Search for the first occurrence of the string “original” and replace it with “replacement” |
| :%s/original/replacement/g | Search and replace all occurrences of the string “original” with “replacement” |
| :%s/original/replacement/gc | Search for all occurrences of the string “original” but ask for confirmation before replacing them with “replacement” |
### Bookmarks
| Shortcut Keys | Function |
| --- | --- |
| m {a-z A-Z} | Set bookmark {a-z A-Z} at the current cursor position |
| :marks | List all bookmarks |
| `{a-z A-Z} | Jumps to the bookmark {a-z A-Z} |
### Select text
| Shortcut Keys | Function |
| --- | --- |
| v | Enter visual mode per character |
| V | Enter visual mode per line |
| Esc | Exit visual mode |
### Modify selected text
| Shortcut Keys | Function |
| --- | --- |
| ~ | Switch case |
| d | delete a word. |
| c | change |
| y | yank |
| > | shift right |
| < | shift left |
| ! | filter through an external command |
### Save and quit
| Shortcut Keys | Function |
| --- | --- |
| :q | Quits Vim but fails when file has been changed |
| :w | Save the file |
| :w new_name | Save the file with the new_name filename |
| :wq | Save the file and quit Vim. |
| :q! | Quit Vim without saving the changes to the file. |
| ZZ | Write file, if modified, and quit Vim |
| ZQ | Same as :q! Quits Vim without writing changes |
### Download VIM Keyboard Shortcuts Cheatsheet
Cant get enough of this? We have prepared a downloadable cheat sheet for you so you can access to it when you need it.
[Download it here!][14]
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
作者:[Himanshu Arora][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/mayank/
[2]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/#comments
[3]:https://www.maketecheasier.com/start-with-vim-linux/
[4]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[5]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-keyboard-shortcuts-cheatsheet%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-keyboard-shortcuts-cheatsheet%2F&text=Vim+Keyboard+Shortcuts+Cheatsheet
[9]:mailto:?subject=Vim%20Keyboard%20Shortcuts%20Cheatsheet&body=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-keyboard-shortcuts-cheatsheet%2F
[10]:https://www.maketecheasier.com/locate-system-image-tool-in-windows-81/
[11]:https://www.maketecheasier.com/create-system-image-in-windows8/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343
[14]:http://www.maketecheasier.com/cheatsheet/vim-keyboard-shortcuts-cheatsheet/

View File

@ -1,131 +0,0 @@
ucasFL translating
5 Vim Tips and Tricks for Experienced Users
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-tips-tricks-featured.jpg "5 Vim Tips and Tricks for Experienced Userss")
This article is part of the [VIM User Guide][12] series:
* [The Beginners Guide to Start Using Vim][3]
* [Vim Keyboard Shortcuts Cheatsheet][4]
* 5 Vim Tips and Tricks for Experienced Users
* [3 Useful VIM Editor Tips and Tricks for Advanced Users][5]
The Vim editor offers so many features that its very difficult to learn all of them. While, of course, spending more and more time on the command line editor always helps, there is no denying the fact that you learn new and productive things faster while interacting with fellow Vim users. Here are some Vim tips and tricks for you.
**Note**  To create the examples here, I used Vim version 7.4.52.
### 1\. Working with multiple files
If you are a software developer or someone who uses Vim as their primary editor, chances are that you have to work with multiple files simultaneously. Following are some useful tips that you can use while working with multiple files.
Instead of opening different files in different shell tabs, you can open multiple files in a single tab by passing their filenames as arguments to the vim command. For example:
```
vim file1 file2 file3
```
The first file (file1 in the example) will be the current file and read into the buffer.
Once inside the editor, use the `:next` or `:n` command to move to the next file, and the `:prev` or `:N` command to return to the previous one. To directly switch to the first or the last file, use `:bf` and `:bl` commands, respectively. To open and start editing another file, use the `:e` command with the filename as argument (use the complete path in case the file is not present in the current directory).
At any point if it is required to list down currently opened files, use the `:ls` command. See the screen shot shown below.
![vim-ls](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-ls.png "vim-ls")
Note that “%a” represents the file in the current active window, while “#” represents the file in the previous active window.
### 2\. Save time with auto complete
Want to save time and improve accuracy? Use abbreviations. They come in handy while writing long, complex words that recur frequently throughout the file. The Vim command for abbreviations is `ab`. For example, after you run the command
```
:ab asap as soon as possible
```
each occurrence of the word “asap” will be automatically replaced by “as soon as possible”, as you type.
Similarly, you can also use abbreviations to correct common typing mistakes. For example, the command
```
:ab recieve receive
```
will automatically correct the spelling mistake as you type. If you want to prevent the expansion/correction from happening at a particular occurrence, just type “Ctrl + V” after the last character of the word and then press the space bar key.
If you want to save the abbreviation youve created so that it is available to you the next time you use the Vim editor, add the complete `ab` command (without the initial colon) to “/etc/vim/vimrc” file. To remove a particular abbreviation, you can use the `una`command. For example, `:una asap`.
### 3\. Split windows to easily copy/paste
There are times when you want to copy a piece of code or a portion of text from one file to another. While the process is easy when working with GUI editors, it gets a bit tedious and time-consuming while working with a command line editor. Fortunately, Vim provides a way to minimize the time and effort required to do this.
Open one of the two files and then split the Vim window to open the other file. This can be done by using the `split` command with the file name as argument. For example,
```
:split test.c
```
will split the window and open “test.c”.
![vim-split](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-split.png "vim-split")
Observe that the command split the Vim window horizontally. In case you want to split the window vertically, you can do so using the `vsplit` command. Once both the files are opened, copy the stuff from one file, press “Ctrl + w” to switch the control to another file, and paste.
### 4\. Save a file you edited without the required permissions
There are times when you realize that a file is read-only only after making a bunch of changes to it.
![vim-sudo](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-sudo.png "vim-sudo")
Although closing the file and reopening it with the required permissions is a way out, its a sheer waste of time if youve already made a lot of changes, as all of them will be lost during the process. Vim provides you a way to handle this situation by allowing you to change the file permissions from within the editor before you save it. The command for this is:
```
:w !sudo tee %
```
The command will ask you for the password, just like `sudo` does on the command line, and will then save the changes.
**A related tip**: To quickly access the command prompt while editing a file in Vim, run the `:sh` command from within the editor. This will place you in an interactive shell. Once you are done, run the `exit` command to quickly return to your Vim session.
### 5\. Preserve indentation during copy/paste
Most of the experienced programmers work on Vim with auto indentation enabled. Although its a time-saving practice, it creates a problem while pasting an already indented code. For example, this is what happened when I pasted an already indented code into a file opened in Vim editor with auto indent on.
![vim-indentation](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2014/08/vim-indentation.png "vim-indentation")
The solution to this problem is the `pastetoggle` option. Add the line
```
set pastetoggle=<F2>
```
to your vimrc file, and press F2 in insert mode just before pasting the code. This should preserve the original indentation. Note that you can replace F2 with any other key if its already mapped to some other functionality.
### Conclusion
The only way you can further improve your Vim editor skills is by using the command line editor for your day-to-day work. Just note down the actions that take time and then try to find out if there is an editor command that will do the actions more quickly.
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
作者:[Himanshu Arora][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/himanshu/
[2]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/#comments
[3]:https://www.maketecheasier.com/start-with-vim-linux/
[4]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[5]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-for-experienced-users%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-for-experienced-users%2F&text=5+Vim+Tips+and+Tricks+for+Experienced+Users
[9]:mailto:?subject=5%20Vim%20Tips%20and%20Tricks%20for%20Experienced%20Users&body=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-for-experienced-users%2F
[10]:https://www.maketecheasier.com/enable-two-step-verification-apple-icloud-account/
[11]:https://www.maketecheasier.com/mistakes-wordpress-user-should-avoid/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343

View File

@ -1,3 +1,5 @@
Martin translating...
Network automation with Ansible
================

View File

@ -0,0 +1,138 @@
6 Best JavaScript Frameworks to Learn In 2016
===========================================
![6 Best JavaScript Frameworks to Learn In 2016](https://discoversdkcdn.azureedge.net/postscontent/products/java.png)
**If all roads lead to Rome, which one should we take? **JavaScript has been known in the web development community since the arrival of modern technologies that helped in the building of the front-end of websites. It supports HTML (that is used for the _presentation _or _layout _of the pages) by extending its several functionalities and providing the logical executions on the website. Without it, websites can't have any _interactive _features.
The modern culture of Frameworks and Libraries has risen from the abyss when older technologies started to separate the functionalities into modules. Now, instead of supporting everything in the core language, the developers made it free for everyone to create libraries and frameworks that enhance the functionality of the core language. This way, the flexibility of the language has been increased dramatically.
If you have been using **JavaScript** (along with **JQuery**) to support HTML, then you know that it requires a great deal of effort and complex in code to develop and the maintain a large application. JavaScript Frameworks help to quickly build interactive web applications (which includes both single page and multiple page applications).
When a newbie developer wants to learn JavaScript, he is usually attracted to JavaScript Frameworks which, thanks to the huge rise in their communities, any developer can easily learn from online tutorials and other resources.
But, alas! Most programmers find it hard to decide which framework to learn and use from. Thus, in this article, I am going to highlight the 6 Best JavaScript Frameworks to learn in 2016\. Let's get started!
**6 Best JavaScript Frameworks to Learn In 2016**
**1) AngularJS**
**
![Angular](https://discoversdkcdn.azureedge.net/postscontent/products/AngularJS_logo.svg.png)
**
**(Note: This is my personal favorite JavaScript Framework)**
Whenever someone hears about JavaScript, there is a high probability that they have already heard about AngularJS, as this is the most commonly used JavaScript Framework among the JavaScript community. Released in 2009, it was developed by Google (which is convincing enough to use it), and it's an open-source project, which means you can read, edit and modify the original source code for your specific needs without giving any money to its developers (isn't that cool?).
If you have difficulty building complex web applications through pure JavaScript code, then you will jump out of your seat in excitement to know that it will dramatically ease your life. It supports the **MVC (Modelviewcontroller)** design paradigm which supports standard two-way data binding. In case you are not familiar with MVC, then know that it just means that your data is updated on both the front-end (i.e. user-interface side) and back-end (i.e. coding or server side) whenever it detects some changes in the engine.
MVC drastically reduces the time and efforts needed for building complex applications, as you need to focus on one area at a time (because DOM programming interface synchronizes the view and the model). As the _View _components are separated from the _Model _components, you can easily build reusable components for amazing and cool looking user-interfaces!
If for any reason, you have used **TypeScript** (which is a language similar to JavaScript), then you will feel at home with AngularJS, as its syntax highly resembles the TypeScript syntax. This choice was made to attract the audience as **TypeScript** was gaining popularity.
Angular 2.0 has recently been released, which claims to improve the performance of mobile, which is enough to convince new developers that this framework is high in development and updates regularly.
There are many users of AngularJS, including (but not limited to) Udemy, Forbes, GoDaddy, Ford, NBA, The Oscars, etc.
This JavaScript Framework is highly recommended for anyone who wants a powerful MVC framework with a strong and modern infrastructure that takes care of everything for you to build single page applications. This should be the first stop-shop for any experienced JavaScript developer.
**2) React**
**
![React](https://discoversdkcdn.azureedge.net/postscontent/react%20%281%29.png)
**
Similar to AngularJS, React is also an **MVC (Model-View-Controller)** type framework, however, it focuses entirely on the _View _components (as it was specifically designed for the UI) and can be seamlessly integrated with any architecture. This means you can use it right away for your websites!
It abstracts the DOM programming interface (and thus uses the virtual DOM) from the core functionality, so you get extremely fast rendering of the UI, which enables you to use it from **_node.js_** as a client-side framework. It was developed as an open-source project by Facebook with various contributions from other people.
If you have seen and like Facebook and Instagrams interfaces, then you will love React. Through React, you can design simple views for each state in your application, and when the data changes, then it updates automatically. Any kind of complex UIs can be created, which can be reused in whatever applications you want. For the servers, React also supports rendering using **_node.js_**. React is flexible enough to use with other interfaces.
Apart from Facebook and Instagram, there are several companies that use React, including Whatsapp, BBC, PayPal, Netflix, Dropbox, etc.
I would highly recommend this Framework if you just need a front-end development Framework to build an incredibly complex and awesome UI through the power View Layers, but you are experienced enough to handle any kind of JavaScript code, and when you don't require the other components (as you can integrate them yourself).
**3) Ember**
**
![Ember](https://discoversdkcdn.azureedge.net/postscontent/Ember.js_Logo_and_Mascot.png)
**
This JavaScript Framework was released in 2011 as an open-source project by _Yehuda Katz_. It has a huge active community online, so the moment you face any problem, you can ask them. It uses many common JavaScript idioms and best practices to ensure that developers get the best right out of the box.
It uses **Modelviewviewmodel (MVVM)** design pattern, which is slightly different than MVC in the sense that it has a _binder _to help the communication between the view and data binder.
For the fast server-side rendering of a DOM programming interface, it takes the help of **_Fastboot.js_**, so the resulting applications have extremely enhanced performance of complex UIs.
Its modern routing and model engine supports **_RESTful APIs_**, so you are ensured that you are using the latest technology. It supports Handlebars integrated templates that update the data changes automatically.
In 2015, it was named the best JavaScript Framework, competing against AngularJS and React, which should be enough to convince you about its usability and desirability in the JavaScript community.
I would personally highly recommended this JavaScript Framework to those who don't necessarily need great flexibility or a large infrastructure, and just prefer to get things done for coping with deadlines.
**4) Adonis**
**
![Adonis](https://discoversdkcdn.azureedge.net/postscontent/products/adonis.jpg)
**
If you have ever used _Laravel _and _NodeJS_, then you will feel extremely comfortable using this Framework, as it combines the power of these both platforms resulting in an entity that looks incredibly professional, polished and yet sophisticated for any kind of modern application.
It uses _NodeJS_, and thus it's pretty much a back-end framework with several front-end features (unlike the previous JavaScript Frameworks that I mentioned that were mostly front-end frameworks), so newbie developers who are into back-end development will find this framework quite attractive.
Many developers prefer _SQL _databases (due to their increased interaction with data and several other features) over _NoSQL_, so this is reflected in this framework, which makes it relatively more compliant with the standard and more accessible to the average developer.
If you are the part of any PHP community, then you must know about the **Service Providers**, thankfully, Adonis also has the same PHP like flavour in it, so you will feel at home using it.
Of all its best features, it has an extremely powerful routing engine which supports all the functions for organizing and managing application states, an error handling mechanism, SQL ORM for writing database queries, generators, arrow functions, proxies and so on.
I would recommend this Framework if you love to use stateless REST APIs for building server-side applications, as you will be quite attracted to it.
**5) Vue.js**
**
![Vue.js](https://discoversdkcdn.azureedge.net/postscontent/products/vuejs-logo.png)
**
This open-source JavaScript framework was released in 2014, supporting an extremely simple API for developing the _Reactive _components for Modern Web Interfaces. Its design emphasized the ease of use. Like Ember, it uses the **Modelviewviewmodel (MVVM)** design paradigm which helpes in the simplification of the design.
The attractive feature in this framework is that you can use selective modules with it for your specific needs. For example, you need to write  simple HTML code, grab the JSON and create a Vue instance to create the small effects that can reused!
Similar to previous JavaScript Frameworks, it uses two-way data binding to update the model and view, plus it also uses binder for communication between the view and data binder. This is not a full-blown Framework as it focuses entirely on the View Layer, so you would need to take care of other components on your own.
If you are familiar with **_AngularJS_**, then you will feel at home here, as it heavily incorporates the architecture of **_AngularJS_**, so many projects can be easily transferred to this Framework if you know the basics of JavaScript.
I would highly recommend this JavaScript Framework if you just want to get things done or gain JavaScript programming experience, or if you need to learn the nature of different JavaScript Frameworks.
**6) Backbone.js**
**
![Backbone.JS](https://discoversdkcdn.azureedge.net/postscontent/products/backbonejs.png)
**
This framework can be easily integrated to any third-party template engine, however, by default it supports _Underscore _templates, which is the only dependency (along with **JQuery**), thus it is known for its extremely lightweight nature. It has the **RESTful JSON** interface with the support of **MVC (Modelviewcontroller)** design paradigm (that updates the front-end and back-end automatically).
If you ever used the famous social news networking service **reddit**, then you will be interested to hear that it uses the **Backbone.js** for several of its single-page applications. The original author of the **Backbone.js** created the _Underscore _templates as well as _CoffeScript_, so you are assured that the developer knows his stuff.
This framework provides models with key-value, views and several modules within a single bundle, so you don't need to download the other external packages, saving you time. The source-code is available on Github, which means you can further modify it for your needs.
If you are just looking for a startup framework to quickly build single-page applications, then this framework is for you.
**Conclusion**
So, I have just highlighted the 6 Best JavaScript Frameworks in this article in the hopes that it will help you determine the best JavaScript Framework for your tasks.
If youre still having trouble deciding the best JavaScript Framework out there, then please understand that the world values action and not perfectionism; it's better to pick any from the list and then find out if it suits your interests, and if it doesn't then just try the next one. Rest assured though that any Framework from the list will be good enough.
--------------------------------------------------------------------------------
via: http://www.discoversdk.com/blog/6-best-javascript-frameworks-to-learn-in-2016
作者:[By Danyal Zia ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.discoversdk.com/blog/6-best-javascript-frameworks-to-learn-in-2016

View File

@ -1,3 +1,5 @@
fuowang 翻译中
The Cost of Native Mobile App Development is Too Damn High!
============================================================

View File

@ -1,3 +1,5 @@
Translating by StdioA
Top open source creative tools in 2016
============================================================

View File

@ -1,147 +0,0 @@
**translating by [erlinux](https://github.com/erlinux)**
Minecraft Server on Linux
=============================
![Title.jpg](https://www.linuxforum.com/attachments/title-jpg.89/)
Minecraft is a major game being played on many different consoles and computer systems. As of June 2016 there have been over 106 million units sold on all platforms. Because of the popularity, you may want to host a Minecraft party at home. To do this you install a Minecraft Server to allow all users to connect locally and play in the same world together.
**System Requirements**
To start, you need a Linux system with a fair amount of Random Access Memory (RAM). The more players you will host on the server the more RAM you will need. Hard Drive space is not a large requirement, just enough to install Java and the Minecraft Server Java file. The Minecraft Server should have a decent network connection whether wired or WiFi.
Let's look at some minimum requirements for the Minecraft Server:
**Processor: **Duo Core or better
**RAM:** 2 GB (20-40 players), 3 GB (30-60 players), 8 GB (60+ players)
**OS:** An OS with no Graphical User Interface (GUI) to allow more resources free
**NOTE:** The requirements are for the Minecraft Server program and not for the whole OS! If more resources can be allocated to the Minecraft Server it will operate better.
**Installing JAVA**
Once you have a system with Linux running on it you will need to install the latest version of Java.
To verify your Java version enter the following command in a terminal: “java -version”. The result should be:
```
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) Client VM (build 25.101-b13, mixed mode)
```
If your current Java version is not 1.8 or higher then install Java version 8 by performing the following from a terminal on a Ubuntu system:
1. _sudo add-apt-repository ppa:webupd8team/java_
2. _sudo apt-get update_
3. _sudo apt-get install oracle-java8-installer_
**NOTE:** If the 'add-apt-repository' command is not found, run 'sudo apt-get install software-properties-common'. You could also change the third command to be 'oracle-java9-installer' for the newest version of JAVA.
For a Redhat system, such as CentOS, use the following command:
1. _sudo yum install java-1.8.0-openjdk_
After the installation verify the version by entering the version command, 'java -version', and verify the output. Once you have the appropriate version of Java you may proceed with the rest of the installation.
**Minecraft Server Version Download**
The next thing is to check the version of Minecraft which the users will be running. See Figure 1 taken from a system running Minecraft and notice the version number in the bottom left corner.
![Figure 01.jpg](https://www.linuxforum.com/attachments/figure-01-jpg.85/)
**FIGURE 1**
Keep in mind the version number of the Minecraft client software. Each client should be the same version to make this work.
The next thing to do is download the Minecraft Server for the version you will need for the clients. To download the version you need you will need to know its location. The command to get the needed file is:
_sudo wget _[_https://s3.amazonaws.com/Minecraft.Download/versions/[version]/minecraft_server.[version].jar_][1]
As seen in Figure 1, the version number is 1.10.2\. The command would then be:
_sudo wget _[_https://s3.amazonaws.com/Minecraft.Download/versions/1.10.2/minecraft_server.1.10.2.jar_][2]
When you download the file it will be saved to the current directory in which you are currently in when you run the command. To determine the current location use the command 'pwd'.
Once you have the file and know the folder where it has been saved you are ready to continue.
**Server Information**
Before starting the Minecraft Server you must know the amount of available RAM on the current system to be able to use what is needed. When starting the Minecraft Server you will specify the starting amount of RAM and the maximum amount of RAM to use as more players join. Again, it is important to have enough RAM. If needed, use a minimal install of an Operating System (OS) such as a Minimal install of Ubuntu to have more RAM available.
Once you have the Minecraft Server file you need it is time to determine the amount of RAM which can be allocated to Minecraft. To determine the available RAM open a terminal and type the following command a sample output is shown in Figure 2:
_free -h_
![Figure 02.jpg](https://www.linuxforum.com/attachments/figure-02-jpg.86/)
**FIGURE 2**
On this low end system as shown in Figure 2, you can see there is only 684 MB of free RAM. This is not an adequate system to use for a Minecraft Server. On another system I have 2.8 GB available to use for the Minecraft Server.
Before we start the server we need to find the IP Address of the server. To do this, run the command 'ifconfig'. As shown in Figure 3, there should be a listing for a network connection that shows an Internet Address, or 'inet addr', which is '192.168.0.2'. On my server system it is listed with the address of '192.168.0.14', which is the address that will be used from the client systems.
![Figure 03.jpg](https://www.linuxforum.com/attachments/figure-03-jpg.87/)
**FIGURE 3**
**Start Minecraft Server**
The next step is to actually start the Minecraft Server. There are a few items to cover before we actually start it. When starting the Minecraft Server you specify how much memory to initialize for Minecraft. You also will designate the maximum amount to use as well.
If my system has 3.7 GB free and I know I will have less than 40 players, then I only need 2 GB set aside. Of course, I may add a little to allow for any growth of users. I also want to leave some memory for the system to use if needed. I will set my minimum at 2 GB and my maximum at 3 GB. Since my maximum is 3 GB I will leave the system 700 MB of RAM if needed, but this is only if the Minecraft Server uses more than the initial 2 GB.
The command line to start the server is:
_sudo java -Xms# -Xmx# -jar [path]/minecraft_server.[version].jar nogui_
Now for a breakdown of the command structure:
-Xms# - the amount of the initial startup RAM (-Xms2048m)
-Xmx# - the amount of the maximum RAM (-Xmx3096m)
[path] the path to the Minecraft Server File (/home/tux/MCS/)
[version] the version of the Minecraft Server downloaded (1.10.2)
nogui used to show that the system is text based only to help reduce RAM use. If you install the GUI, then remove the _nogui_ parameter
An example of the full command for a system using an initial 2 GB of RAM with a maximum of 3 GB with a path to '/home/tux/MCS/' and a version of '1.10.2' would be:
_sudo java -Xms2048m -Xmx3096m -jar /home/tux/MCS/minecraft_server.1.10.2.jar nogui_
**NOTE:** The RAM sizes are in values of megabytes. Multiply the value by 1024\. For example, for 2 GB of RAM multiply 2x1024 for a value of 2048\. Do not forget the lowercase 'm' to specify megabytes. You can easily specify '2g' and '3g' for 2 GB and 3 GB.
After you run the server the first time there will be an error. It states that the EULA must be agreed to before starting the server.
To agree to the EULA you need to edit the 'eula.txt' file in the same folder as the Minecraft Server JAR file.
Open the 'eula.txt' file in a text editor such as nano. Make sure you do this with root privileges. Change the line 'eula=false' to 'eula=true' and save the file.
Now, enter the command again to start the server. A screen full of information should pass by and then a section of lines which states it is preparing the spawn area. The lines will count up to 100% as it creates the initial world. Any error messages about the system time changing are normal so ignore them.
At this point you can open the client program and see a screen similar to Figure 1 above. Click on the button 'Multiplayer'. At the next screen, Figure 4, choose 'Direct Connect'. You will then be prompted for the server address, so type in the IP Address of the Minecraft Server. You should now be able to connect to the game.
![Figure 04.jpg](https://www.linuxforum.com/attachments/figure-04-jpg.88/)
**FIGURE 4**
**Troubleshooting certain connections**
If some clients cannot connect to the server, then you need to exit the JAVA program by pressing CTRL+Z. Open the file 'server.properties' with an editor such as 'nano'. Remember to be root. Edit the line 'online-mode'. It should be set to 'true'. Change this to 'false' and save the file. Reboot the system and start the Minecraft Server. Have the clients reconnect to the server and everything should be working.
Happy mining!
--------------------------------------------------------------------------------
via: https://www.linuxforum.com/threads/minecraft-server-on-linux.3202/
作者:[Jarret][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linuxforum.com/members/jarret.268/
[1]:https://s3.amazonaws.com/Minecraft.Download/versions/%5Bversion%5D/minecraft_server.%5Bversion%5D.jar
[2]:https://s3.amazonaws.com/Minecraft.Download/versions/%5Bversion%5D/minecraft_server.%5Bversion%5D.jar

View File

@ -1,251 +0,0 @@
GHLandy Translating
10 Useful Sudoers Configurations for Setting sudo in Linux
============================================================
In Linux and other Unix-like operating systems, only the root user can run all commands and perform certain critical operations on the system such as install and update, remove packages, [create users and groups][1], modify important system configuration files and so on.
However, a system administrator who assumes the role of the root user can permit other normal system users with the help of [sudo command][2] and a few configurations to run some commands as well as carry out a number of vital system operations including the ones mentioned above.
Alternatively, the system administrator can share the root user password (which is not a recommended method) so that normal system users have access to the root user account via su command.
sudo allows a permitted user to execute a command as root (or another user), as specified by the security policy:
1. It reads and parses /etc/sudoers, looks up the invoking user and its permissions,
2. then prompts the invoking user for a password (normally the users password, but it can as well be the target users password. Or it can be skipped with NOPASSWD tag),
3. after that, sudo creates a child process in which it calls setuid() to switch to the target user
4. next, it executes a shell or the command given as arguments in the child process above.
Below are ten /etc/sudoers file configurations to modify the behavior of sudo command using Defaults entries.
```
$ sudo cat /etc/sudoers
```
/etc/sudoers File
```
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults logfile="/var/log/sudo.log"
Defaults lecture="always"
Defaults badpass_message="Password is wrong, please try again"
Defaults passwd_tries=5
Defaults insults
Defaults log_input,log_output
```
#### Types of Defaults Entries
```
Defaults parameter, parameter_list #affect all users on any host
Defaults@Host_List parameter, parameter_list #affects all users on a specific host
Defaults:User_List parameter, parameter_list #affects a specific user
Defaults!Cmnd_List parameter, parameter_list #affects a specific command
Defaults>Runas_List parameter, parameter_list #affects commands being run as a specific user
```
For the scope of this guide, we will zero down to the first type of Defaults in the forms below. Parameters may be flags, integer values, strings, or lists.
You should note that flags are implicitly boolean and can be turned off using the `'!'` operator, and lists have two additional assignment operators, `+=` (add to list) and `-=` (remove from list).
```
Defaults parameter
OR
Defaults parameter=value
OR
Defaults parameter -=value
Defaults parameter +=value
OR
Defaults !parameter
```
### 1\. Set a Secure PATH
This is the path used for every command run with sudo, it has two importances:
1. Used when a system administrator does not trust sudo users to have a secure PATH environment variable
2. To separate “root path” and “user path”, only users defined by exempt_group are not affected by this setting.
To set it, add the line:
```
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
```
### 2\. Enable sudo on TTY User Login Session
To enable sudo to be invoked from a real tty but not through methods such as cron or cgi-bin scripts, add the line:
```
Defaults requiretty
```
### 3\. Run Sudo Command Using a pty
A few times, attackers can run a malicious program (such as a virus or malware) using sudo, which would again fork a background process that remains on the users terminal device even when the main program has finished executing.
To avoid such a scenario, you can configure sudo to run other commands only from a psuedo-pty using the `use_pty` parameter, whether I/O logging is turned on or not as follows:
```
Defaults use_pty
```
### 4\. Create a Sudo Log File
By default, sudo logs through syslog(3). However, to specify a custom log file, use the logfile parameter like so:
```
Defaults logfile="/var/log/sudo.log"
```
To log hostname and the four-digit year in the custom log file, use log_host and log_year parameters respectively as follows:
```
Defaults log_host, log_year, logfile="/var/log/sudo.log"
```
Below is an example of a custom sudo log file:
[
![Create Custom Sudo Log File](http://www.tecmint.com/wp-content/uploads/2017/01/Create-Sudo-Log-File.png)
][3]
Create Custom Sudo Log File
### 5\. Log Sudo Command Input/Output
The log_input and log_output parameters enable sudo to run a command in pseudo-tty and log all user input and all output sent to the screen receptively.
The default I/O log directory is /var/log/sudo-io, and if there is a session sequence number, it is stored in this directory. You can specify a custom directory through the iolog_dir parameter.
```
Defaults log_input, log_output
```
There are some escape sequences are supported such as `%{seq}` which expands to a monotonically increasing base-36 sequence number, such as 000001, where every two digits are used to form a new directory, e.g. 00/00/01 as in the example below:
```
$ cd /var/log/sudo-io/
$ ls
$ cd 00/00/01
$ ls
$ cat log
```
[
![Log sudo Input Output](http://www.tecmint.com/wp-content/uploads/2017/01/Log-sudo-Input-Output.png)
][4]
Log sudo Input Output
You can view the rest of the files in that directory using the [cat command][5].
### 6\. Lecture Sudo Users
To lecture sudo users about password usage on the system, use the lecture parameter as below.
It has 3 possible values:
1. always always lecture a user.
2. once only lecture a user the first time they execute sudo command (this is used when no value is specified)
3. never never lecture the user.
```
Defaults lecture="always"
```
Additionally, you can set a custom lecture file with the lecture_file parameter, type the appropriate message in the file:
```
Defaults lecture_file="/path/to/file"
```
[
![Lecture Sudo Users](http://www.tecmint.com/wp-content/uploads/2017/01/Lecture-Sudo-Users.png)
][6]
Lecture Sudo Users
### 7\. Show Custom Message When You Enter Wrong sudo Password
When a user enters a wrong password, a certain message is displayed on the command line. The default message is “sorry, try again”, you can modify the message using the badpass_message parameter as follows:
```
Defaults badpass_message="Password is wrong, please try again"
```
### 8\. Increase sudo Password Tries Limit
The parameter passwd_tries is used to specify the number of times a user can try to enter a password.
The default value is 3:
```
Defaults passwd_tries=5
```
[
![Increase Sudo Password Attempts](http://www.tecmint.com/wp-content/uploads/2017/01/Increase-Sudo-Password-Attempts.png)
][7]
Increase Sudo Password Attempts
To set a password timeout (default is 5 minutes) using passwd_timeout parameter, add the line below:
```
Defaults passwd_timeout=2
```
### 9\. Let Sudo Insult You When You Enter Wrong Password
In case a user types a wrong password, sudo will display insults on the terminal with the insults parameter. This will automatically turn off the badpass_message parameter.
```
Defaults insults
```
[
![Let's Sudo Insult You When Enter Wrong Password](http://www.tecmint.com/wp-content/uploads/2017/01/Sudo-Insult-Message.png)
][8]
Lets Sudo Insult You When Enter Wrong Password
### 10\. Learn More Sudo Configurations
Additionally, you can learn more sudo command configurations by reading: [Difference Between su and sudo and How to Configure sudo in Linux][9].
Thats it! You can share other useful sudo command configurations or [tricks and tips with Linux][10] users out there via the comment section below.
--------------------------------------------------------------------------------
作者简介Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
--------------------------------------------------------------------------------
via: http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/add-users-in-linux/
[2]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Create-Sudo-Log-File.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Log-sudo-Input-Output.png
[5]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Lecture-Sudo-Users.png
[7]:http://www.tecmint.com/wp-content/uploads/2017/01/Increase-Sudo-Password-Attempts.png
[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Sudo-Insult-Message.png
[9]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[10]:http://www.tecmint.com/tag/linux-tricks/

View File

@ -1,79 +0,0 @@
Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi
============================================================
Do you find it irritating having to set up an ad blocker on your computer web browsers, smart phones, and tablets? I sure do.  And then there are some smart devices at home that dont appear to have ad blocking software of any kind.  Well, I learned about [Pi-hole][2] which is ad blocking software for your pi board and it blocks all the advertisements on your home network before they get to your various devices.  It gives you the ability to black list or white list any domain, plus it has a great dashboard that gives you insights into your home networks most accessed domains/web sites, most active devices, and most frequent advertisers.
Pi-hole was really targeted to run on the Raspberry Pi but I wanted to know if it would work on my inexpensive Orange Pi running Armbian Linux. Well, it absolutely does! Below is my process for getting Pi-hole up and running quickly.
### Installing Pi-hole
Installing Pi-hole is done using the terminal, so open a terminal on your Orange Pis desktop or ssh into the pi board.
You will be downloading the software, so navigate to a directory of your choosing, making sure that you have write privileges. Like this:
```
cd <your preferred directory>/
```
I deviated from the “one command” installation on the Pi-hole home page. I mean, they do say right underneath that command that “piping to bash can be dangerous” and that a local install is “safer.” So, heres my local installation steps:
```
git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
cd Pi-hole/automated\ install/
./basic-install.sh
```
If you are not logged in as the root user, then the basic-install script will prompt you to enter your password before continuing. If needed, the script will download and install some prerequisite Linux packages. Then itll provide you with a simple blue/red graphical interface, prompting you to answer a few questions about how you want Pi-hole configured. In my experience, simply accepting the defaults was fine and I later discovered that the Pi-hole web application enables you to change settings like DNS provider.
The script will tell you what the password is for Pi-hole both in the graphical interface and in the terminal. Do take note of that password!
The script will also tell you the web address for Pi-hole, which should be like this:
```
http://<your pis IP address>/admin
```
or even something like:
```
http://orangepipc/admin
```
You will need enter your Pi-hole password, and then you should get a nice dashboard that looks something like this:
![Ph-hole](https://i1.wp.com/piboards.com/wp-content/uploads/2017/01/ph-hole.png?resize=640%2C532)
Remember to change the DNS setting on your home network router so it that uses the address of your pi board. Otherwise, the ads wont be filtered!
The instructions above are more or less the same as the alternative “safe” method as provided by the Pi-hole web site despite the fact that Armbian is not listed as an officially supported operating system. I believe that these instructions should work on a Raspberry Pi or other pi board running some form of Debian based Linux operating system. However, I havent tested that and I would be interested to hear your experience (just drop me a brief comment, please).
### Thoughts and Observations
After running Pi-hole for a while an studying the information in the Pi-hole dashboard, I found that there was a lot more network activity going on than I was aware of, not all of which did I approve of. For example, there were some interesting connections going out from my kids devices related to game apps that I wonder about, plus social networking apps were apparently sending some data continuously which bothered me. Altogether, whether it was benign traffic or not, I was glad to reduce the traffic load even if by a little…I mean, why should I be content to allow apps and ads to eat up my network traffic for things I dont want or care about? Well, now they are blocked. Period.
Setting up an Orange Pi for ad blocking like this is cheap, easy, and helps to put my mind at ease about limiting some unwanted traffic to/from my home network (especially where the kids are involved). If you are interested, you can see my previous post about how to [easily setting up an Orange Pi][3] and check out how cheap the Orange Pis are at the links below.  I believe that it is a worthwhile investment.
Orange Pi on Amazon (affiliate link):  [Orange Pi PC Single Board Computer Quad Core ARM Cortex-A7 1GB DDR3 4K Decode][4]
[Orange Pi store on AliExpress][5] (affiliate link).
EDIT:  The irony of this post is that if you successfully set up Pi-hole, then affiliate links on this site (s.click.aliexpress.com) gets blocked.  White list that if you like, you are in control.
--------------------------------------------------------------------------------
via: http://piboards.com/2017/01/07/block-ads-on-all-your-devices-at-home-with-pi-hole-and-an-orange-pi/
作者:[MIKE WILMOTH][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://piboards.com/author/piguy/
[1]:http://s.click.aliexpress.com/deep_link.htm?aff_short_key=N3VJQBY&dl_target_url=http://best.aliexpress.com
[2]:https://pi-hole.net/
[3]:http://piboards.com/2017/01/04/easy-set-up-orange-pi/
[4]:https://www.amazon.com/gp/product/B018W6OTIM/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B018W6OTIM&linkCode=as2&tag=piboards-20&linkId=ac292a536d58eabf1ee73e2c575e1111
[5]:http://s.click.aliexpress.com/e/bAMVj2R

View File

@ -1,122 +0,0 @@
Min Browser Muffles the Web's Noise
============================================================
![Min Browser Muffles the Web's Noise](http://www.linuxinsider.com/ai/637666/browser-tabs.jpg)
[Min][1] is a Web browser with a minimal design that provides speedy operation with simple features.
When it comes to software design, "minimal" does not mean low functionality or undeveloped potential. If you like minimal distraction tools for your text editor and note-taking applications, that same comfort appeal is evident in the Min browser.
I mostly use Google Chrome, Chromium and Firefox on my desktops and laptop computers. I am well invested in their add-on functionality, so I can access all the specialty services that get me through my long sessions in researching and working online.
However, I sometimes prefer a fast, uncluttered alternative on-ramp to the Internet. With multiple projects in progress, I can amass a wide collection of open tabs or even separate windows of the powerhouse browsers in no time.
I have tried other browser options with little success. The alternatives usually have their own sets of distracting add-ons and features that tend to pull me into more off-task behavior.
The Min browser does not do that. It is a GitHub-sourced Web browser that is easy to use, and it keeps the typical interruptions from distracting me.
![Min browser ](http://www.linuxinsider.com/article_images/2017/84212_620x514.jpg)
The Min browser is minimal-design Web browser that provides speedy operation with simple features. Just don't expect to take its tour any time soon.
### What It Does
The Min browser comes in versions for Debian Linux variants, Windows and Mac machines. It can not compete with the functionality available in the mainstream cross-platform Web browsers.
It does not have to compete, though. Its claim to fame very well might be supplementing rather than replacing them.
One big reason for this is its built-in ad blocking capability. Out of the box, the Min browser needs no configuration or hunting for compatible third-party apps to do end-runs around ads.
In Edit/Preferences, you have three options to click/unclick for content blocking. It's easy to modify blocking tactics to suit your preferences. The Block Trackers and Ads option uses EasyList and EasyPrivacy. If nothing else, keep this option checked.
You also can block scripts and block images. Doing both maximizes the website loading speeds and really ramps up your protection against rogue code attacks.
### Have Search Your Way
If you spend considerable time doing online research, you will adore the way Min handles searching. It is a top-notch feature.
Search functionality is accessible right in the browser's URL bar. Min utilizes search engine DuckDuckGo and Wikipedia entries. You can enter search queries directly into the Web address field.
This approach saves time since you do not have to go to the search engine window first. A nice bonus is the ability to search your bookmarks.
In the Edit/Preferences menu, choose your choice for default search engine. The list includes DuckDuckGo, Google, Bing, Yahoo, Baidu, Wikipedia and Yandex.
Try making DuckDuckGo your default search engine. Min is built around that option but does not impose it on you.
![Min browser search function ](http://www.linuxinsider.com/article_images/2017/84212_620x466.jpg)
Min browser's search functionality is part of the URL bar. Min utilizes search engine DuckDuckGo and Wikipedia entries. You can enter search queries directly into the Web address window.
The search bar displays answers to your questions very rapidly. It uses information from DuckDuckGo including Wikipedia entries, a calculator and more.
It offers quick snippets, answers and Web suggestions. It sort of substitutes for not being in a Google-based environment.
### Navigating Aids
Min lets you jump to any site quickly with fuzzy search. It throws suggestions at you almost immediately.
I like the way the tabs open next to the current tab. You do not have to set this preference. It is there by default with no other choice, but it makes sense.
[
![Min browser Tasks](http://www.linuxinsider.com/article_images/2017/84212_620x388-small.jpg)
][2]One of Min's really cool operations is the ability to organize tabs into Tasks that you can search anytime. (click image to enlarge)
Tabs you have not clicked on for a while dim. This lets you concentrate on your current task without distractions.
Min does not need an add-on tool to keep numerous tabs under control. The browser displays a list of tags and lets you split them into groups.
### Stay Focused
Min has an optional Focus Mode hidden in the View menu. When enabled, it hides all tabs except the one you have opened. You must return to the menu to turn off Focus Mode before you can open new tabs.
The Tasks feature also helps you stay focused. You can create tasks from the File menu or with Control+Shift+N. If you want to open a new tab, you can select that option in the Files menu or use Control+T.
Call the new task whatever fits your style. I like being able to organize and display as a group all the tabs associated with a work project or a specific portion of my research. I can recall the entire list at any time to easily and quickly find where I was in my browsing adventure.
Another neat feature is found under the paragraph alignment icon in the tab area. Click it to enable Reading Mode. This mode saves the article for future reference and strips away everything on the page so you can focus on the task of reading.
### Not Perfect
The Min browser is not a perfect alternative to high-powered, feature-bloated alternatives. It does have a few glaring weaknesses that developers have taken too long to rectify.
For instance, It lacks a solid developer website stocked with support forums and detailed user guides. That may be partly due to its home being GitHub rather than an independent developer website. Still, it's a weakness that is glaring to new users.
Without website support, users are forced to struggle with lists of readme files and hard-to-follow directories on GitHub. You can access them from the Min browser Help menu -- but that's not much help.
A case in point is the Welcome to Min splash screen that loads from the menu when you launch the browser. It displays two buttons. One says "Start Browsing." The other says "Take a Tour." Neither one works.
However, you can start browsing by clicking on the menu bar at the top of the Min window. There is no workaround for the missing tour, though.
### Bottom Line
Min is not a full-featured Web browser with bells and whistles galore. It is not designed for add-ons and many other features you typically use in well-established Web browsers. However, Min serves an important niche purpose by offering speed and distraction-free browsing.
The more I use the Min browser, the more productive it is for me -- but be wary when you first start to use it.
Min is not complicated or confusing -- it is just quirky. You have to play around with it to discover how it works.
### Want to Suggest a Review?
Is there a Linux software application or distro you'd like to suggest for review? Something you love or would like to get to know?
Please [email your ideas to me][3], and I'll consider them for a future Linux Picks and Pans column.
And use the Reader Comments feature below to provide your input!
--------------------------------------------------------------------------------
作者简介:
Jack M. Germain has been writing about computer technology since the early days of the Apple II and the PC. He still has his original IBM PC-Jr and a few other legacy DOS and Windows boxes. He left shareware programs behind for the open source world of the Linux desktop. He runs several versions of Windows and Linux OSes and often cannot decide whether to grab his tablet, netbook or Android smartphone instead of using his desktop or laptop gear. You can connect with him on Google+.
--------------------------------------------------------------------------------
via: http://www.linuxinsider.com/story/84212.html?rss=1
作者:[Jack M. Germain][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.linuxinsider.com/story/84212.html?rss=1#searchbyline
[1]:https://github.com/minbrowser/min/releases/
[2]:http://www.linuxinsider.com/article_images/2017/84212_1200x750.jpg
[3]:mailto:jack.germain@newsroom.ectnews.com

View File

@ -1,3 +1,6 @@
vim-kakali translating
How to record a region of your desktop as animated GIF on Linux
============================================================

View File

@ -1,74 +0,0 @@
Martin translating…
Explore climate data with open source tools
============================================================[up][1]
![Explore climate data with open source tools](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-cloud.png?itok=bdROR1aE "Explore climate data with open source tools")
Image credits : 
[Flickr user: theaucitron][2] (CC BY-SA 2.0)
You can't look anywhere these days without seeing evidence of the changing weather patterns on the earth. Monthly, we are confronted with facts and figures that point to a warming planet.
Climate scientists warn us that inaction could be fatal to our futures here. Military strategists at the Pentagon have [recently cautioned][3] President-Elect Trump that inaction on climate change could spell disaster for our national security as shrinking water supplies and meager rainfall cause crop failures will force large numbers of people to migrate to other parts of the world that can sustain them.
With all of the research on our climate by NASA, the US Defense Department, and others, I was curious if there are open source tools that would allow interested citizens to explore climate data and draw our own conclusions. A quick search of the Internet led me to the [Open Climate Workbench][4], a project that is part of the [Apache Software Foundation][5].
The Open Climate Workbench (OCW) develops software that performs climate model evaluation on data that comes from the [Earth System Grid Federation][6], [Coordinated Regional Climate Downscaling Environment][7], the U.S. Global Change Research Program's [National Climate Assessment][8], the[ North American Regional Climate Assessment Program][9], and from NASA, NOAA, and others.
You can download the OCW's [tar ball][10] and install it on your Linux computer by following the [prerequisites][11]. You can also install the OCW in a virtual machine using Vagrant and a provider like VirtualBox. [Get the instructions][12] for an OCW virtual machine.  
I found the easiest way to see how the OCW works is to download a [virtual machine image][13] from the Regional Climate Model Evaluation System (RCMES).
According to its website, the RCMES "is designed to facilitate regional-scale evaluations of climate and Earth system models by providing standardized access to a vast and comprehensive set of observations (e.g., satellite, reanalyzes and in-situ) and modeling resources (e.g., [CMIP][14] & [CORDEX][15] on the [ESGF][16]), as well as tools for performing common analysis and visualization tasks (e.g., OCW)."
You will need to have VirtualBox and Vagrant installed on your host computer. With it you can see an excellent example of the OCW in operation. The RCMES provides [detailed instructions][17] for downloading, importing, and running the virtual machine. Once your virtual machine is up and running you can log into it with the following credentials.
**Username:vagrant, password:vagrant. **
![Regional Climate Model Evaluation System Data Plot](https://opensource.com/sites/default/files/rcmes_data_plot.png "Regional Climate Model Evaluation System Data Plot")
RCMES data plot sample
[Tutorials][18] for the RCMES are available on their website to help you quickly become familiar with the software. The community [is active][19] and they are looking for more [developers][20]. You can [subscribe to their mailing lists][21], too.
[Source code][22] for the project is on GitHub and licensed under the Apache License, Version 2.0.
--------------------------------------------------------------------------------
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/donw2-crop.jpg?itok=OqOYd3A8)
Don Watkins - Educator, education technology specialist, entrepreneur, open source advocate. M.A. in Educational Psychology, MSED in Educational Leadership, Linux system administrator, CCNA, virtualization using Virtual Box and VMware. Follow me at @Don_Watkins .
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/1/apache-open-climate-workbench
作者:[Don Watkins][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/don-watkins
[1]:https://opensource.com/article/17/1/apache-open-climate-workbench?rate=Hv4_T-1gbcRNsiP9jnevzP1OTNKHIyQLXwqdjnBy2Bs
[2]:https://www.flickr.com/photos/theaucitron/5810163712/in/photolist-5p9nh3-6EkSKG-6EgGEF-9hYBcr-abCSpq-9zbjDz-4PVqwm-9RqBfq-abA2T4-4nXfwv-9RQkdN-dmjSdA-84o2ER-abA2Wp-ehyhPC-7oFYrc-4nvqBz-csMQXb-nRegFf-ntS23C-nXRyaB-6Xw3Mq-cRMaCq-b6wkkP-7u8sVQ-yqcg-6fTmk7-bzm3vU-6Xw3vL-6EkzCQ-d3W8PG-5MoveP-oMWsyY-jtMME6-XEMwS-2SeRXT-d2hjzJ-p2ZZVZ-7oFYoX-84r6Mo-cCizvm-gnnsg5-77YfPx-iDjqK-8gszbW-6MUZEZ-dhtwtk-gmpTob-6TBJ8p-mWQaAC/
[3]:https://www.scientificamerican.com/article/military-leaders-urge-trump-to-see-climate-as-a-security-threat/
[4]:https://climate.apache.org/
[5]:https://www.apache.org/
[6]:http://esgf.llnl.gov/
[7]:http://www.cordex.org/
[8]:http://nca2014.globalchange.gov/
[9]:http://www.narccap.ucar.edu/
[10]:http://climate.apache.org/downloads.html
[11]:http://climate.apache.org/downloads.html#prerequsites
[12]:https://cwiki.apache.org/confluence/display/CLIMATE/OCW+VM+-+A+Self+Contained+OCW+Environment
[13]:https://rcmes.jpl.nasa.gov/RCMES_Turtorial_data/RCMES_June09-2016.ova
[14]:http://cmip-pcmdi.llnl.gov/
[15]:http://www.cordex.org/
[16]:http://esgf.org/
[17]:https://rcmes.jpl.nasa.gov/content/running-rcmes-virtual-machine
[18]:https://rcmes.jpl.nasa.gov/content/tutorials-overview
[19]:http://climate.apache.org/community/get-involved.html
[20]:https://cwiki.apache.org/confluence/display/CLIMATE/Developer+Getting+Started+Guide
[21]:http://climate.apache.org/community/mailing-lists.html
[22]:https://github.com/apache/climate

View File

@ -0,0 +1,150 @@
# translating by ruskking
Linux command line navigation tips and tricks - part 1
============================================================
### On this page
1. [Linux command line tips/tricks][3]
1. [Easily switch between two directories - the quick tip][1]
2. [Easily switch between two directories - related details][2]
2. [Conclusion][4]
If you've just started using the command line in Linux, then it's worth knowing that it is one of the most powerful and useful features of the OS. The learning curve may or may not be steep depending on how deep you want to dive into the topic. However, there are some Linux command line tips/tricks that'll always be helpful regardless of your level of expertise.
In this article series, we'll be discussing several such tips/tricks, hoping that they'll make your command line experience even more pleasant.
But before we move ahead, it's worth mentioning that all the instructions as well examples presented in this article have been tested on Ubuntu 14.04LTS. The command line shell we've used is bash (version  4.3.11)
### Linux command line tips/tricks
Please note that we've assumed that you know the basics of the command line in Linux, like what is root and home directory, what are environment variables, how to navigate directories, and more. Also, keep in mind that tips/tricks will be accompanied by the how and why of the concept involved (wherever applicable).
### Easily switch between two directories - the quick tip
Suppose you are doing some work on the command line that requires you to switch between two directories multiple times. And these two directories are located in completely different branches, say, under /home/ and under /usr/, respectively. What would you do? 
One, and the most straightforward, option is to switch by typing the complete paths to these directories. While there's no problem with the approach per se, it's very time consuming. Other option could be to open two separate terminals and carry on with your work. But again, neither this approach is convenient, nor it looks elegant.
You'll be glad to know that there exists an easy solution to this problem. All you have to do is to first switch between the two directories manually (by passing their respective paths to the **cd** command), and then subsequent switches can be accomplished using the **cd -** command.
For example:
I am in the following directory:
```
$ pwd
/home/himanshu/Downloads
```
And then I switched to some other directory in the /usr/ branch:
```
cd /usr/lib/
```
Now, I can easily switch back and forth using the following command:
```
cd -
```
Here's a screenshot showing the **cd -** command in action.
[
![The Linux cd command](https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/cmd-line-tips.png)
][5]
An important point worth mentioning here is that if you make a switch to a third directory in between all this, then the **cd -** command will work for the new directory and the directory from which the switch was made.
### Easily switch between two directories - related details
For the curious bunch, who want to know how the **cd -** command works, here's the explanation: As we all know, the cd command requires a path as its argument. Now, when a hyphen (-) is passed as an argument to the command, it's replaced by the value that OLDPWD environment variable contains at that moment.
[
![The cd command explained](https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/cmd-line-tips-oldpwd.png)
][6]
As it would be clear by now, the OLDPWD environment variable stores the path of previous working directory. This explanation is there is the man page of the cd command, but sadly, it's likely that you'll not find the man page pre-installed on your system (it's not there on Ubuntu at least).
However, installing it is not a big deal, all you have to do is to run the following command:
```
sudo apt-get install manpages-posix
```
And then do:
```
man cd
```
Once the man page opens, you'll see that it clearly says:
```
- When a hyphen is used as the operand, this shall be equivalent
to the command:
cd "$OLDPWD" && pwd
```
Needless to say, it's the cd command that sets the OLDPWD variable. So every time you change the directory, the previous working directory gets stored in this variable. This brings us to another important point here: whenever a new shell instance is launched (both manually or through a script), it does not have a 'previous working directory.'
[
![Hyphen and the cd command](https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/cmd-line-tips-no-oldpwd.png)
][7]
That's logical because it's the cd command which sets this variable. So until you run the cd command at-least once, the OLDPWD environment variable will not contain any value.
Moving on, while it may seem counterintuitive, the **cd -** and **cd $OLDWPD** commands do not produce same results in all situations. Case in point, when a new shell has just been launched.
[
![cd command example](https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/cmd-line-tips-oldpwd-home.png)
][8]
As clear from the screenshot above, while the **cd -** command complained about the OLDPWD variable not being set, the **cd $OLDPWD** command did not produce any error; in fact it changed the present working directory to the user's home directory.
That's because given that the OLDPWD variable is currently not set, $OLDPWD is nothing but an empty string. So, the **cd $OLDPWD** command is as good as just running **cd**, which - by default - takes you to your home directory.
Finally, I've also been through situations where-in it's desirable to suppress the output the **cd -** command produces. What I mean is, there can be cases (for example, while writing a shell script), where-in you'll want the **cd -** command to not produce the usual directory path in output. For those situations, you can use the command in the following way:
```
cd - &>/dev/null
```
The above command will redirect both file descriptor 2 (STDERR) and descriptor 1 (STDOUT) to [/dev/null][9]. This means that any error the command produces will also be suppressed. However, you'll still be able to check the success of failure of the command using the generic [$? technique][10] - the command **echo $?** will produce '1' if there was some error, and '0' otherwise.
Alternatively, if you're ok with the **cd -** command producing an output in error cases, then you can use the following command instead:
```
cd - > /dev/null
```
This command will only redirect the file descriptor 1 (STDOUT) to `/dev/null`.
### Conclusion
Sadly, we could only cover one command line-related tip here, but the good thing is that we managed to discuss a lot of in-depth stuff about the **cd -**command. You are advised to go through the tutorial thoroughly and test everything  - that we've discussed here -  on your Linux box's command line terminal. Also, do go through the command's man page, and try out all the features documented there.
In case you face any issue or have some doubt, do share with us in comments below. Meanwhile, wait for the second part, where-in we'll discuss some more useful command line-related tips/tricks in the same manner as has been done here.
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/
作者:[Ansh][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/
[1]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#easily-switch-between-two-directories-the-quick-tip
[2]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#easily-switch-between-two-directories-related-details
[3]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#linux-command-line-tipstricks
[4]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#conclusion
[5]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips.png
[6]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips-oldpwd.png
[7]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips-no-oldpwd.png
[8]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips-oldpwd-home.png
[9]:https://en.wikipedia.org/wiki/Null_device
[10]:http://askubuntu.com/questions/29370/how-to-check-if-a-command-succeeded

View File

@ -1,101 +0,0 @@
ucasFL translating
3 Useful VIM Editor Tips and Tricks for Advanced Users
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/vim-featured.jpg "3 Useful VIM Editor Tips and Tricks for Advanced Userss")
This article is part of the [VIM User Guide][12] series:
* [The Beginners Guide to Start Using Vim][3]
* [Vim Keyboard Shortcuts Cheatsheet][4]
* [5 Vim Tips and Tricks for Experienced Users][5]
* 3 Useful VIM Editor Tips and Tricks for Advanced Users
Vim is undoubtedly a very powerful text editor. It offers a plethora of features which means that studying and remembering every Vim functionality isnt practically possible. But what we can do at least is keep learning easier ways of doing things so that our experience with the editor keeps on getting better with time.
With that in mind, in this article we will discuss some Vim editor tips/tricks that are aimed at advanced users.
**Note**: If you are completely new to Vim, you can first go through our [getting started guide][14]. For those whove just started using the editor, Im sure our [Vim keyboard shortcuts cheatsheet][15] will be extremely useful to you. And if youre already an experienced user, you might also want to find out [some tips and tricks for experienced users][16].
Please note that all the tips mentioned in this article have been mostly explained using easy-to-understand coding situations, as they come in really handy while software development. But that does not mean normal users (who arent coders and use Vim for general text editing) cant use them in their work.
### 1\. Set file specific variables
There may be times when in a particular file you would want any tab character that you type to get replaced by spaces. Or you may want a source code file to use two spaces for indentation even if the editors default indentation is set to four spaces.
Basically were talking about file-specific changes here. Theres a feature that Vim provides which allows you to change certain settings only for a particular file. That feature is called “Modeline.”
For example, to make sure that each tab you type gets replaced by spaces, all you have to do is to add the following modeline in the first or last few lines of the file in question:
```
# vim: set expandtab:
```
And to change the indentation from default (4) to 2, use the following modeline in the source file:
```
// vim: noai:ts=2:sw=2
```
Here are some important points that you need to keep in mind when dealing with modelines:
* Modelines should only be added in the first or last five lines of the file.
* The “modeline” option must be set (`:set modeline`) in the “.vimrc” file order to take advantage of this feature.
* The feature is off by default when editing as root.
For more information, head to the features [official documentation][17].
### 2\. Keyword completion
As you start writing more and more complex code or start working on large source files, you deal with several variable names. Sometimes its not easy to remember all the names, so whenever you have to write a variable name you usually copy it from where its already used.
Thankfully, with Vim you can just write some initial letters of the variable. Without leaving the Insert mode, press “Ctrl + n” or “Ctrl + p” to get a list of matching keywords. While “Ctrl + n” is used to insert the next matching word, “Ctrl + p” gives you a list of previous matching words.
Heres this feature in action.
![vim-keyword-completion1](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/vim-keyword-completion1.jpg "vim-keyword-completion1")
As is clear from the screenshot above, the list that pops up also contains words from other source files. For more information on this feature, head [here][18].
### 3\. Searching
Suppose you are debugging your code, and as part of that you need to quickly see all the occurrences of a variable in a file. A commonly used way to do this is to come out of the Insert mode, write `/[var-name]`, press Enter, and then go back and forth using the “n” and “p” keys.
Theres no problem with the aforementioned approach, per se, but theres a slightly more easier and quicker way to do this kind of search. For that, first you have to make sure that you are out of Insert mode and that the cursor is under the word/variable youre trying to search, which isnt time consuming at all. And next, all you have to do is press “Shift + *.”
Do this repeatedly, and the editor will quickly take you to all the places where the word/variable is used in the file.
### Conclusion
Although aimed at advanced users, the tips/tricks discussed here arent difficult to understand and use. If your basics are clear, you can really benefit from them. Needless to say, as with any new feature or concept, you need to practice these tips to make them a habit.
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/vim-tips-tricks-advanced-users/
作者:[Himanshu Arora][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/himanshu/
[1]:https://www.maketecheasier.com/author/himanshu/
[2]:https://www.maketecheasier.com/vim-tips-tricks-advanced-users/#respond
[3]:https://www.maketecheasier.com/start-with-vim-linux/
[4]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[5]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[6]:https://www.maketecheasier.com/category/linux-tips/
[7]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-advanced-users%2F
[8]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-advanced-users%2F&text=3+Useful+VIM+Editor+Tips+and+Tricks+for+Advanced+Users
[9]:mailto:?subject=3%20Useful%20VIM%20Editor%20Tips%20and%20Tricks%20for%20Advanced%20Users&body=https%3A%2F%2Fwww.maketecheasier.com%2Fvim-tips-tricks-advanced-users%2F
[10]:https://www.maketecheasier.com/opt-out-google-personalized-ads/
[11]:https://www.maketecheasier.com/wi-fi-vs-ethernet-vs-4g/
[12]:https://www.maketecheasier.com/series/vim-user-guide/
[13]:https://support.google.com/adsense/troubleshooter/1631343
[14]:https://www.maketecheasier.com/start-with-vim-linux/
[15]:https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
[16]:https://www.maketecheasier.com/vim-tips-tricks-for-experienced-users/
[17]:http://vim.wikia.com/wiki/Modeline_magic
[18]:http://vim.wikia.com/wiki/Any_word_completion

View File

@ -1,3 +1,5 @@
GHLandy Translating  
How to Install Nextcloud with Nginx and PHP7-FPM on CentOS 7
============================================================

View File

@ -1,98 +0,0 @@
translating---geekpi
Let Sudo Insult You When You Enter Incorrect Password
============================================================
Sudoers is the default sudo security policy plugin in Linux, however, experienced system administrators can specify a custom security policy as well as input and output logging plugins. It is driven by the `/etc/sudoers`file or alternatively in LDAP.
You can define sudoers insults option or several others in the file above. It is set under defaults entries section. Read through our last article that explains [10 Useful Sudoers Configurations for Setting sudo in Linux][1].
In this article, we will explain a sudoers configuration parameter to enable an individual or system administrator set [sudo command][2] to insult system users who enter wrong password.
Start by opening the file `/etc/sudoers` like so:
```
$ sudo visudo
```
Go to the defaults section and add the following line:
```
Defaults insults
```
Below is a sample of /etc/sudoers file on my system showing defaults entries.
[
![Set sudo Insults Parameter](http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-Insults-Parameter.png)
][3]
Set sudo Insults Parameter
From the screenshot above, you can see that there are many other defaults defined such as send mail to root when each time a user enters a bad password, set a secure path, configure a custom sudo log file and more.
Save the file and close it.
Run a command with sudo and enter the wrong password, then observe how insults option works:
```
$ sudo visudo
```
[
![sudo Insult in Action](http://www.tecmint.com/wp-content/uploads/2017/01/How-sudo-Insult-Works.png)
][4]
sudo Insult in Action
Note: When you configure the insults parameter, it disables the `badpass_message` parameter which prints a specific message on the command line (the default message is “sorry, try again”) in case a user enters a wrong password.
To modify the message, add the `badpass_message` parameter to the /etc/sudoers file as shown below.
```
Defaults badpass_message="Password is wrong, please try again" #try to set a message of your own
```
[
![Set sudo badpassword Message](http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-badpassword-Message.png)
][5]
Set sudo badpassword Message
Save the file and close it, then invoke sudo and see how it works, the message you set as the value of badpass_message will be printed every time you or any system user types a wrong password.
```
$ sudo visudo
```
[
![Sudo badpassword Message](http://www.tecmint.com/wp-content/uploads/2017/01/sudo-badpassword-Message.png)
][6]
Sudo badpassword Message
Thats all, in this article we reviewed how to set sudo to print insults when users type a wrong password. Do share your thoughts via the comment section below.
--------------------------------------------------------------------------------
作者简介:
![](http://1.gravatar.com/avatar/4e444ab611c7b8c7bcb76e58d2e82ae0?s=128&d=blank&r=g)
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/sudo-insult-when-enter-wrong-password/
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/
[2]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/
[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-Insults-Parameter.png
[4]:http://www.tecmint.com/wp-content/uploads/2017/01/How-sudo-Insult-Works.png
[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Set-sudo-badpassword-Message.png
[6]:http://www.tecmint.com/wp-content/uploads/2017/01/sudo-badpassword-Message.png

View File

@ -1,115 +0,0 @@
ucasFL translating
Best Linux Distributions for New Users
============================================================
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/distros-new-users.jpg?itok=Prp88H71)
Jack Wallen considers which Linux distributions are best designed for new users coming from different environments.[Creative Commons Zero][5]Pixabay
Ah, the age-old question...one that holds far more importance than simply pointing out which Linux distribution is a fan-favorite. Why is that?
Let me set the stage: You have a user—one who has, most likely, spent the majority of their time in front of either a Windows or Mac machine—and theyve come to you for an alternative. You want to point them in a direction that will bring about the least amount of hiccups along the way and highlight the power and flexibility of Linux.
But, remember, the single most important aspect is that they must _get it_, out of the box.
Thats why we often take the time to point out which distributions are best designed for new users -- because bringing new users into the mix is the best way to spread the word and grow the base. 
With that said, what are the best distributions for new users? Im going to take a bit of a different approach this time and point out which distributions would be best for users coming from different environments. You can also check out my list of [best distros for 2017][11].
[
![Advertisement for Intro to Linux](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/introtolinux_1_800x200.jpg?itok=VV8GZold "Advertisement for Intro to Linux")
][12]
### From Windows 7 to Linux: ZorinOS
When Windows 8 rolled out, there was a reason so many wanted to stick with Windows 7—familiarity. Users had been working with the same desktop metaphor for decades and they had no desire to migrate to the more touchscreen-centric platform of Windows 8\. So, what distribution do you turn to for that? You first must consider desktop environment. Why? Because that is where you immediately hook those Windows 7 users. And what better distribution for such a task than [ZorinOS][13]?
ZorinOS was designed specifically as a replacement for Windows (and Mac) computers, so it goes a very long way to replicate the look and feel of those desktops. In fact, youd be hard-pressed to find a Linux distribution that does as good a job of making the transition from Windows 7 to Linux—while still retaining that which makes Linux such a powerful, flexible platform.
Beyond the desktop environment (Figure 1), ZorinOS is based on Ubuntu, so under the hood, everything is going to just work (so theres little need to worry their hardware wont be detected). Couple that with the readily available software and you have the perfect distribution for new users coming from Windows 7.
### [zorinos.jpg][6]
![ZorinOS](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/zorinos.jpg?itok=i970f1Id "ZorinOS")
Figure 1: The ZorinOS Windows 7-like desktop ready to serve.[Used with permission][1]
Do note, however, there are two versions of ZorinOS: Zorin Ultimate and Zorin Core. While Core is free, it doesnt include nearly the amount of software that youll find in Ultimate. If you want an out of the box distribution that will please anyone coming from Windows 7, I highly recommend purchasing [Zorin Ultimate][14] (for approximately $20.00 USD). Of course, if you dont want to splurge for the Ultimate edition, you can always install nearly everything you need from the included Software package management tool.
[
![Advertisement for New Year&#039;s resolution to be a Linux sysadmin](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/newyearsresolution_1_800x200.jpg?itok=BeGasy1I "Advertisement for New Year&#039;s resolution to be a Linux sysadmin")
][15]
### From Windows 8 to Linux: Ubuntu GNOME
The shift to Windows 8, brought about a very touchscreen-centric environment that changed the way users interact with their machines. The old metaphor of Star Menu/Panel/System tray was replaced with an interface that shined in a touchscreen environment. If youre looking for the best environment to give a new-to-Linux user something different, yet still function as a best-in-breed should, look no further than [Ubuntu GNOME][16].
Ubuntu GNOME is a best of two worlds amalgamation between Ubuntu and GNOME (Figure 2). Replacing the Unity interface with a desktop that is equal parts modern elegance and user-friendly simplicity, Ubuntu GNOME shouldnt cause much in the way of issues for any user coming from Windows 8\. Not only does this distribution lay its foundation on the latest LTS release of Ubuntu (so support will last), it makes use of the latest stable release of the GNOME desktop—which means the user will enjoy an incredibly solid experience.  
### [ubuntugnome.jpg][7]
![Ubuntu GNOME](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ubuntugnome.jpg?itok=SNjA3y7T "Ubuntu GNOME")
Figure 2: Simplicity at its elegant best can be found in Ubuntu GNOME.[Used with permission][2]
### From Mac to Linux: Elementary OS
Without a doubt, the hands-down winner for this category is [Elementary OS][17]. Although Elementary does an incredible job of looking and feeling like an OS X desktop, it is much more than that. Elementary OS is, at its very heart, Linux—it just happens to have taken a cue from OS X for many of the design elements.
Any Mac user would feel immediately at home on the desktop environment (Figure 3). With an all-too familiar doc and the inclusion of an applications menu, Elementary OS always stands at the top of my best-of distribution list. And, if were talking about Mac users, there is no better drop-in replacement than Elementary OS.
### [elementaryos.jpg][8]
![Elementary OS](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/elementaryos.jpg?itok=qaXRClRM "Elementary OS")
Figure 3: The glory that is the Elementary OS desktop.[Used with permission][3]
One thing that Mac users will greatly appreciate is how great a job the Elementary OS developers have done keeping design consistency throughout the desktop. From the dock, panel, menus, and included applications, you will not find a single element that doesnt look and feel like it belongs.
There is one caveat that I would add to Elementary OS. Youll need to install a sufficient browser (as it “ships” with Epiphany—a browser not widely supported by many necessary sites) and youll want to install LibreOffice from the downloadable package from the official [LibreOffice site][18] (as the package found in the Elementary OS AppCenter is a bit out of date).
### From Android to Linux: Ubuntu 
This may seem like a bit of a stretch, but considering how dominant Android is within the global market, you will come across users who might need a Linux desktop that would make them feel instantly at home, after coming from a more mobile-centric interface. For me, there is no clearer winner than [Ubuntu][19]. Why? Ubuntu Unity does an outstanding job of making the desktop feel more like an all-encompassing interface than any other. If you want, you can include online search results (now disabled by default), which is something found in nearly every mobile environment. Also, the Unity HUD menu system (Figure 4) is one of the most unique menu systems found in any interface. With this, users can depend less on the mouse (as they would on a mobile device powered by Android).
### [ubuntu.jpg][9]
![Ubuntu Unity](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ubuntu.jpg?itok=HsvBJAIN "Ubuntu Unity")
Figure 4: The Unity Heads Up Display in action.[Used with permission][4]
Of course, Ubuntu also offers one of the most stable desktop platforms on the market, so the user experience will be nearly flawless.
### Theres a distribution for everyone
One of the important things to remember is that there is a distribution of Linux that is sure to please everyone. But for those coming from specific environments, I highly recommend finding a flavor of Linux that will help make the transition seamless. Give one of these a try and see if you find yourself humming along smoothly with the power of Linux and open source at your fingertips.
--------------------------------------------------------------------------------
via: https://www.linux.com/news/best-linux-distributions-new-users
作者:[JACK WALLEN][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.linux.com/users/jlwallen
[1]:https://www.linux.com/licenses/category/used-permission
[2]:https://www.linux.com/licenses/category/used-permission
[3]:https://www.linux.com/licenses/category/used-permission
[4]:https://www.linux.com/licenses/category/used-permission
[5]:https://www.linux.com/licenses/category/creative-commons-zero
[6]:https://www.linux.com/files/images/zorinosjpg
[7]:https://www.linux.com/files/images/ubuntugnomejpg
[8]:https://www.linux.com/files/images/elementaryosjpg-1
[9]:https://www.linux.com/files/images/ubuntujpg
[10]:https://www.linux.com/files/images/distros-new-usersjpg
[11]:https://www.linux.com/news/learn/sysadmin/best-linux-distributions-2017
[12]:http://bit.ly/2jJgK0Q
[13]:https://zorinos.com/
[14]:https://zorinos.com/download/#ultimate
[15]:https://training.linuxfoundation.org/certification/lfcs?utm_source=linux-inline-ad&utm_campaign=new-users-2017&utm_medium=online-advertising&utm_content=new-year
[16]:https://ubuntugnome.org/
[17]:https://elementary.io/
[18]:http://www.libreoffice.org/download/libreoffice-fresh/
[19]:https://www.ubuntu.com/

Some files were not shown because too many files have changed in this diff Show More