diff --git a/published/20161128 Mir is not only about Unity8.md b/published/20161128 Mir is not only about Unity8.md new file mode 100644 index 0000000000..a9616942f9 --- /dev/null +++ b/published/20161128 Mir is not only about Unity8.md @@ -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/ diff --git a/published/201701/20120301 The Beginner’s Guide to Start Using Vim - part 1.md b/published/201701/20120301 The Beginner’s Guide to Start Using Vim - part 1.md new file mode 100644 index 0000000000..07eda5aaa7 --- /dev/null +++ b/published/201701/20120301 The Beginner’s Guide to Start Using Vim - part 1.md @@ -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 上使用最新版的 Vim(7.3.154,LCTT 译注:现在最新版为 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 diff --git a/published/201701/20131227 Vim Keyboard Shortcuts Cheatsheet - part2.md b/published/201701/20131227 Vim Keyboard Shortcuts Cheatsheet - part2.md new file mode 100644 index 0000000000..eede6720b2 --- /dev/null +++ b/published/201701/20131227 Vim Keyboard Shortcuts Cheatsheet - part2.md @@ -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/ diff --git a/published/201701/20140812 5 Vim Tips and Tricks for Experienced Users - part3.md b/published/201701/20140812 5 Vim Tips and Tricks for Experienced Users - part3.md new file mode 100644 index 0000000000..0d231d81b0 --- /dev/null +++ b/published/201701/20140812 5 Vim Tips and Tricks for Experienced Users - part3.md @@ -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`,如果它已经映射到了别的功能上。 + +### 结论 + +更进一步的提高你的 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 diff --git a/published/201701/20150629 Aria2 Vs Wget – Choose your Download Manager.md b/published/201701/20150629 Aria2 Vs Wget – Choose your Download Manager.md new file mode 100644 index 0000000000..625a6ceb8e --- /dev/null +++ b/published/201701/20150629 Aria2 Vs Wget – Choose your Download Manager.md @@ -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 diff --git a/published/20151001 Powerline – Adds Powerful Statuslines and Prompts to Vim Editor and Bash Terminal.md b/published/201701/20151001 Powerline – Adds Powerful Statuslines and Prompts to Vim Editor and Bash Terminal.md similarity index 100% rename from published/20151001 Powerline – Adds Powerful Statuslines and Prompts to Vim Editor and Bash Terminal.md rename to published/201701/20151001 Powerline – Adds Powerful Statuslines and Prompts to Vim Editor and Bash Terminal.md diff --git a/published/201701/20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md b/published/201701/20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md new file mode 100644 index 0000000000..c62d07c0b1 --- /dev/null +++ b/published/201701/20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md @@ -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 diff --git a/published/201701/20160610 Setting Up Real-Time Monitoring with Ganglia.md b/published/201701/20160610 Setting Up Real-Time Monitoring with Ganglia.md new file mode 100755 index 0000000000..0f3bf6ae9a --- /dev/null +++ b/published/201701/20160610 Setting Up Real-Time Monitoring with Ganglia.md @@ -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 + +AuthType basic +AuthName "Ganglia web UI" +AuthBasicProvider file +AuthUserFile "/etc/httpd/auth.basic" +Require user adminganglia + +``` + +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 网格报告* + +使用菜单按钮(如上指出的),你可以获取到每台服务器和集群的信息。还可以使用 对比主机Compare Hosts选项卡来比较集群中所有服务器的状态。 + +可以使用正则表达式选择一组服务器,立刻就可以看到它们性能的对比: + +[![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/ diff --git a/published/20160823 Getting Started with HTTP2 - Part 1.md b/published/201701/20160823 Getting Started with HTTP2 - Part 1.md similarity index 100% rename from published/20160823 Getting Started with HTTP2 - Part 1.md rename to published/201701/20160823 Getting Started with HTTP2 - Part 1.md diff --git a/published/20160929 Getting Started with HTTP2 - Part 2.md b/published/201701/20160929 Getting Started with HTTP2 - Part 2.md similarity index 100% rename from published/20160929 Getting Started with HTTP2 - Part 2.md rename to published/201701/20160929 Getting Started with HTTP2 - Part 2.md diff --git a/published/201701/20161004 Keeping Linux containers safe and secure.md b/published/201701/20161004 Keeping Linux containers safe and secure.md new file mode 100644 index 0000000000..af4885e8ed --- /dev/null +++ b/published/201701/20161004 Keeping Linux containers safe and secure.md @@ -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 diff --git a/published/20161005 GETTING STARTED WITH ANSIBLE.md b/published/201701/20161005 GETTING STARTED WITH ANSIBLE.md similarity index 100% rename from published/20161005 GETTING STARTED WITH ANSIBLE.md rename to published/201701/20161005 GETTING STARTED WITH ANSIBLE.md diff --git a/published/20161012 Introduction to FirewallD on CentOS.md b/published/201701/20161012 Introduction to FirewallD on CentOS.md similarity index 100% rename from published/20161012 Introduction to FirewallD on CentOS.md rename to published/201701/20161012 Introduction to FirewallD on CentOS.md diff --git a/published/20161024 How to Use Old Xorg Apps in Unity 8 on Ubuntu 16.10.md b/published/201701/20161024 How to Use Old Xorg Apps in Unity 8 on Ubuntu 16.10.md similarity index 100% rename from published/20161024 How to Use Old Xorg Apps in Unity 8 on Ubuntu 16.10.md rename to published/201701/20161024 How to Use Old Xorg Apps in Unity 8 on Ubuntu 16.10.md diff --git a/published/20161028 Inkscape: Adding some colour.md b/published/201701/20161028 Inkscape: Adding some colour.md similarity index 100% rename from published/20161028 Inkscape: Adding some colour.md rename to published/201701/20161028 Inkscape: Adding some colour.md diff --git a/published/20161104 Create a simple wallpaper with Fedora and Inkscape.md b/published/201701/20161104 Create a simple wallpaper with Fedora and Inkscape.md similarity index 100% rename from published/20161104 Create a simple wallpaper with Fedora and Inkscape.md rename to published/201701/20161104 Create a simple wallpaper with Fedora and Inkscape.md diff --git a/translated/tech/20161107 CLOUD FOCUSED LINUX DISTROS FOR PEOPLE WHO BREATHE ONLINE.md b/published/201701/20161107 CLOUD FOCUSED LINUX DISTROS FOR PEOPLE WHO BREATHE ONLINE.md similarity index 52% rename from translated/tech/20161107 CLOUD FOCUSED LINUX DISTROS FOR PEOPLE WHO BREATHE ONLINE.md rename to published/201701/20161107 CLOUD FOCUSED LINUX DISTROS FOR PEOPLE WHO BREATHE ONLINE.md index 950d21ab7c..fbdeb75b05 100644 --- a/translated/tech/20161107 CLOUD FOCUSED LINUX DISTROS FOR PEOPLE WHO BREATHE ONLINE.md +++ b/published/201701/20161107 CLOUD FOCUSED LINUX DISTROS FOR PEOPLE WHO BREATHE ONLINE.md @@ -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/) 荣誉推出 diff --git a/published/20161126 Building Vim from source.md b/published/201701/20161126 Building Vim from source.md similarity index 100% rename from published/20161126 Building Vim from source.md rename to published/201701/20161126 Building Vim from source.md diff --git a/published/20161128 Managing devices in Linux.md b/published/201701/20161128 Managing devices in Linux.md similarity index 100% rename from published/20161128 Managing devices in Linux.md rename to published/201701/20161128 Managing devices in Linux.md diff --git a/published/20161201 How to Configure a Firewall with UFW.md b/published/201701/20161201 How to Configure a Firewall with UFW.md similarity index 100% rename from published/20161201 How to Configure a Firewall with UFW.md rename to published/201701/20161201 How to Configure a Firewall with UFW.md diff --git a/published/20161201 Using the NTP time synchronization.md b/published/201701/20161201 Using the NTP time synchronization.md similarity index 100% rename from published/20161201 Using the NTP time synchronization.md rename to published/201701/20161201 Using the NTP time synchronization.md diff --git a/published/20161205 Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT – Part 3.md b/published/201701/20161205 Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT – Part 3.md similarity index 100% rename from published/20161205 Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT – Part 3.md rename to published/201701/20161205 Manage Samba4 Active Directory Infrastructure from Windows10 via RSAT – Part 3.md diff --git a/published/20161206 How to Find Recent or Today’s Modified Files in Linux.md b/published/201701/20161206 How to Find Recent or Today’s Modified Files in Linux.md similarity index 100% rename from published/20161206 How to Find Recent or Today’s Modified Files in Linux.md rename to published/201701/20161206 How to Find Recent or Today’s Modified Files in Linux.md diff --git a/published/20161213 9 Open SourceCommercial Software for Data Center Infrastructure Management.md b/published/201701/20161213 9 Open SourceCommercial Software for Data Center Infrastructure Management.md similarity index 100% rename from published/20161213 9 Open SourceCommercial Software for Data Center Infrastructure Management.md rename to published/201701/20161213 9 Open SourceCommercial Software for Data Center Infrastructure Management.md diff --git a/published/20161215 Building an Email Server on Ubuntu Linux - Part 3.md b/published/201701/20161215 Building an Email Server on Ubuntu Linux - Part 3.md similarity index 100% rename from published/20161215 Building an Email Server on Ubuntu Linux - Part 3.md rename to published/201701/20161215 Building an Email Server on Ubuntu Linux - Part 3.md diff --git a/published/20161216 sshpass -An Excellent Tool for Non-Interactive SSH Login – Never Use on Production Server.md b/published/201701/20161216 sshpass -An Excellent Tool for Non-Interactive SSH Login – Never Use on Production Server.md similarity index 100% rename from published/20161216 sshpass -An Excellent Tool for Non-Interactive SSH Login – Never Use on Production Server.md rename to published/201701/20161216 sshpass -An Excellent Tool for Non-Interactive SSH Login – Never Use on Production Server.md diff --git a/published/201701/20161220 How Linux got to be Linux Test driving 1993-2003 distros.md b/published/201701/20161220 How Linux got to be Linux Test driving 1993-2003 distros.md new file mode 100644 index 0000000000..a19668db49 --- /dev/null +++ b/published/201701/20161220 How Linux got to be Linux Test driving 1993-2003 distros.md @@ -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/ \ No newline at end of file diff --git a/published/20161221 HOW TO INSTALL AND REMOVE SOFTWARE IN UBUNTU .md b/published/201701/20161221 HOW TO INSTALL AND REMOVE SOFTWARE IN UBUNTU .md similarity index 100% rename from published/20161221 HOW TO INSTALL AND REMOVE SOFTWARE IN UBUNTU .md rename to published/201701/20161221 HOW TO INSTALL AND REMOVE SOFTWARE IN UBUNTU .md diff --git a/published/201701/20161222 LFCS Command Line Basics.md b/published/201701/20161222 LFCS Command Line Basics.md new file mode 100644 index 0000000000..91b694b7f0 --- /dev/null +++ b/published/201701/20161222 LFCS Command Line Basics.md @@ -0,0 +1,95 @@ +LFCS 命令行基础 +======================= + +本文中包含了很多命令行基础。我们将讨论 TeleTYpe(TTY)和几个命令及其选项。确保做完所有练习,并要知道,除非另有说明,对 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)。第二行连接显示我已登录到 GUI(TTY7)以及两个伪 TTY(PTS/1 和 PTS/2)。如图 2,你可以看到新条目显示了远程伪 TTY(PTS/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/ diff --git a/published/201701/20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md b/published/201701/20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md new file mode 100644 index 0000000000..c830da2044 --- /dev/null +++ b/published/201701/20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md @@ -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 代理的 FTP(GET 命令或隧道) +* 分段下载 +* 支持 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/ diff --git a/published/20161224 10 Interesting Linux Command Line Tricks and Tips Worth Knowing.md b/published/201701/20161224 10 Interesting Linux Command Line Tricks and Tips Worth Knowing.md similarity index 100% rename from published/20161224 10 Interesting Linux Command Line Tricks and Tips Worth Knowing.md rename to published/201701/20161224 10 Interesting Linux Command Line Tricks and Tips Worth Knowing.md diff --git a/published/201701/20161225 Minecraft Server on Linux.md b/published/201701/20161225 Minecraft Server on Linux.md new file mode 100644 index 0000000000..11795c46fb --- /dev/null +++ b/published/201701/20161225 Minecraft Server on Linux.md @@ -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 GB(30-60 用户量),8 GB(60+ 用户量)。 +- **系统:** 不需要图形化用户接口,可以留出更多的空闲资源。 + +**备注:** 这是“我的世界” 服务端程序的需求,而不是一个完整的操作系统的需求。如果可以给我的世界服务器分配更多的资源,它将运行得更好。 + +###安装 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 diff --git a/published/20161228 10 Linux System Administrators New Years Resolutions 2017.md b/published/201701/20161228 10 Linux System Administrators New Years Resolutions 2017.md similarity index 100% rename from published/20161228 10 Linux System Administrators New Years Resolutions 2017.md rename to published/201701/20161228 10 Linux System Administrators New Years Resolutions 2017.md diff --git a/published/20161229 How Setup Go in Docker and Deploy an Application.md b/published/201701/20161229 How Setup Go in Docker and Deploy an Application.md similarity index 100% rename from published/20161229 How Setup Go in Docker and Deploy an Application.md rename to published/201701/20161229 How Setup Go in Docker and Deploy an Application.md diff --git a/published/201701/20161230 Hot programming trends in 2016.md b/published/201701/20161230 Hot programming trends in 2016.md new file mode 100644 index 0000000000..f8fce088bc --- /dev/null +++ b/published/201701/20161230 Hot programming trends in 2016.md @@ -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 这样的会议都处处提及 “万物皆智能”all things AI 。虽然计算能力的提升已经铺平了道路,所有关于 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 Media,Inc. 的战略内容总监,领导了一个编辑团队,其涵盖各种各样的编程主题,从全栈 web 开发到企业中的开源到新兴的编程语言。她是 OSCON(O'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 diff --git a/published/20161231 How to Trace Execution of Commands in Shell Script with Shell Tracing.md b/published/201701/20161231 How to Trace Execution of Commands in Shell Script with Shell Tracing.md similarity index 100% rename from published/20161231 How to Trace Execution of Commands in Shell Script with Shell Tracing.md rename to published/201701/20161231 How to Trace Execution of Commands in Shell Script with Shell Tracing.md diff --git a/published/20170102 A Guide To Buying A Linux Laptop.md b/published/201701/20170102 A Guide To Buying A Linux Laptop.md similarity index 100% rename from published/20170102 A Guide To Buying A Linux Laptop.md rename to published/201701/20170102 A Guide To Buying A Linux Laptop.md diff --git a/published/201701/20170103 4 hot skills for Linux pros in 2017.md b/published/201701/20170103 4 hot skills for Linux pros in 2017.md new file mode 100644 index 0000000000..a94e515690 --- /dev/null +++ b/published/201701/20170103 4 hot skills for Linux pros in 2017.md @@ -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 diff --git a/published/20170103 How to Customize Bash Colors and Content in Linux Terminal Prompt copy.md b/published/201701/20170103 How to Customize Bash Colors and Content in Linux Terminal Prompt copy.md similarity index 100% rename from published/20170103 How to Customize Bash Colors and Content in Linux Terminal Prompt copy.md rename to published/201701/20170103 How to Customize Bash Colors and Content in Linux Terminal Prompt copy.md diff --git a/published/20170104 5 Ways to Find a Binary Command Description and Location on File System.md b/published/201701/20170104 5 Ways to Find a Binary Command Description and Location on File System.md similarity index 100% rename from published/20170104 5 Ways to Find a Binary Command Description and Location on File System.md rename to published/201701/20170104 5 Ways to Find a Binary Command Description and Location on File System.md diff --git a/published/201701/20170104 50 ways to avoid getting hacked in 2017 copy.md b/published/201701/20170104 50 ways to avoid getting hacked in 2017 copy.md new file mode 100644 index 0000000000..bca625b32c --- /dev/null +++ b/published/201701/20170104 50 ways to avoid getting hacked in 2017 copy.md @@ -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/ diff --git a/translated/tech/20170104 Speed up your downloads with Axel command line downloader.md b/published/201701/20170104 Speed up your downloads with Axel command line downloader.md similarity index 89% rename from translated/tech/20170104 Speed up your downloads with Axel command line downloader.md rename to published/201701/20170104 Speed up your downloads with Axel command line downloader.md index e50502507c..2d5b8cb7c3 100644 --- a/translated/tech/20170104 Speed up your downloads with Axel command line downloader.md +++ b/published/201701/20170104 Speed up your downloads with Axel command line downloader.md @@ -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/ diff --git a/translated/tech/20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md b/published/201701/20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md similarity index 83% rename from translated/tech/20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md rename to published/201701/20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md index 7de8a86bb4..7df5d79315 100644 --- a/translated/tech/20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md +++ b/published/201701/20170105 PhotoRec – Recover Deleted or Lost Files in Linux.md @@ -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 系统中安装 TestDisk(PhotoRec) @@ -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 diff --git a/published/201701/20170107 10 Useful Sudoers Configurations for Setting sudo in Linux.md b/published/201701/20170107 10 Useful Sudoers Configurations for Setting sudo in Linux.md new file mode 100644 index 0000000000..c689e68d5f --- /dev/null +++ b/published/201701/20170107 10 Useful Sudoers Configurations for Setting sudo in Linux.md @@ -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/ diff --git a/published/201701/20170109 CentOS vs Ubuntu: Which one is better for a server.md b/published/201701/20170109 CentOS vs Ubuntu: Which one is better for a server.md new file mode 100644 index 0000000000..2536be20ba --- /dev/null +++ b/published/201701/20170109 CentOS vs Ubuntu: Which one is better for a server.md @@ -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/ diff --git a/published/201701/20170111 It’s Time to Ditch Skype and TeamSpeak, Discord Launches Its App for Linux Users.md b/published/201701/20170111 It’s Time to Ditch Skype and TeamSpeak, Discord Launches Its App for Linux Users.md new file mode 100644 index 0000000000..6f9bbfe872 --- /dev/null +++ b/published/201701/20170111 It’s Time to Ditch Skype and TeamSpeak, Discord Launches Its App for Linux Users.md @@ -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 diff --git a/published/201701/20170112 3 Useful VIM Editor Tips and Tricks for Advanced Users - part 3.md b/published/201701/20170112 3 Useful VIM Editor Tips and Tricks for Advanced Users - part 3.md new file mode 100644 index 0000000000..1e3831647c --- /dev/null +++ b/published/201701/20170112 3 Useful VIM Editor Tips and Tricks for Advanced Users - part 3.md @@ -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 diff --git a/published/201701/20170112 Let Sudo Insult You When You Enter Incorrect Password.md b/published/201701/20170112 Let Sudo Insult You When You Enter Incorrect Password.md new file mode 100644 index 0000000000..9a132b01ec --- /dev/null +++ b/published/201701/20170112 Let Sudo Insult You When You Enter Incorrect Password.md @@ -0,0 +1,96 @@ +让 sudo 在你输入错误的密码时“嘲讽”你 +============================================================ + +**sudoers** 是 Linux 中的默认 sudo 安全策略插件,但是经验丰富的系统管理员可以自定义安全策略以及输入输出日志记录的插件。它由 `/etc/sudoers` 这个文件驱动,或者也可在 LDAP 中。 + +你可以在上面的文件中定义 **sudoers** 嘲讽insults 或其他选项。它在 `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 diff --git a/published/201701/20170112 You Can Now Have a Single ISO Image with All the Essential Ubuntu 16.10 Flavors.md b/published/201701/20170112 You Can Now Have a Single ISO Image with All the Essential Ubuntu 16.10 Flavors.md new file mode 100644 index 0000000000..459755d5e8 --- /dev/null +++ b/published/201701/20170112 You Can Now Have a Single ISO Image with All the Essential Ubuntu 16.10 Flavors.md @@ -0,0 +1,31 @@ +你现在可以下载包含所有风味的 Ubuntu 16.10 的单独 ISO 镜像了 +====================================== +Linux AIO 开发商 Željko Popivoda 通知说可以下载 Linux AIO(All-in-One)Ubuntu 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 diff --git a/published/201701/20170113 Best Linux Distributions for New Users.md b/published/201701/20170113 Best Linux Distributions for New Users.md new file mode 100644 index 0000000000..134b9d38a2 --- /dev/null +++ b/published/201701/20170113 Best Linux Distributions for New Users.md @@ -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 到 Linux:ZorinOS + +当 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 到 Linux:Ubuntu + +这似乎有点像是一个延伸话题,但考虑到 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/ diff --git a/published/201701/20170113 Learn The Basics of How Linux IO Redirection Works.md b/published/201701/20170113 Learn The Basics of How Linux IO Redirection Works.md new file mode 100644 index 0000000000..9b61d2304d --- /dev/null +++ b/published/201701/20170113 Learn The Basics of How Linux IO Redirection Works.md @@ -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 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/ diff --git a/published/201701/20170114 Set Date and Time for Each Command You Execute in Bash History.md b/published/201701/20170114 Set Date and Time for Each Command You Execute in Bash History.md new file mode 100644 index 0000000000..26081ae73b --- /dev/null +++ b/published/201701/20170114 Set Date and Time for Each Command You Execute in Bash History.md @@ -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 Saive,TecMint 的创建者。一个爱在网上分享的技巧和提示的电脑极客和 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 diff --git a/published/201701/20170116 Can RISC-V - Linux of Microprocessors - Start an Open Hardware Renaissance.md b/published/201701/20170116 Can RISC-V - Linux of Microprocessors - Start an Open Hardware Renaissance.md new file mode 100644 index 0000000000..2e3f35f21b --- /dev/null +++ b/published/201701/20170116 Can RISC-V - Linux of Microprocessors - Start an Open Hardware Renaissance.md @@ -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/ diff --git a/published/201701/20170117 How to Find Number of Files in a Directory and Subdirectories.md b/published/201701/20170117 How to Find Number of Files in a Directory and Subdirectories.md new file mode 100644 index 0000000000..6a9d069366 --- /dev/null +++ b/published/201701/20170117 How to Find Number of Files in a Directory and Subdirectories.md @@ -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 diff --git a/published/201701/20170118 How to Keep ‘sudo’ Password Timeout Session Longer in Linux.md b/published/201701/20170118 How to Keep ‘sudo’ Password Timeout Session Longer in Linux.md new file mode 100644 index 0000000000..34ed8d378b --- /dev/null +++ b/published/201701/20170118 How to Keep ‘sudo’ Password Timeout Session Longer in Linux.md @@ -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/ diff --git a/published/201701/20170119 How To Assign Output of a Linux Command to a Variable.md b/published/201701/20170119 How To Assign Output of a Linux Command to a Variable.md new file mode 100644 index 0000000000..fff397f52f --- /dev/null +++ b/published/201701/20170119 How To Assign Output of a Linux Command to a Variable.md @@ -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 diff --git a/published/201701/20170120 vmstat – A Standard Nifty Tool to Report Virtual Memory Statistics.md b/published/201701/20170120 vmstat – A Standard Nifty Tool to Report Virtual Memory Statistics.md new file mode 100644 index 0000000000..2eabbface1 --- /dev/null +++ b/published/201701/20170120 vmstat – A Standard Nifty Tool to Report Virtual Memory Statistics.md @@ -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/ diff --git a/published/201701/20170121 This GPU-powered database analytics platform can query billions of data points in milliseconds.md b/published/201701/20170121 This GPU-powered database analytics platform can query billions of data points in milliseconds.md new file mode 100644 index 0000000000..f1c2051f81 --- /dev/null +++ b/published/201701/20170121 This GPU-powered database analytics platform can query billions of data points in milliseconds.md @@ -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 卡更新数据库。 + +除了 Verizon,MapD 还有如社交媒体公司,金融和广告公司的客户。 + +由 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 diff --git a/published/201701/20170121 Your Computers Clipboard is a Security Problem - Fix it in Linux with xsel and cron.md b/published/201701/20170121 Your Computers Clipboard is a Security Problem - Fix it in Linux with xsel and cron.md new file mode 100644 index 0000000000..55613078d9 --- /dev/null +++ b/published/201701/20170121 Your Computers Clipboard is a Security Problem - Fix it in Linux with xsel and cron.md @@ -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 diff --git a/published/20170105 OpenSSL For Apache and Dovecot part 1.md b/published/20170105 OpenSSL For Apache and Dovecot part 1.md new file mode 100644 index 0000000000..c6365507ba --- /dev/null +++ b/published/20170105 OpenSSL For Apache and Dovecot part 1.md @@ -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 diff --git a/published/20170112 OpenSSL For Apache and Dovecot Part 2.md b/published/20170112 OpenSSL For Apache and Dovecot Part 2.md new file mode 100644 index 0000000000..8870ff1bc4 --- /dev/null +++ b/published/20170112 OpenSSL For Apache and Dovecot Part 2.md @@ -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 = +250 2.1.0 Ok +rcpt to: +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: +Delivered-To: alrac@studio +Received: from localhost + by studio.alrac.net (Dovecot) with LMTP id y8G5C8aablgKIQAAYelYQA + for ; Thu, 05 Jan 2017 11:13:10 -0800 +Received: from studio (localhost [127.0.0.1]) + by localhost (Postfix) with ESMTPS id B9B529FE59 + for ; 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 diff --git a/published/20170118 Improve your sleep by using Redshift on Fedora.md b/published/20170118 Improve your sleep by using Redshift on Fedora.md new file mode 100644 index 0000000000..2eebb61eaf --- /dev/null +++ b/published/20170118 Improve your sleep by using Redshift on Fedora.md @@ -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 24,Redshift 可以工作在默认登录会话中。然而,在 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。 + +色温与发射的蓝光的量成比例:较低的色温意味着较低量的蓝光。我喜欢在白天使用 5600K(6500K 是中性日光),在晚上使用 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 diff --git a/published/20170120 Install Latest Thunderbird Email Client in Linux Systems.md b/published/20170120 Install Latest Thunderbird Email Client in Linux Systems.md new file mode 100644 index 0000000000..9de5115634 --- /dev/null +++ b/published/20170120 Install Latest Thunderbird Email Client in Linux Systems.md @@ -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 Saive,TecMint 的创建者。一个喜欢在互联网上分享技巧和提示的计算机 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/ diff --git a/translated/tech/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md b/published/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md similarity index 59% rename from translated/tech/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md rename to published/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md index 17cef78ae9..e91c232d32 100644 --- a/translated/tech/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md +++ b/published/LXD/Part 6 - LXD 2.0--Remote hosts and container migration.md @@ -9,55 +9,55 @@ LXD 2.0 系列(六):远程主机及容器迁移 LXD 2.0 支持两种协议: -* LXD 1.0 API:这是在客户端和LXD守护进程之间使用的REST API,以及在复制/移动镜像和容器时在LXD守护进程之间使用的REST API。 -* Simplestreams:Simplestreams协议是LXD客户端和守护进程使用的只读、只有镜像的协议,以获取镜像信息以及从一些公共镜像服务器(如Ubuntu镜像)导入镜像。 +* LXD 1.0 API:这是在客户端和 LXD 守护进程之间使用的 REST API,以及在 LXD 守护进程间复制/移动镜像和容器时使用的 REST API。 +* Simplestreams:Simplestreams 协议是 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 foo:c1 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 foo:c1 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/) 荣誉推出 diff --git a/sources/talk/20161227 2017 is the year that front-end developers should go back and master the basics.md b/sources/talk/20161227 2017 is the year that front-end developers should go back and master the basics.md deleted file mode 100644 index abab7015dc..0000000000 --- a/sources/talk/20161227 2017 is the year that front-end developers should go back and master the basics.md +++ /dev/null @@ -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. - -I’m not saying we shouldn’t do that. But we should probably slow down a bit and take a look at the things that don’t change all that much. Not only will this improve the quality of our work and the value we deliver — it 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 books — in 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 that’s better than any older framework, it’s easy to spend most of your time learning frameworks rather than the language itself. If you’re using a framework but don’t 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] Simpson’s book series [You Don’t 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 Pennisi — understand TC-39 process for new ECMAScript features. - -### Learn functional programming - -For years we wanted classes in JavaScript. Now we finally have them but don’t 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 Frisby’s [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, we’re closer to users than anybody else on the team — maybe even closer than designers. And if designers have to verify every pixel you put on screen, you’re 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, that’s not how it works. - -We rarely work in isolation: we have to talk to other developers, designers, managers — and sometimes even users. That’s hard. But it’s important if you want to really understand what you’re doing and why, because that’s where the value in what we do lies. - -* [Soft Skills: The software developer’s 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 Don’t 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. -* [Orwell’s rules on writing][32]. -* In Russian: awesome [Glavred course][33]. - -### Learn the old computer science wisdom - -Front-end development isn’t just animated dropdown menus any more. It’s 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 it’s 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 diff --git a/sources/talk/20170109 How to get started as an open source programmer.md b/sources/talk/20170109 How to get started as an open source programmer.md deleted file mode 100644 index 45d6975e69..0000000000 --- a/sources/talk/20170109 How to get started as an open source programmer.md +++ /dev/null @@ -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 diff --git a/sources/talk/20170110 What engineers and marketers can learn from each other.md b/sources/talk/20170110 What engineers and marketers can learn from each other.md deleted file mode 100644 index f88aa0117a..0000000000 --- a/sources/talk/20170110 What engineers and marketers can learn from each other.md +++ /dev/null @@ -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 diff --git a/sources/talk/20170111 How to choose your first programming language.md b/sources/talk/20170111 How to choose your first programming language.md deleted file mode 100644 index 849a26a13c..0000000000 --- a/sources/talk/20170111 How to choose your first programming language.md +++ /dev/null @@ -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 diff --git a/sources/talk/20170113 Tips for non-native English speakers working on open source projects.md b/sources/talk/20170113 Tips for non-native English speakers working on open source projects.md index 3e98f70801..0c60d2b4d0 100644 --- a/sources/talk/20170113 Tips for non-native English speakers working on open source projects.md +++ b/sources/talk/20170113 Tips for non-native English speakers working on open source projects.md @@ -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") diff --git a/sources/talk/20170116 Can academic faculty members teach with Wikipedia.md b/sources/talk/20170116 Can academic faculty members teach with Wikipedia.md new file mode 100644 index 0000000000..087ca5b156 --- /dev/null +++ b/sources/talk/20170116 Can academic faculty members teach with Wikipedia.md @@ -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 diff --git a/sources/talk/20170117 Arch Linux on a Lenovo Yoga 900.md b/sources/talk/20170117 Arch Linux on a Lenovo Yoga 900.md new file mode 100644 index 0000000000..3cb48897dc --- /dev/null +++ b/sources/talk/20170117 Arch Linux on a Lenovo Yoga 900.md @@ -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 you’ve 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 didn’t 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 I’m 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 I’ve ever used going back to 9th grade typing class on the IBM Selectric. I’d 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 20th century, IBM had changed the layout of their typewriters, and then bragged about the “[efficiency][4]” gains. The company wouldn’t 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 I’d 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. I’m hoping this hardware will last me years. I’d 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 90’s, you’d 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. I’m just happy if I’ll 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 you’ve got broken parts rattling around inside, which usually is something to be worried about for electronics! However, it’s 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 wasn’t the hardware, it was the driver, which is basically unmaintained, and of course had some bugs. It’s 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. It’s 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 didn’t give any audible click sound anymore. That actually isn’t 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 there’s 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 they’ve 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. + +Linux’s 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 didn’t [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 couldn’t even [detect the hard drive][12]. Lenovo’s first reply was that the laptops didn’t 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 isn’t even room to install another. + +Here’s some more of Lenovo’s [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 didn’t 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. Let’s hope they learn a lesson, but I’m 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. I’d 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 Linux’s fault for not supporting this new RAID driver mode. However, AHCI is a very popular standard, and the Linux kernel team rejected Intel’s code for this hardware as “[too ugly to live][21]”! The team also asked Intel for a specification describing the device’s behavior, but wasn’t 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 didn’t 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 shouldn’t 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. I’d have to replace the fans. They don’t run on the Yoga 2 for typical tasks of word processing and web browsing, but when they do spin up it’s annoying if I’m 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. It’s 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 didn’t 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 wasn’t 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 aren’t 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 couldn’t 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 spec’ed 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. It’s 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 wouldn’t have to type it in every time, but couldn’t. I can’t just pass those in automatically either, as other things need to go before and after. I also discovered that it won’t 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 don’t know or can’t be bothered. Unfortunately [it’s 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 I’m 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 wouldn’t say it’s 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 don’t see any mention of people using it in Blender yet, so I wonder the status and whether it is just demoware. Intel’s 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, there’s 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 aren’t 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” screen’s 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 aren’t 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 hasn’t released yet. Even so, LibreOffice looks better than many other Linux apps which don’t 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 Linux’s 1.5% marketshare is that these sorts of issues don’t get much priority. Many codebases are moving to GTK 3, but in Audacity’s 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 I’d 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 it’s 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 don’t tell the number of times it has written to each cell. In fact, I can’t 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 haven’t 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 don’t 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 don’t 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 I’m 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 didn’t 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 y’all 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. I’d 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. It’s 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 isn’t 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 isn’t. Every time I’ve 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 didn’t 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 didn’t have to mess with [UEFI][35]. + +I was sorry I didn’t 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. I’d 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. I’ve 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 wouldn’t 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 doesn’t 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 isn’t changing is the worst case scenario for a bug report. I don’t 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, what’s the point of making a new release if you’ve 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 they’ve 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 isn’t 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 don’t 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 it’s 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 don’t 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 doesn’t handle inter-package dependencies, and isn’t 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 didn’t have any dependencies for the codecs so even after installing it, it won’t 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].) There’s 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 it’s much simpler. + +I have friends who install 3rd party software on Windows just to keep their drivers up to date, because it grabs code from many more websites than just Microsoft’s. 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 wasn’t written in the clunky [fad Javascript][42], and they re-enabled a community around custom themes and color schemes. It’s 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 we’re 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 I’m just going to sit back and keep waiting for the HiDPI and other improvements! I’m 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 diff --git a/sources/talk/20170119 Be a force for good in your community.md b/sources/talk/20170119 Be a force for good in your community.md new file mode 100644 index 0000000000..c58100cf63 --- /dev/null +++ b/sources/talk/20170119 Be a force for good in your community.md @@ -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 diff --git a/sources/talk/20170119 The Many the Humble the Ubuntu Users.md b/sources/talk/20170119 The Many the Humble the Ubuntu Users.md new file mode 100644 index 0000000000..8ff6cf40f7 --- /dev/null +++ b/sources/talk/20170119 The Many the Humble the Ubuntu Users.md @@ -0,0 +1,54 @@ +The Many, the Humble, the Ubuntu Users +============================================================ + +#### The proverbial “better mousetrap” isn’t one that takes a certified biologist to use. Like Ubuntu, it just needs to do its job extremely well and with little fuss. + +### Roblimo’s 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 don’t administer my PC or network often enough to memorize long command strings. Sure, I can look them up and type them in, but I’d 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 girlfriend’s itch? How about your coworkers? And people who work at your favorite restaurant? And what about your doctor? Don’t 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?! It’s 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 Ubuntu’s own extensive forums, and many other places. + +Sure, it’s cooler to use Debian or Fedora, and Mint looks jazzier out of the box, but I’m _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 can’t see it! It’s covered with application windows! And I’m talking two monitors, not just one. I have, let’s see…. 17 Chrome tabs open in two windows. And GIMP running. And [Bluefish][2], which I’m 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, isn’t it really Ubuntu? So if I use the same few programs over and over, which I do, and can’t see the desktop anyway, who cares if it’s 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’ Miller’s 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 diff --git a/sources/talk/20170120 How is your community promoting diversity.md b/sources/talk/20170120 How is your community promoting diversity.md new file mode 100644 index 0000000000..6b10faead7 --- /dev/null +++ b/sources/talk/20170120 How is your community promoting diversity.md @@ -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 diff --git a/sources/talk/20170126 A 5-step plan to encourage your team to make changes on your project.md b/sources/talk/20170126 A 5-step plan to encourage your team to make changes on your project.md new file mode 100644 index 0000000000..746c36edc7 --- /dev/null +++ b/sources/talk/20170126 A 5-step plan to encourage your team to make changes on your project.md @@ -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 diff --git a/sources/talk/20170126 How to join a technical community.md b/sources/talk/20170126 How to join a technical community.md new file mode 100644 index 0000000000..2dbf1d5d6e --- /dev/null +++ b/sources/talk/20170126 How to join a technical community.md @@ -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 diff --git a/sources/talk/20170131 Be the open source supply chain.md b/sources/talk/20170131 Be the open source supply chain.md new file mode 100644 index 0000000000..84a31635d7 --- /dev/null +++ b/sources/talk/20170131 Be the open source supply chain.md @@ -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, I’ll 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 can’t tell you how many times engineering teams decided to "fix" shortcomings in existing supply chain components by deciding to write it themselves. I won’t say "never ever do that," but I will warn that if you take on the responsibility of writing an infrastructure component, understand that you’re 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. You’re 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 project’s automated testing procedures, which, when combined with your own team’s 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 you’re 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 community’s 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, it’s in Red Hat’s 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, let’s look at their approach to product development with OpenStack. + +Curiously, Red Hat’s 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 isn’t 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 aren’t 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 Hat’s 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 they’re 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 Hat’s 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 company’s 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 company’s 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 Hat’s 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: Don’t just consume upstream code, minimally shimming it into a product. That approach won’t 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 diff --git a/sources/talk/20170131 Book review Ours to Hack and to Own.md b/sources/talk/20170131 Book review Ours to Hack and to Own.md new file mode 100644 index 0000000000..1405bfe34a --- /dev/null +++ b/sources/talk/20170131 Book review Ours to Hack and to Own.md @@ -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 diff --git a/sources/talk/20170131 Developing open leaders.md b/sources/talk/20170131 Developing open leaders.md new file mode 100644 index 0000000000..356e55b6eb --- /dev/null +++ b/sources/talk/20170131 Developing open leaders.md @@ -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 diff --git a/sources/talk/The history of Android/31 The (updated) history of Android.md b/sources/talk/The history of Android/31 The (updated) history of Android.md deleted file mode 100644 index 5c4bc9fd10..0000000000 --- a/sources/talk/The history of Android/31 The (updated) history of Android.md +++ /dev/null @@ -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 diff --git a/sources/talk/The history of Android/32 The (updated) history of Android.md b/sources/talk/The history of Android/32 The (updated) history of Android.md deleted file mode 100644 index 31d79144ee..0000000000 --- a/sources/talk/The history of Android/32 The (updated) history of Android.md +++ /dev/null @@ -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/ diff --git a/sources/talk/The history of Android/33 The (updated) history of Android.md b/sources/talk/The history of Android/33 The (updated) history of Android.md deleted file mode 100644 index 055c64405c..0000000000 --- a/sources/talk/The history of Android/33 The (updated) history of Android.md +++ /dev/null @@ -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] - -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 Google’s Hiroshi Lockheimer about Pixel, Android OEMs, and more][27] - -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/ diff --git a/sources/tech/20120301 The Beginner’s Guide to Start Using Vim - part 1.md b/sources/tech/20120301 The Beginner’s Guide to Start Using Vim - part 1.md deleted file mode 100644 index bc6be5f24a..0000000000 --- a/sources/tech/20120301 The Beginner’s Guide to Start Using Vim - part 1.md +++ /dev/null @@ -1,125 +0,0 @@ -Tarnslating by Yinr - -The Beginner’s 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 Beginner’s 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, it’s 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 you’ve never used Vi or Vim before, it is very likely that you don’t even know how to exit… Yes, it’s 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 don’t 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, let’s 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 diff --git a/sources/tech/20131227 Vim Keyboard Shortcuts Cheatsheet - part2.md b/sources/tech/20131227 Vim Keyboard Shortcuts Cheatsheet - part2.md deleted file mode 100644 index e54a763e6a..0000000000 --- a/sources/tech/20131227 Vim Keyboard Shortcuts Cheatsheet - part2.md +++ /dev/null @@ -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 Beginner’s 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 that’s 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”. You’ll have to switch to the “insert mode” to make the keys input the character they represent. - -Here’s 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 - -Can’t 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/ diff --git a/sources/tech/20140812 5 Vim Tips and Tricks for Experienced Users - part3.md b/sources/tech/20140812 5 Vim Tips and Tricks for Experienced Users - part3.md deleted file mode 100644 index deaa11608a..0000000000 --- a/sources/tech/20140812 5 Vim Tips and Tricks for Experienced Users - part3.md +++ /dev/null @@ -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 Beginner’s 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 it’s 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 you’ve 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, it’s a sheer waste of time if you’ve 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 it’s 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= -``` - -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 it’s 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 diff --git a/sources/tech/20160325 Network automation with Ansible.md b/sources/tech/20160325 Network automation with Ansible.md index 0f543a3c18..4c53403063 100644 --- a/sources/tech/20160325 Network automation with Ansible.md +++ b/sources/tech/20160325 Network automation with Ansible.md @@ -1,3 +1,5 @@ +Martin translating... + Network automation with Ansible ================ diff --git a/sources/tech/20160707 6 Best JavaScript Frameworks to Learn In 2016.md b/sources/tech/20160707 6 Best JavaScript Frameworks to Learn In 2016.md new file mode 100644 index 0000000000..1c25fe6f7e --- /dev/null +++ b/sources/tech/20160707 6 Best JavaScript Frameworks to Learn In 2016.md @@ -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 (Model–view–controller)** 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 Instagram’s 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 **Model–view–viewmodel (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 **Model–view–viewmodel (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 (Model–view–controller)** 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 you’re 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 diff --git a/sources/tech/20161214 The Cost of Native Mobile App Development is Too Damn High.md b/sources/tech/20161214 The Cost of Native Mobile App Development is Too Damn High.md index 62f07f6b22..5d9783a337 100644 --- a/sources/tech/20161214 The Cost of Native Mobile App Development is Too Damn High.md +++ b/sources/tech/20161214 The Cost of Native Mobile App Development is Too Damn High.md @@ -1,3 +1,5 @@ +fuowang 翻译中 + The Cost of Native Mobile App Development is Too Damn High! ============================================================ diff --git a/sources/tech/20161222 Top open source creative tools in 2016.md b/sources/tech/20161222 Top open source creative tools in 2016.md index ce320518fa..b870581efa 100644 --- a/sources/tech/20161222 Top open source creative tools in 2016.md +++ b/sources/tech/20161222 Top open source creative tools in 2016.md @@ -1,3 +1,5 @@ +Translating by StdioA + Top open source creative tools in 2016 ============================================================ diff --git a/sources/tech/20161225 Minecraft Server on Linux.md b/sources/tech/20161225 Minecraft Server on Linux.md deleted file mode 100644 index 3da09accfb..0000000000 --- a/sources/tech/20161225 Minecraft Server on Linux.md +++ /dev/null @@ -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 diff --git a/sources/tech/20170107 10 Useful Sudoers Configurations for Setting sudo in Linux.md b/sources/tech/20170107 10 Useful Sudoers Configurations for Setting sudo in Linux.md deleted file mode 100644 index 17b87a5fa2..0000000000 --- a/sources/tech/20170107 10 Useful Sudoers Configurations for Setting sudo in Linux.md +++ /dev/null @@ -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 user’s password, but it can as well be the target user’s 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 user’s 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] - -Let’s 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]. - -That’s 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/ diff --git a/sources/tech/20170107 Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi.md b/sources/tech/20170107 Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi.md deleted file mode 100644 index c7af491c13..0000000000 --- a/sources/tech/20170107 Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi.md +++ /dev/null @@ -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 don’t 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 network’s 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 Pi’s 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 / -``` - -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, here’s 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 it’ll 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:///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 won’t 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 haven’t 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 kid’s 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 don’t 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 diff --git a/sources/tech/20170107 Min Browser Muffles the Web Noise.md b/sources/tech/20170107 Min Browser Muffles the Web Noise.md deleted file mode 100644 index 814c19d0ae..0000000000 --- a/sources/tech/20170107 Min Browser Muffles the Web Noise.md +++ /dev/null @@ -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 diff --git a/sources/tech/20170109 How to record a region of your desktop as animated GIF on Linux.md b/sources/tech/20170109 How to record a region of your desktop as animated GIF on Linux.md index 2ca614447b..3f65296224 100644 --- a/sources/tech/20170109 How to record a region of your desktop as animated GIF on Linux.md +++ b/sources/tech/20170109 How to record a region of your desktop as animated GIF on Linux.md @@ -1,3 +1,6 @@ +vim-kakali translating + + How to record a region of your desktop as animated GIF on Linux ============================================================ diff --git a/sources/tech/20170111 Explore climate data with open source tools.md b/sources/tech/20170111 Explore climate data with open source tools.md deleted file mode 100644 index 9f3b45f0d7..0000000000 --- a/sources/tech/20170111 Explore climate data with open source tools.md +++ /dev/null @@ -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 diff --git a/sources/tech/20170111 Linux command line navigation tips and tricks - part 1.md b/sources/tech/20170111 Linux command line navigation tips and tricks - part 1.md new file mode 100644 index 0000000000..4a49c35c85 --- /dev/null +++ b/sources/tech/20170111 Linux command line navigation tips and tricks - part 1.md @@ -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 diff --git a/sources/tech/20170112 3 Useful VIM Editor Tips and Tricks for Advanced Users - part 3.md b/sources/tech/20170112 3 Useful VIM Editor Tips and Tricks for Advanced Users - part 3.md deleted file mode 100644 index 4f4662a0d2..0000000000 --- a/sources/tech/20170112 3 Useful VIM Editor Tips and Tricks for Advanced Users - part 3.md +++ /dev/null @@ -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 Beginner’s 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 isn’t 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 who’ve just started using the editor, I’m sure our [Vim keyboard shortcuts cheatsheet][15] will be extremely useful to you. And if you’re 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 aren’t coders and use Vim for general text editing) can’t 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 editor’s default indentation is set to four spaces. - -Basically we’re talking about file-specific changes here. There’s 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 feature’s [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 it’s not easy to remember all the names, so whenever you have to write a variable name you usually copy it from where it’s 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. - -Here’s 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. - -There’s no problem with the aforementioned approach, per se, but there’s 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 you’re trying to search, which isn’t 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 aren’t 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 diff --git a/sources/tech/20170112 How to Install Nextcloud with Nginx and PHP7-FPM on CentOS 7.md b/sources/tech/20170112 How to Install Nextcloud with Nginx and PHP7-FPM on CentOS 7.md index 26bcb1ff2c..ae71621e37 100644 --- a/sources/tech/20170112 How to Install Nextcloud with Nginx and PHP7-FPM on CentOS 7.md +++ b/sources/tech/20170112 How to Install Nextcloud with Nginx and PHP7-FPM on CentOS 7.md @@ -1,3 +1,5 @@ +GHLandy Translating   + How to Install Nextcloud with Nginx and PHP7-FPM on CentOS 7 ============================================================ diff --git a/sources/tech/20170112 Let Sudo Insult You When You Enter Incorrect Password.md b/sources/tech/20170112 Let Sudo Insult You When You Enter Incorrect Password.md deleted file mode 100644 index 5a8f76a999..0000000000 --- a/sources/tech/20170112 Let Sudo Insult You When You Enter Incorrect Password.md +++ /dev/null @@ -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 - -That’s 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 diff --git a/sources/tech/20170113 Best Linux Distributions for New Users.md b/sources/tech/20170113 Best Linux Distributions for New Users.md deleted file mode 100644 index d36a9ba44d..0000000000 --- a/sources/tech/20170113 Best Linux Distributions for New Users.md +++ /dev/null @@ -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 they’ve 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. - -That’s 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? I’m 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, you’d 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 there’s little need to worry their hardware won’t 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 doesn’t include nearly the amount of software that you’ll 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 don’t 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'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'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 you’re 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 shouldn’t 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 we’re 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 doesn’t look and feel like it belongs. - -There is one caveat that I would add to Elementary OS. You’ll need to install a sufficient browser (as it “ships” with Epiphany—a browser not widely supported by many necessary sites) and you’ll 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. - -### There’s 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/ diff --git a/sources/tech/20170113 How to install a Ceph Storage Cluster on Ubuntu 16.04.md b/sources/tech/20170113 How to install a Ceph Storage Cluster on Ubuntu 16.04.md deleted file mode 100644 index 424b4df92a..0000000000 --- a/sources/tech/20170113 How to install a Ceph Storage Cluster on Ubuntu 16.04.md +++ /dev/null @@ -1,463 +0,0 @@ -How to install a Ceph Storage Cluster on Ubuntu 16.04 -============================================================ - -### On this page - -1. [Step 1 - Configure All Nodes][1] -2. [Step 2 - Configure the SSH Server][2] -3. [Step 3 - Configure the Ubuntu Firewall][3] -4. [Step 4 - Configure the Ceph OSD Nodes][4] -5. [Step 5 - Build the Ceph Cluster][5] -6. [Step 6 - Testing Ceph][6] -7. [Reference][7] - -Ceph is an open source storage platform, it provides high performance, reliability, and scalability. It's a free distributed storage system that provides an interface for object, block, and file-level storage and can operate without a single point of failure. - -In this tutorial, I will guide you to install and build a Ceph cluster on Ubuntu 16.04 server. A Ceph cluster consists of these components: - -* **Ceph OSDs (ceph-osd)** - Handles the data storage, data replication, and recovery. A Ceph cluster needs at least two Ceph OSD servers. We will use three Ubuntu 16.04 servers in this setup. -* **Ceph Monitor (ceph-mon)** - Monitors the cluster state and runs the OSD map and CRUSH map. We will use one server here. -* **Ceph Meta Data Server (ceph-mds)** - this is needed if you want to use Ceph as a File System. - -### **Prerequisites** - -* 6 server nodes with Ubuntu 16.04 server installed -* Root privileges on all nodes - -I will use the following hostname / IP setup: - -**hostname**        **IP address** - -_ceph-admin        10.0.15.10 -mon1                 10.0.15.11 -osd1                  10.0.15.21 -osd2                  10.0.15.22 -osd3                  10.0.15.23 -client                 10.0.15.15_ - -### Step 1 - Configure All Nodes - -In this step, we will configure all 6 nodes to prepare them for the installation of the Ceph Cluster software. So you have to follow and run the commands below on all nodes. And make sure that ssh-server is installed on all nodes. - -**Create the Ceph User** - -Create a new user named '**cephuser**' on all nodes. - -useradd -m -s /bin/bash cephuser -passwd cephuser - -After creating the new user, we need to configure **cephuser** for passwordless sudo privileges. This means that 'cephuser' can run and get sudo privileges without having to enter a password first. - -Run the commands below to achieve that. - -echo "cephuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephuser -chmod 0440 /etc/sudoers.d/cephuser -sed -i s'/Defaults requiretty/#Defaults requiretty'/g /etc/sudoers - -**Install and Configure NTP** - -Install NTP to synchronize date and time on all nodes. Run the ntpdate command to set the date and time via NTP. We will use the US pool NTP servers. Then start and enable NTP server to run at boot time. - -sudo apt-get install -y ntp ntpdate ntp-doc -ntpdate 0.us.pool.ntp.org -hwclock --systohc -systemctl enable ntp -systemctl start ntp - -**Install Open-vm-tools -** - -If you are running all nodes inside VMware, you need to install this virtualization utility. - -sudo apt-get install -y open-vm-tools - -**Install Python and parted -** - -In this tutorial, we need python packages for building the ceph-cluster. Install python and python-pip. - -sudo apt-get install -y python python-pip parted - -**Configure the Hosts File** - -Edit the hosts file on all nodes with vim editor. - -vim /etc/hosts - -Paste the configuration below: - -``` -10.0.15.10        ceph-admin -10.0.15.11        mon1 -10.0.15.21        ceph-osd1 -10.0.15.22        ceph-osd2 -10.0.15.23        ceph-osd3 -10.0.15.15        ceph-client -``` - -Save the hosts file and exit the vim editor. - -Now you can try to ping between the server hostnames to test the network connectivity. - -ping -c 5 mon1 - -[ - ![Ceph cluster Installation on Ubuntu 16.04](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/1.png) -][8] - -### Step 2 - Configure the SSH Server - -In this step, we will configure the **ceph-admin node**. The admin node is used for configuring the monitor node and osd nodes. Login to the ceph-admin node and access the '**cephuser**'. - -ssh root@ceph-admin -su - cephuser - -The admin node is used for installing and configuring all cluster node, so the user on the ceph-admin node must have privileges to connect to all nodes without a password. We need to configure password-less SSH access for 'cephuser' on the 'ceph-admin' node. - -Generate the ssh keys for '**cephuser**'. - -ssh-keygen - -Leave passphrase is blank/empty. - -Next, create a configuration file for the ssh config. - -vim ~/.ssh/config - -Paste the configuration below: - -``` -Host ceph-admin -        Hostname ceph-admin -        User cephuser - -Host mon1 -        Hostname mon1 -        User cephuser - -Host ceph-osd1 -        Hostname ceph-osd1 -        User cephuser - -Host ceph-osd2 -        Hostname ceph-osd2 -        User cephuser - -Host ceph-osd3 -        Hostname ceph-osd3 -        User cephuser - -Host ceph-client -        Hostname ceph-client -        User cephuser -``` - -Save the file and exit vim. - -[ - ![Ceph-admin configuration](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/2.png) -][9] - -Change the permission of the config file to 644. - -chmod 644 ~/.ssh/config - -Now add the key to all nodes with the ssh-copy-id command. - -ssh-keyscan ceph-osd1 ceph-osd2 ceph-osd3 ceph-client mon1 >> ~/.ssh/known_hosts -ssh-copy-id ceph-osd1 -ssh-copy-id ceph-osd2 -ssh-copy-id ceph-osd3 -ssh-copy-id mon1 - -Type in your cephuser password when requested. - -[ - ![Ceph-admin deploy ssh key to all cluster nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/3.png) -][10] - -Now try to access the osd1 server from the ceph-admin node to test if the password-less login works. - -ssh ceph-osd1 - -[ - ![SSH Less password from ceph-admin to all nodes cluster](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/4.png) -][11] - -### Step 3 - Configure the Ubuntu Firewall - -For security reasons, we need to turn on the firewall on the servers. Preferably we use Ufw (Uncomplicated Firewall), the default Ubuntu firewall, to protect the system. In this step, we will enable ufw on all nodes, then open the ports needed by ceph-admin, ceph-mon and ceph-osd. - -Login to the ceph-admin node and install the ufw packages. - -ssh root@ceph-admin -sudo apt-get install -y ufw - -Open port 80, 2003 and 4505-4506, then reload firewalld. - -sudo ufw allow 22/tcp -sudo ufw allow 80/tcp -sudo ufw allow 2003/tcp -sudo ufw allow 4505:4506/tcp - -Start and enable ufw to start at boot time. - -sudo ufw enable - -[ - ![UFW Firewall with Ceph service](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/5.png) -][12] - -From the ceph-admin node, login to the monitor node 'mon1' and install ufw. - -ssh mon1 -sudo apt-get install -y ufw - -Open the ports for the ceph monitor node and start ufw. - -sudo ufw allow 22/tcp -sudo ufw allow 6789/tcp -sudo ufw enable - -Finally, open these ports on each osd node: ceph-osd1, ceph-osd2 and ceph-osd3 - port 6800-7300. - -Login to each of the ceph-osd nodes from the ceph-admin, and install ufw. - -ssh ceph-osd1 -sudo apt-get install -y ufw - -Open the ports on the osd nodes and reload firewalld. - -sudo ufw allow 22/tcp -sudo ufw allow 6800:7300/tcp -sudo ufw enable - -The ufw firewall configuration is finished. - -### Step 4 - Configure the Ceph OSD Nodes - -In this tutorial, we have 3 OSD nodes, each of these nodes has two hard disk partitions. - -1. **/dev/sda** for root partition -2. **/dev/sdb** is empty partition - 20GB - -We will use **/dev/sdb** for the ceph disk. From the ceph-admin node, login to all OSD nodes and format the /dev/sdb partition with **XFS** file system. - -ssh ceph-osd1 -ssh ceph-osd2 -ssh ceph-osd3 - -Check the partition scheme with the fdisk command. - -sudo fdisk -l /dev/sdb - -Format the /dev/sdb partition with an XFS filesystem and with a GPT partition table by using the parted command. - -sudo parted -s /dev/sdb mklabel gpt mkpart primary xfs 0% 100% - -Next, format the partition in XFS format with the mkfs command. - -sudo mkfs.xfs -f /dev/sdb - -Now check the partition, and you will see a XFS /dev/sdb partition. - -sudo fdisk -s /dev/sdb -sudo blkid -o value -s TYPE /dev/sdb - -[ - ![Format partition ceph OSD nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/6.png) -][13] - -### Step 5 - Build the Ceph Cluster - -In this step, we will install Ceph on all nodes from the ceph-admin. To get started, login to the ceph-admin node. - -ssh root@ceph-admin -su - cephuser - -**Install ceph-deploy on ceph-admin node** - -In the first step we've already installed python and python-pip on to the system. Now we need to install the Ceph deployment tool '**ceph-deploy**' from the pypi python repository. - -Install ceph-deploy on the ceph-admin node with the pip command. - -sudo pip install ceph-deploy - -Note: Make sure all nodes are updated. - -After the ceph-deploy tool has been installed, create a new directory for the Ceph cluster configuration. - -**Create a new Cluster** - -Create a new cluster directory. - -mkdir cluster -cd cluster/ - -Next, create a new cluster with the '**ceph-deploy**' command by defining the monitor node '**mon1**'. - -ceph-deploy new mon1 - -The command will generate the Ceph cluster configuration file 'ceph.conf' in cluster directory. - -[ - ![Generate new ceph cluster configuration](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/7.png) -][14] - -Edit the ceph.conf file with vim. - -vim ceph.conf - -Under the [global] block, paste the configuration below. - -``` -# Your network address -public network = 10.0.15.0/24 -osd pool default size = 2 -``` - -Save the file and exit the editor. - -**Install Ceph on All Nodes** - -Now install Ceph on all nodes from the ceph-admin node with a single command. - -ceph-deploy install ceph-admin ceph-osd1 ceph-osd2 ceph-osd3 mon1 - -The command will automatically install Ceph on all nodes: mon1, osd1-3 and ceph-admin - The installation will take some time. - -Now deploy the monitor node on the mon1 node. - -ceph-deploy mon create-initial - -The command will create a monitor key, check the key with this ceph command. - -ceph-deploy gatherkeys mon1 - -[ - ![Deploy key ceph](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/8.png) -][15] - -**Adding OSDS to the Cluster** - -After Ceph has been installed on all nodes, now we can add the OSD daemons to the cluster. OSD Daemons will create the data and journal partition on the disk /dev/sdb. - -Check the available disk /dev/sdb on all osd nodes. - -ceph-deploy disk list ceph-osd1 ceph-osd2 ceph-osd3 - -[ - ![disk list of osd nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/9.png) -][16] - -You will see /dev/sdb with the XFS format that we created before. - -Next, delete the partition tables on all nodes with the zap option. - -ceph-deploy disk zap ceph-osd1:/dev/sdb ceph-osd2:/dev/sdb ceph-osd3:/dev/sdb - -The command will delete all data on /dev/sdb on the Ceph OSD nodes. - -Now prepare all OSD nodes and ensure that there are no errors in the results. - -ceph-deploy osd prepare ceph-osd1:/dev/sdb ceph-osd2:/dev/sdb ceph-osd3:/dev/sdb - -When you see the ceph-osd1-3 is ready for OSD use in the result, then the command was successful. - -[ - ![Prepare the ceph-osd nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/10.png) -][17] - -Activate the OSD'S with the command below: - -ceph-deploy osd activate ceph-osd1:/dev/sdb ceph-osd2:/dev/sdb ceph-osd3:/dev/sdb - -Now you can check the sdb disk on OSDS nodes again. - -ceph-deploy disk list ceph-osd1 ceph-osd2 ceph-osd3 - -[ - ![Ceph osds activated](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/11.png) -][18] - -The result is that /dev/sdb has two partitions now: - -1. **/dev/sdb1** - Ceph Data -2. **/dev/sdb2** - Ceph Journal - -Or you check it directly on the OSD node. - -ssh ceph-osd1 -sudo fdisk -l /dev/sdb - -[ - ![Ceph OSD nodes were created](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/12.png) -][19] - -Next, deploy the management-key to all associated nodes. - -ceph-deploy admin ceph-admin mon1 ceph-osd1 ceph-osd2 ceph-osd3 - -Change the permission of the key file by running the command below on all nodes. - -sudo chmod 644 /etc/ceph/ceph.client.admin.keyring - -The Ceph Cluster on Ubuntu 16.04 has been created. - -### Step 6 - Testing Ceph - -In step 4, we've installed and created a new Ceph cluster, and added OSDS nodes to the cluster. Now we should test the cluster to make sure that it works as intended. - -From the ceph-admin node, log in to the Ceph monitor server '**mon1**'. - -ssh mon1 - -Run the command below to check the cluster health. - -sudo ceph health - -Now check the cluster status. - -sudo ceph -s - -You can see results below: - -[ - ![Ceph Cluster Status](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/13.png) -][20] - -Make sure the Ceph health is **OK** and there is a monitor node '**mon1**' with IP address '**10.0.15.11**'. There are **3 OSD** servers and all are **up** and running, and there should be an available disk space of **45GB** - 3x15GB Ceph Data OSD partition. - -We build a new Ceph Cluster on Ubuntu 16.04 successfully. - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/ - -作者:[Muhammad Arul][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/ -[1]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-all-nodes -[2]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-the-ssh-server -[3]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-the-ubuntu-firewall -[4]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-the-ceph-osd-nodes -[5]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-build-the-ceph-cluster -[6]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-testing-ceph -[7]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#reference -[8]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/1.png -[9]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/2.png -[10]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/3.png -[11]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/4.png -[12]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/5.png -[13]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/6.png -[14]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/7.png -[15]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/8.png -[16]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/9.png -[17]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/10.png -[18]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/11.png -[19]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/12.png -[20]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/13.png diff --git a/sources/tech/20170113 Learn The Basics of How Linux IO Redirection Works.md b/sources/tech/20170113 Learn The Basics of How Linux IO Redirection Works.md deleted file mode 100644 index 2f201d7506..0000000000 --- a/sources/tech/20170113 Learn The Basics of How Linux IO Redirection Works.md +++ /dev/null @@ -1,228 +0,0 @@ -Learn The Basics of How Linux I/O (Input/Output) Redirection Works -============================================================ - -One of the most important and [interesting topics under Linux administration][4] is I/O redirection. This feature of the command line enables you to redirect the input and/or output of commands from and/or to files, or join multiple commands together using pipes to form what is known as a “command pipeline”. - -All the commands that we run fundamentally produce two kinds of output: - -1. the command result – data the program is designed to produce, and -2. the program status and error messages that informs a user of the program execution details. - -In Linux and other Unix-like systems, there are three default files named below which are also identified by the shell using file descriptor numbers: - -1. stdin or 0 – it’s connected to the keyboard, most programs read input from this file. -2. stdout or 1 – it’s attached to the screen, and all programs send their results to this file and -3. stderr or 2 – programs send status/error messages to this file which is also attached to the screen. - -Therefore, I/O redirection allows you to alter the input source of a command as well as where its output and error messages are sent to. And this is made possible by the `“<”` and `“>”` redirection operators. - -### How To Redirect Standard Output to File in Linux - -You can redirect standard output as in the example below, here, we want to store the output of the [top command][5]for later inspection: - -``` -$ top -bn 5 >top.log -``` - -Where the flags: - -1. `-b` – enables top to run in batch mode, so that you can redirect its output to a file or another command. -2. `-n` – specifies the number of iterations before the command terminates. - -You can view the contents of `top.log` file using [cat command][6] as follows: - -``` -$ cat top.log -``` - -To append the output of a command, use the `“>>”` operator. - -For instance to append the output of [top command][7] above in the top.log file especially within a script (or on the command line), enter the line below: - -``` -$ top -bn 5 >>top.log -``` - -Note: Using the file descriptor number, the output redirect command above is the same as: - -``` -$ top -bn 5 1>top.log -``` - -### How To Redirect Standard Error to File in Linux - -To redirect standard error of a command, you need to explicitly specify the file descriptor number, `2` for the shell to understand what you are trying to do. - -For example the [ls command][8] below will produce an error when executed by a normal system user without root privileges: - -``` -$ ls -l /root/ -``` - -You can redirect the standard error to a file as below: - -``` -$ 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] - -Redirect Standard Error to File - -In order to append the standard error, use the command below: - -``` -$ ls -l /root/ 2>>ls-error.log -``` - -### How To Redirect Standard Output/ Error To One File - -It is also possible to capture all the output of a command (both standard output and standard error) into a single file. This can be done in two possible ways by specifying the file descriptor numbers: - -1. The first is a relatively old method which works as follows: - -``` -$ ls -l /root/ >ls-error.log 2>&1 -``` - -The command above means the shell will first send the output of the [ls command][10] to the file ls-error.log (using `>ls-error.log`), and then writes all error messages to the file descriptor 2 (standard output) which has been redirected to the file ls-error.log (using `2>&1`). Implying that standard error is also sent to the same file as standard output. - -2. The second and direct method is: - -``` -$ ls -l /root/ &>ls-error.log -``` - -You can as well append standard output and standard error to a single file like so: - -``` -$ ls -l /root/ &>>ls-error.log -``` - -### How To Redirect Standard Input to File - -Most if not all commands get their input from standard input, and by default standard input is attached to the keyboard. - -To redirect standard input from a file other than the keyboard, use the `“<”` operator as below: - -``` -$ cat sort.output -``` - -### How to Use I/O Redirection Using Pipes - -To redirect the output of one command as input of another, you can use pipes, this is a powerful means of building useful command lines for complex operations. - -For example, the command below will [list the top five recently modified files][13]. - -``` -$ ls -lt | head -n 5 -``` - -Here, the options: - -1. `-l` – enables long listing format -2. `-t` – [sort by modification time with the newest files][1] are shown first -3. `-n` – specifies the number of header lines to show - -### Important Commands for Building Pipelines - -Here, we will briefly review two important commands for building command pipelines and they are: - -xargs which is used to build and execute command lines from standard input. Below is an example of a pipeline which uses xargs, this command is used to [copy a file into multiple directories in 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] - -Copy Files to Multiple Directories - -And the options: - -1. `-n 1` – instructs xargs to use at most one argument per command line and send to the [cp command][2] -2. `cp` – copies the file -3. `-v` – [displays progress of copy command][3]. - -For more usage options and info, read through the xargs man page: - -``` -$ man xargs -``` - -A tee command reads from standard input and writes to standard output and files. We can demonstrate how teeworks as follows: - -``` -$ 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 Command Example - -[File or text filters][17] are commonly used with pipes for [effective Linux file operations][18], to process information in powerful ways such as restructuring output of commands (this can be vital for [generation of useful Linux reports][19]), modifying text in files plus several other [Linux system administration tasks][20]. - -To learn more about Linux filters and pipes, read this article [Find Top 10 IP Addresses Accessing Apache Server][21], shows a useful example of using filters and pipes. - -In this article, we explained the fundamentals of I/O redirection in Linux. Remember to share your thoughts via the feedback 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/linux-io-input-output-redirection-operators/ - -作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/aaronkili/ -[1]:http://www.tecmint.com/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/ diff --git a/sources/tech/20170114 Set Date and Time for Each Command You Execute in Bash History.md b/sources/tech/20170114 Set Date and Time for Each Command You Execute in Bash History.md deleted file mode 100644 index a461b43cf9..0000000000 --- a/sources/tech/20170114 Set Date and Time for Each Command You Execute in Bash History.md +++ /dev/null @@ -1,96 +0,0 @@ -Translating by Hymantin -Set Date and Time for Each Command You Execute in Bash History -============================================================ - -By default, all commands executed by Bash on the command line are stored in history buffer or recorded in a file called ~/.bash_history. This means that a system administrator can view a list of commands executed by users on the system or a user can view his/her command history using the [history command][1] like so. - -``` -$ history -``` -[ - ![Linux History Command](http://www.tecmint.com/wp-content/uploads/2017/01/Linux-History-Command.png) -][2] - -Linux History Command - -From the output of the [history command][3] above, the date and time when a command was executed is not shown. This is the default setting on most if not all Linux distributions. - -In this article, we will explain how you can configure time stamp information when each command in the Bash history was executed to be displayed. - -The date and time associated with each history entry can be written to the history file, marked with the history comment character by setting the HISTTIMEFORMAT variable. - -There are two possible ways of doing this: one does it temporarily while the other makes it permanent. - -To set HISTTIMEFORMAT variable temporarily, export it as below on the command line: - -``` -$ export HISTTIMEFORMAT='%F %T' -``` - -In the export command above, the time stamp format: - -1. `%F` – expands to full date same, as %Y-%m-%d (year-month-date). -2. `%T` – expands to time; same as %H:%M:%S (hour:minute:seconds). - -Read through the [date command][4] man page for additional usage information: - -``` -$ man date -``` - -Then check your command history as follows: - -``` -$ 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] - -Display Linux Command History with Date and Time - -However, if you want to configure this variable permanently, open the file `~/.bashrc` with your favorite editor: - -``` -$ vi ~/.bashrc -``` - -And add the line below in it (you mark it with a comment as your own configuration): - -``` -#my config -export HISTTIMEFORMAT='%F %T' -``` - -Save the file and exit, afterwards, run the command below to effect the changes made to the file: - -``` -$ source ~/.bashrc -``` - -That’s all! Do share with us any interesting history command tips and tricks or your thoughts about this guide via the comment section below. - --------------------------------------------------------------------------------- - -作者简介: - -![](http://1.gravatar.com/avatar/7badddbc53297b2e8ed7011cf45df0c0?s=128&d=blank&r=g) - -I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/display-linux-command-history-with-date-and-time/ - -作者:[Ravi Saive][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/admin/ -[1]:http://www.tecmint.com/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 diff --git a/sources/tech/20170116 Getting started with shell scripting.md b/sources/tech/20170116 Getting started with shell scripting.md new file mode 100644 index 0000000000..800e976590 --- /dev/null +++ b/sources/tech/20170116 Getting started with shell scripting.md @@ -0,0 +1,357 @@ +hkurj translating +Getting started with shell scripting +============================================================ + ![Getting started with shell scripting](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/osdc_terminals.png?itok=QmkPW7P1 "Getting started with shell scripting") + +Image by :  + +[ajmexico][1]. Modified by [Jason Baker][2]. [CC BY-SA 2.0][3]. + +The world's best conceptual introduction to shell scripting comes from an old [AT&T training video][4]. In the video, Brian W. Kernighan (the "K" in **awk**) and Lorinda L. Cherry (co-author of **bc**) demonstrate how one of the founding principles of UNIX was to empower users to leverage existing utilities to create complex and customized tools. + +In the words of [Kernighan][5]: "Think of the UNIX system programs basically as [...] building blocks with which you can create things. [...] The notion of pipe-lining is the fundamental contribution of the [UNIX] system; you can take a bunch of programs...and stick them together end to end so that the data flows from the one on the left to the one on the right and the system itself looks after all the connections. The programs themselves don't know anything about the connection; as far as they're concerned, they're just talking to the terminal." + +He's talking about giving everyday users the ability to program. + +The POSIX operating system is, figuratively, an API for itself. If you can figure out how to complete a task in a POSIX shell, then you can automate that task. That's programming, and the main vehicle for this everyday POSIX programming method is the shell script. + +True to its name, the shell _script_ is a line-by-line recipe for what you want your computer to do, just as you would have done it manually. + +Because a shell script consists of common, everyday commands, familiarity with a UNIX or Linux (generically known as **POSIX**) shell is helpful. The more you practice using the shell, the easier it becomes to formulate new scripts. It's like learning a foreign language: the more vocabulary you internalize, the easier it is to form complex sentences. + +When you open a terminal window, you are opening a _shell_. There are several shells out there, and this tutorial is valid for **bash**, **tcsh**, **ksh**, **zsh**, and probably others. In a few sections, I do provide some bash-specific examples, but the final script abandons those, so you can either switch to bash for the lesson about setting variables, or do some simple [syntax adjustment][6]. + +If you're new to all of this, just use **bash**. It's a good shell with lots of friendly features, and the default on Linux, Cygwin, WSL, Mac, and an option on BSD. + +### Hello world + +You can generate your own **hello world** script from a terminal window. Mind your quotation marks; single and double have different effects. + +``` +$ echo "#\!/bin/sh" > hello.sh +$ echo "echo 'hello world' " >> hello.sh +``` + +As you can see, writing a shell script consists, with the exception of the first line, of echoing or pasting commands into a text file. + +To run the script as an application: + +``` +$ chmod +x hello.sh +$ ./hello.sh +hello world +``` + +And that's, more or less, all there is to it! + +Now let's tackle something a little more useful. + +### Despacer + +If there's one thing that confuses the computer and human interaction, it's spaces in file names. You've seen it on the internet: URLs like **http: //example.com/omg%2ccutest%20cat%20photo%21%211.jpg**. Or maybe spaces have tripped you up when running a simple command: + +``` +$ cp llama pic.jpg ~/photos +cp: cannot stat 'llama': No such file or directory +cp: cannot stat 'pic.jpg': No such file or directory +``` + +The solution is to "escape" the space with a backslash, or quotation marks: + +``` +$ touch foo\ bar.txt +$ ls "foo bar.txt" +foo bar.txt +``` + +Those are important tricks to know, but it gets inconvenient, so why not write a script to remove those annoying spaces from file names? + +Create a file to hold the script, starting with a "shebang" (**#!**) to let your system know that the file should run in a shell: + +``` +$ echo '#!/bin/sh' > despace +``` + +Good code starts with documentation. Defining the purpose lets us know what to aim for. Here's a good README: + +``` +despace is a shell script for removing spaces from file names. + +Usage: +$ despace "foo bar.txt" +``` + +Now let's figure out how to do it manually, and build the script as we go. + +Assuming you have a file called "foo bar.txt" in an otherwise empty directory, try this: + +``` +$ ls +hello.sh +foo bar.txt +``` + +Computers are all about input and output. In this case, the input has been a request to **ls** a specific directory. The output is what you would expect: the name of the file in that directory. + +In UNIX, output can be sent as the input of another command through a "pipe." Whatever is on the opposite side of the pipe acts as a sort of filter. The **tr** utility happens to be designed especially to modify strings passed through it; for this task, use the **--delete** option to delete a character defined in quotes. + +``` +$ ls "foo bar.txt" | tr --delete ' ' +foobar.txt +``` + +Now you have just the output you need. + +In the BASH shell, you can store output as a **variable**. Think of a variable as an empty box into which you place information for storage: + +``` +$ NAME=foo +``` + +When you need the information back, you can look in the box by referencing a variable name preceded by a dollar sign (**$**). + +``` +$ echo $NAME +foo +``` + +To get the output of your despacing command and set it aside for later, use a variable. To place the _results_ of a command into a variable, use backticks: + +``` +$ NAME=`ls "foo bar.txt" | tr -d ' '` +$ echo $NAME +foobar.txt +``` + +This gets you halfway to your goal, you have a method to determine the destination filename from the source filename. + +So far, the script looks like this: + +``` +#!/bin/sh + +NAME=`ls "foo bar.txt" | tr -d ' '` +echo $NAME +``` + +The second part of the script must perform the renaming. You probably already now that command: + +``` +$ mv "foo bar.txt" foobar.txt +``` + +However, remember in the script that you're using a variable to hold the destination name. You do know how to reference variables: + +``` +#!/bin/sh + +NAME=`ls "foo bar.txt" | tr -d ' '` +echo $NAME +mv "foo bar.txt" $NAME +``` + +You can try out your first draft by marking it executable and running it in your test directory. Make sure you have a test file called "foo bar.txt" (or whatever you use in your script). + +``` +$ touch "foo bar.txt" +$ chmod +x despace +$ ./despace +foobar.txt +$ ls +foobar.txt +``` + +### Despacer v2.0 + +The script works, but not exactly as your documentation describes. It's currently very specific, and only works on a file called **foo\ bar.txt**, and nothing else. + +A POSIX command refers to itself as **$0** and to anything typed after it, sequentially, as **$1**, **$2**, **$3**, and so on. Your shell script counts as a POSIX command, so try swapping out **foo\ bar.txt** with **$1**. + +``` +#!/bin/sh + +NAME=`ls $1 | tr -d ' '` +echo $NAME +mv $1 $NAME +``` + +Create a few new test files with spaces in the names: + +``` +$ touch "one two.txt" +$ touch "cat dog.txt" +``` + +Then test your new script: + +``` +$ ./despace "one two.txt" +ls: cannot access 'one': No such file or directory +ls: cannot access 'two.txt': No such file or directory +``` + +Looks like you've found a bug! + +The bug is not actually a bug, as such; everything is working as designed, but not how you want it to work. Your script is "expanding" the **$1** variable to exactly what it is: "one two.txt", and along with that comes that bothersome space you're trying to eliminate. + +The answer is to wrap the variable in quotations the same way you wrap filenames in quotes: + +``` +#!/bin/sh + +NAME=`ls "$1" | tr -d ' '` +echo $NAME +mv "$1" $NAME +``` + +Another test or two: + +``` +$ ./despace "one two.txt" +onetwo.txt +$ ./despace c*g.txt +catdog.txt +``` + +This script acts the same as any other POSIX command. You can use it in conjunction with other commands just as you would expect to be able to use any POSIX utility. You can use it in conjunction with a command: + +``` +$ find ~/test0 -type f -exec /path/to/despace {} \; +``` + +Or you can use it as a part of a loop: + +`$ for FILE in ~/test1/* ; do /path/to/despace $FILE ; done` + +and so on. + +### Despacer v2.5 + +The despace script is functional, but technically it could be optimized, and it could use a few usability improvements. + +First of all, the variable is actually not needed. The shell can calculate the required information all in one go. + +POSIX shells have an order of operations. The same way you, in math, solve for statements in brackets first, the shell resolves statements in backticks (**`**), or **$()** in BASH, before executing a command. Therefore, the statement: + +``` +$ mv foo\ bar.txt `ls foo\ bar.txt | tr -d ' '` +``` + +gets transformed into: + +``` +$ mv foo\ bar.txt foobar.txt +``` + +and then the actual **mv** command is performed, leaving us with just **foobar.txt**. + +Knowing this, you can condense the shell script into: + +``` +#!/bin/sh + +mv "$1" `ls "$1" | tr -d ' '` +``` + +That looks disappointingly simple. You might think that reducing it to a one-liner makes the script unnecessary, but shell scripts don't have to have lots of lines to be useful. A script that saves typing even a simple command can still save you from deadly typos, which is especially important when moving files is involved. + +Besides, your script can still use improvement. Additional testing reveals a few weak points. For example, running **despace** with no argument renders an unhelpful error: + +``` +$ ./despace +ls: cannot access '': No such file or directory + +mv: missing destination file operand after '' +Try 'mv --help' for more information. +``` + +These errors are confusing because they're for **ls** and **mv**, but as far as users know, it wasn't **ls** or **mv**, but **despace**, that they ran. + +If you think about it, this little script shouldn't even attempt to rename a file if it didn't get a file as part of the command in the first place, so try using what you know about variables along with the **test** function. + +### If and test + +The **if** statement is what turns your little despace utility from a script into a program. This is serious code territory, but don't worry, it's also pretty easy to understand and use. + +An **if** statement is a kind of switch; if something is true, then you'll do one thing, and if it's false, you'll do something different. This if-then instruction is exactly the kind of binary decision making computers are best at; all you have to do is define for the computer what needs to be true or false and what to do as a result. + +The easiest way you test for True or False is the **test** utility. You don't call it directly, you use its syntax. Try this in a terminal: + +``` +$ if [ 1 == 1 ]; then echo "yes, true, affirmative"; fi +yes, true, affirmative +$ if [ 1 == 123 ]; then echo "yes, true, affirmative"; fi +$ +``` + +That's how **test** works. You have all manner of shorthand to choose from, and the one you'll use is the **-z** option, which detects if the length of a string of characters is zero (0). The idea translates in your despace script as: + +``` +#!/bin/sh + +if [ -z "$1" ]; then + echo "Provide a \"file name\", using quotes to nullify the space." + exit 1 +fi + +mv "$1" `ls "$1" | tr -d ' '` +``` + +The **if** statement is broken into separate lines for readability, but the concept remains: if the data inside the **$1** variable is empty (zero characters are present), then print an error statement. + +Try it: + +``` +$ ./despace +Provide a "file name", using quotes to nullify the space. +$ +``` + +Success! + +Well, actually it was a failure, but it was a _pretty_ failure, and more importantly, a _helpful_ failure. + +Notice the statement **exit 1**. This is a way for POSIX applications to send an alert to the system that it has encountered an error. This capability is important for yourself and for other people who may want to use despace in scripts that depend on despace succeeding in order for everything else to happen correctly. + +The final improvement is to add something to protect the user from overwriting files accidentally. Ideally, you'd pass this option through to the script so that it's optional, but for the sake of simplicity, you'll hard code it. The **-i** option tells **mv** to ask for permission before overwriting a file that already exists: + +``` +#!/bin/sh + +if [ -z "$1" ]; then + echo "Provide a \"file name\", using quotes to nullify the space." + exit 1 +fi + +mv -i "$1" `ls "$1" | tr -d ' '` +``` + +Now your shell script is helpful, useful, and friendly—and you're a programmer, so don't stop now. Learn new commands, use them in your terminal, take note of what you do, and then script it. Eventually, you'll put yourself out of a job, and the rest of your life will be spent relaxing while your robotic minions run shell scripts. + +Happy hacking! + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/penguinmedallion200x200.png?itok=ROQSR50J) + +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/getting-started-shell-scripting + +作者:[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/15587432@N02/3281139507/ +[2]:https://opensource.com/users/jason-baker +[3]:https://creativecommons.org/licenses/by/2.0/ +[4]:https://youtu.be/XvDZLjaCJuw +[5]:https://youtu.be/tc4ROCJYbm0 +[6]:http://hyperpolyglot.org/unix-shells diff --git a/sources/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md b/sources/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md new file mode 100644 index 0000000000..2a0c20b858 --- /dev/null +++ b/sources/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md @@ -0,0 +1,198 @@ +# rusking translating +Setup SysVol Replication Across Two Samba4 AD DC with Rsync – Part 6 +============================================================ + +This topic will cover SysVol replication across two Samba4 Active Directory Domain Controllers performed with the help of a few powerful Linux tools, such as [Rsync file synchronization utility][2], [Cron scheduling daemon][3] and [SSH protocol][4]. + +#### Requirements: + +1. [Join Ubuntu 16.04 as Additional Domain Controller to Samba4 AD DC – Part 5][1] + +### Step 1: Accurate Time Synchronization Across DCs + +1. Before starting to replicate the contents of the sysvol directory across both domain controllers you need to provide an accurate time for these machines. + +If the delay is greater than 5 minutes on both directions and their clocks are not properly in sync, you should start experiencing various problems with AD accounts and domain replication. + +To overcome the problem of time drifting between two or more domain controllers, you need to [install and configure NTP server][5] on your machine by executing the below command. + +``` +# apt-get install ntp +``` + +2. After NTP daemon has been installed, open the main configuration file, comment the default pools (add a # in front of each pool line) and add a new pool which will point back to the main Samba4 AD DC FQDN with NTPserver installed, as suggested on the below example. + +``` +# nano /etc/ntp.conf +``` + +Add following lines to ntp.conf file. + +``` +pool 0.ubuntu.pool.ntp.org iburst +#pool 1.ubuntu.pool.ntp.org iburst +#pool 2.ubuntu.pool.ntp.org iburst +#pool 3.ubuntu.pool.ntp.org iburst +pool adc1.tecmint.lan +# Use Ubuntu's ntp server as a fallback. +pool ntp.ubuntu.com +``` +[ + ![Configure NTP for Samba4](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-NTP-for-Samba4.png) +][6] + +Configure NTP for Samba4 + +3. Don’t close the file yet, move to the bottom of the file and add the following lines in order for other clients to be able to query and [sync the time with this NTP server][7], issuing signed NTP requests, in case the primary DC goes offline: + +``` +restrict source notrap nomodify noquery mssntp +ntpsigndsocket /var/lib/samba/ntp_signd/ +``` + +4. Finally, save and close the configuration file and restart NTP daemon in order to apply the changes. Wait for a few seconds or minutes for the time to synchronize and issue ntpq command in order to print the current summary state of the adc1 peer in sync. + +``` +# systemctl restart ntp +# ntpq -p +``` +[ + ![Synchronize NTP Time with Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Synchronize-Time.png) +][8] + +Synchronize NTP Time with Samba4 AD + +### Step 2: SysVol Replication with First DC via Rsync + +By default, Samba4 AD DC doesn’t perform SysVol replication via DFS-R (Distributed File System Replication) or the FRS (File Replication Service). + +This means that Group Policy objects are available only if the first domain controller is online. If the first DC becomes unavailable, the Group Policy settings and logon scripts will not apply further on Windows machines enrolled into the domain. + +To overcome this obstacle and achieve a rudimentary form of SysVol replication we will schedule a [Linux rsync command][9] combined with a SSH encrypted tunnel with [key-based SSH authentication][10] in order to securely transfer GPO objects from the first domain controller to the second domain controller. + +This method ensures GPO objects consistency across domain controllers, but has one huge drawback. It works only in one direction because rsync will transfer all changes from the source DC to the destination DC when synchronizing GPO directories. + +Objects which no longer exist on the source will be deleted from the destination as well. In order to limit and avoid any conflicts, all GPO edits should be made only on the first DC. + +5. To start the process of SysVol replication, first [generate a SSH key on the first Samba AD DC][11] and transfer the key to the second DC by issuing the below commands. + +Do not use a passphrase for this key in order for the scheduled transfer to run without user interference. + +``` +# ssh-keygen -t RSA +# ssh-copy-id root@adc2 +# ssh adc2 +# exit +``` +[ + ![Generate SSH Key on Samba4 DC](http://www.tecmint.com/wp-content/uploads/2017/01/Generate-SSH-Key.png) +][12] + +Generate SSH Key on Samba4 DC + +6. After you’ve assured that the root user from the first DC can automatically login on the second DC, run the following Rsync command with `--dry-run` parameter in order simulate SysVol replication. Replace adc2accordingly. + +``` +# rsync --dry-run -XAavz --chmod=775 --delete-after --progress --stats /var/lib/samba/sysvol/ root@adc2:/var/lib/samba/sysvol/ +``` + +7. If the simulation process works as expected, run the rsync command again without the `--dry-run` option in order to actually replicate GPO objects across your domain controllers. + +``` +# rsync -XAavz --chmod=775 --delete-after --progress --stats /var/lib/samba/sysvol/ root@adc2:/var/lib/samba/sysvol/ +``` +[ + ![Samba4 AD DC SysVol Replication](http://www.tecmint.com/wp-content/uploads/2017/01/SysVol-Replication-for-Samba4-DC.png) +][13] + +Samba4 AD DC SysVol Replication + +8. After SysVol replication process has finished, login to the destination domain controller and list the contents of one of the GPO objects directory by running the below command. + +The same GPO objects from the first DC should be replicated here too. + +``` +# ls -alh /var/lib/samba/sysvol/your_domain/Policiers/ +``` +[ + ![Verify Samba4 DC SysVol Replication](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-DC-SysVol-Replication.png) +][14] + +Verify Samba4 DC SysVol Replication + +9. To automate the process of Group Policy replication (sysvol directory transport over network), schedule a root job to run the rsync command used earlier every 5 minutes by issuing the below command. + +``` +# crontab -e +``` + +Add rsync command to run every 5 minutes and direct the output of the command, including the errors, to the log file /var/log/sysvol-replication.log .In case something doesn’t work as expected you should consult this file in order to troubleshoot the problem. + +``` +*/5 * * * * rsync -XAavz --chmod=775 --delete-after --progress --stats /var/lib/samba/sysvol/ root@adc2:/var/lib/samba/sysvol/ > /var/log/sysvol-replication.log 2>&1 +``` + +10. Assuming that in future there will be some related issues with SysVol ACL permissions, you can run the following commands in order to detect and repair these errors. + +``` +# samba-tool ntacl sysvolcheck +# samba-tool ntacl sysvolreset +``` +[ + ![Fix SysVol ACL Permissions](http://www.tecmint.com/wp-content/uploads/2017/01/Fix-SysVol-ACL-Permissions.png) +][15] + +Fix SysVol ACL Permissions + +11. In case the first Samba4 AD DC with FSMO role as “PDC Emulator” becomes unavailable, you can force the Group Policy Management Console installed on a Microsoft Windows system to connect only to the second domain controller by choosing Change Domain Controller option and manually selecting the target machine as illustrated below. + +[ + ![Change Samba4 Domain Controller](http://www.tecmint.com/wp-content/uploads/2017/01/Change-Samba4-Domain-Controller.png) +][16] + +Change Samba4 Domain Controller + +[ + ![Select Samba4 Domain Controller](http://www.tecmint.com/wp-content/uploads/2017/01/Select-Samba4-Domain-Controller.png) +][17] + +Select Samba4 Domain Controller + +While connected to the second DC from Group Policy Management Console, you should avoid making any modification to your domain Group Policy. When the first DC will become available again, rsync command will destroy all changes made on this second domain controller. + +-------------------------------------------------------------------------------- + +作者简介: + +![](http://2.gravatar.com/avatar/be16e54026c7429d28490cce41b1e157?s=128&d=blank&r=g) + +I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/samba4-ad-dc-sysvol-replication/ + +作者:[Matei Cezar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/cezarmatei/ +[1]:http://www.tecmint.com/join-additional-ubuntu-dc-to-samba4-ad-dc-failover-replication/ +[2]:http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ +[3]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ +[4]:http://www.tecmint.com/5-best-practices-to-secure-and-protect-ssh-server/ +[5]:http://www.tecmint.com/install-and-configure-ntp-server-client-in-debian/ +[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Configure-NTP-for-Samba4.png +[7]:http://www.tecmint.com/how-to-synchronize-time-with-ntp-server-in-ubuntu-linux-mint-xubuntu-debian/ +[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Synchronize-Time.png +[9]:http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ +[10]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ +[11]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ +[12]:http://www.tecmint.com/wp-content/uploads/2017/01/Generate-SSH-Key.png +[13]:http://www.tecmint.com/wp-content/uploads/2017/01/SysVol-Replication-for-Samba4-DC.png +[14]:http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-DC-SysVol-Replication.png +[15]:http://www.tecmint.com/wp-content/uploads/2017/01/Fix-SysVol-ACL-Permissions.png +[16]:http://www.tecmint.com/wp-content/uploads/2017/01/Change-Samba4-Domain-Controller.png +[17]:http://www.tecmint.com/wp-content/uploads/2017/01/Select-Samba4-Domain-Controller.png diff --git a/sources/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md b/sources/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md new file mode 100644 index 0000000000..a5c3f83f62 --- /dev/null +++ b/sources/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md @@ -0,0 +1,446 @@ +How to Install WordPress with HHVM and Nginx on CentOS 7 +============================================================ + +### On this page + +1. [Step 1 - Configure SELinux and add the Epel Repository][1] +2. [Step 2 - Install Nginx][2] +3. [Step 3 - Install and Configure MariaDB][3] +4. [Step 4 - Install HHVM][4] +5. [Step 5 - Configure HHVM][5] +6. [Step 6 - Configure HHVM and Nginx][6] +7. [Step 7 - Create a Virtual Host with HHVM and Nginx][7] +8. [Step 8 - Install WordPress][8] +9. [Reference][9] + +HHVM (HipHop Virtual Machine) is an open source virtual machine for executing programs written in PHP and Hack language. HHVM has been developed by Facebook, it provides most features of the current PHP 7 version. To run HHVM on your server, you can use a FastCGI to connect HHVM with a Nginx or Apache web server, or you can use the web server built into HHVM called "Proxygen". + +In this tutorial, I will show you how to install WordPress with HHVM and Nginx as web server. I will use CentOS 7 as the operating system, so basic knowledge of CentOS is required. + +**Prerequisite** + +* CentOS 7 - 64bit +* Root privileges + +### Step 1 - Configure SELinux and add the Epel Repository + +In this tutorial, we will use SELinux in enforcing mode, so we need the SELinux management tools installed on the system. We will use setools and setrobleshoot to manage SELinux policies. + +By default, SELinux is enabled on CentOS 7, We can check that for with command below: + +sestatus +getenforce + +[ + ![Check SELinux](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/1.png) +][10] + +You can see SELinux is enabled with enforcing mode. + +Next, Install setools and setroubleshoot with the yum command. + +yum -y install setroubleshoot setools net-tools + +When the installation has been completed, you can install the EPEL repository. + +yum -y install epel-release + +### Step 2 - Install Nginx + +Nginx or engine-x is a lightweight web server with high performance and low memory consumption. On CentOS, we can use yum to install the Nginx packages. Make sure you are logged in as root user! + +Install nginx with this yum command from the CentOS repository: + +yum -y install nginx + +Now start Nginx and enable it to be started at boot time with the systemctl command: + +systemctl start nginx +systemctl enable nginx + +To ensure Nginx is running on our server, visit the server IP address with your browser, or use the curl command as shown below to get the results: + +curl 192.168.1.110 + +I'll cehck it with my web browser here: + +[ + ![Nginx is running](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/2.png) +][11] + +### Step 3 - Install and Configure MariaDB + +MariaDB is an open source database developed by the original MySQL developer Monty Widenius, it has been forked from the MySQL database but stays compatible with it in its major functions. In this step, we will install MariaDB and configure the root password for the MariaDB database. Then we will create a new database and new user that are required for our WordPress installation. + +Install mariadb and mariadb-server: + +yum -y install mariadb mariadb-server + +Start MariaDB and add the service to be automatically started at boot time: + +systemctl start mariadb +systemctl enable mariadb + +MariaDB has been started, and now we have to configure the root password for the mariadb/mysql database. Type in the command below to setup the MariaDB root password. + +mysql_secure_installation + +Type in your new password for the MariaDB root user when requested. + +Set root password? [Y/n] Y +New password: +Re-enter new password: + +Remove anonymous users? [Y/n] Y + ... Success! +Disallow root login remotely? [Y/n] Y + ... Success! +Remove test database and access to it? [Y/n] Y +Reload privilege tables now? [Y/n] Y + ... Success! + +The MariaDB root password has been configured. Now login to the MariaDB/MySQL shell and create a new database **"wordpressdb"** and a new user **"wpuser"** with password **"wpuser@"** for our WordPress installation. Choose a secure password for your installation! + +Login to the MariaDB/MySQL shell: + +mysql -u root -p +TYPE YOUR PASSWORD + +Create a new database and new user: + +create database wordpressdb; +create user wpuser@localhost identified by 'wpuser@'; +grant all privileges on wordpressdb.* to wpuser@localhost identified by 'wpuser@'; +flush privileges; +\q + +[ + ![Create Database for Wordpress Installation on MariaDB](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/3.png) +][12] + +MariaDB has been installed and the new database for our WordPress installation has been created. + +### Step 4 - Install HHVM + +For the HHVM installation, we need to install many dependencies. We can install HHVM from source by downloading the source from github, or installing prebuilt packages that are available on the internet. In this tutorial, I will install HHVM from prebuilt packages. + +Install the dependencies for the HHVM installation + +yum -y install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc,numactl}-devel \ +{ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \ +lib{xslt,event,yaml,vpx,png,zip,icu,mcrypt,memcached,cap,dwarf}-devel \ +{unixODBC,expat,mariadb}-devel lib{edit,curl,xml2,xslt}-devel \ +glog-devel oniguruma-devel ocaml gperf enca libjpeg-turbo-devel openssl-devel \ +mariadb mariadb-server libc-client make + +Then install the HHVM prebuilt packages from [this site][13] with the rpm command. + +rpm -Uvh http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/hhvm-3.15.2-1.el7.centos.x86_64.rpm +ln -s /usr/local/bin/hhvm /bin/hhvm + +HHVM has been installed, check it with the command below: + +hhvm --version + +In order to use the php command, we can set the hhvm command as php. So when you type 'php' on the shell, you will see the same result as from the hhvm command. + +sudo update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60 +php --version + +[ + ![Installing HHVM on CentOS](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/4.png) +][14] + +### Step 5 - Configure HHVM + +In this step, we will configure HHVM. We will run hhvm as a systemd service. Instead of running it on a system port, we will run hhvm on a unix socket file which is faster. + +Go to the systemd directory and create the hhvm.service file. + +cd /etc/systemd/system/ +vim hhvm.service + +Paste the service configuration belowinto that file. + +``` +[Unit] +Description=HHVM HipHop Virtual Machine (FCGI) +After=network.target nginx.service mariadb.service + +[Service] +ExecStart=/usr/local/bin/hhvm --config /etc/hhvm/server.ini --user nginx --mode daemon -vServer.Type=fastcgi -vServer.FileSocket=/var/run/hhvm/hhvm.sock + +[Install] +WantedBy=multi-user.target +``` + +Save the file and exit vim. + +Next, go to the hhvm directory and edit the server.ini file. + +cd /etc/hhvm/ +vim server.ini + +Replace the hhvm.server.port on line 7 with unix socket configuration below: + +hhvm.server.file_socket = /var/run/hhvm/hhvm.sock + +Save the file and exit th editor. + +In the hhvm service file, we've defined that hhvm is running under the 'nginx' user, so we must change the owner of the socket file directory to the 'nginx' user. Then we must change the SELinux context of the hhvm directoryto allow access to the socket file. + +chown -R nginx:nginx /var/run/hhvm/ +semanage fcontext -a -t httpd_var_run_t "/var/run/hhvm(/.*)?" +restorecon -Rv /var/run/hhvm + +After rebooting the server, hhvm will not be running because there is no directory for the socket file, so we must create it automatically at the boot time. + +Edit the rc.local file with vim. + +vim /etc/rc.local + +Paste configuration below to the end of line. + +``` +mkdir -p /var/run/hhvm/ +chown -R nginx:nginx /var/run/hhvm/ +semanage fcontext -a -t httpd_var_run_t "/var/run/hhvm(/.*)?" +restorecon -Rv /var/run/hhvm +``` + +Save the file and exit vim. Make the file executable. + +chmod +x /etc/rc.local + +Reload the systemd service, start hhvm and add it to be started at boot time. + +systemctl daemon-reload +systemctl start hhvm +systemctl enable hhvm + +Make sure that there is no error. Check that hhvm is running under the socket file with the netstat command. + +netstat -pl | grep hhvm + +[ + ![Check the HHVM socket file](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/5.png) +][15] + +### Step 6 - Configure HHVM and Nginx + +In this step, we will configure HHVM to run with the Nginx web server. We need to create a new hhvm configuration file in the Nginx directory. + +Go to the /etc/nginx directory and create a hhvm.conf file. + +cd /etc/nginx/ +vim hhvm.conf + +Paste the configuration below: + +``` +location ~ \.(hh|php)$ { +    root /usr/share/nginx/html; +    fastcgi_keep_conn on; +    fastcgi_pass unix:/var/run/hhvm/hhvm.sock; +    fastcgi_index  index.php; +    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name; +    include        fastcgi_params; +} +``` + +Save and exit. + +Next, edit the nginx.conf file and add the hhvm configuration include line. + +vim nginx.conf + +Add the configuration to the server directive line 57. + +``` +include /etc/nginx/hhvm.conf; +``` + +Save and exit. + +Then change the SELinux context of the hhvm configuration file. + +semanage fcontext -a -t httpd_config_t /etc/nginx/hhvm.conf +restorecon -v /etc/nginx/hhvm.conf + +Test the Nginx configuration and restart the service. + +nginx -t +systemctl restart nginx + +Make sure there is no error. + +### Step 7 - Create a Virtual Host with HHVM and Nginx + +In this step, we will create a new virtual host configuration with Nginx and hhvm. I will use the domain name **"natsume.co"** for this example. Please use your own domain name and replace it in the configuration files and WordPress installation wherever it appears. + +Go to the nginx conf.d directory where we will store virtual host file: + +cd /etc/nginx/conf.d/ + +Create the new configuration "natsume.conf" with vim: + +vim natsume.conf + +Paste the virtual host configuration below: + +``` +server { + listen 80; + server_name natsume.co; + + # note that these lines are originally from the "location /" block + root /var/www/hakase; + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ =404; + } + error_page 404 /404.html; + location = /50x.html { + root /var/www/hakase; + } + + location ~ \.php$ { + try_files $uri =404; + fastcgi_pass unix:/var/run/hhvm/hhvm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} +``` + +Save and exit. + +In our virtual host configuration, we've defined the web root directory for the domain name to be the "/var/www/hakase" directory. That directory does not exist yet, so we have to create it and change the ownership to the nginx user and group. + +mkdir -p /var/www/hakase +chown -R nginx:nginx /var/www/hakase + +Next, configure the SELinux context for the file and directory. + +semanage fcontext -a -t httpd_config_t "/etc/nginx/conf.d(/.*)?" +restorecon -Rv /etc/nginx/conf.d + +Finally, test the nginx configuration to ensure there is no error, then restart nginx: + +nginx -t +systemctl restart nginx + +### Step 8 - Install WordPress + +In step 5 we've created the virtual host configuration for our WordPress installation. Now we just have to download WordPress and edit the database configuration by using the database and user that we've created in step 3. + +Go to the web root directory "/var/www/hakase"  and download WordPress with the wget command: + +cd /var/www/hakase +wget wordpress.org/latest.tar.gz + +Extract "latest.tar.gz"  and move all WordPress files and directories to the current directory: + +tar -xzvf latest.tar.gz +mv wordpress/* . + +Next, copy "wp-config-sample.php" file to "wp-config.php" and edit it with vim: + +cp wp-config-sample.php wp-config.php +vim wp-config.php + +Set DB_NAME to **"wordpressdb"**, DB_USER to **"wpuser"** and DB_PASSWORD to **"wpuser@"**. + +``` +define('DB_NAME', 'wordpressdb'); +define('DB_USER', 'wpuser'); +define('DB_PASSWORD', 'wpuser@'); +define('DB_HOST', 'localhost'); +``` + +Save and exit. + +[ + ![WordPress Configuration](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/6.png) +][16] + +Change the SELinux context for the WordPress directory. + +semanage fcontext -a -t httpd_sys_content_t "/var/www/hakase(/.*)?" +restorecon -Rv /var/www/hakase + +Now open a web browser and type in the domain name of your wordpress domain into the address bar, mine is "natsume.co". + +Choose English language and click on 'Continue'. + +[ + ![Wordpress Installation - Choose language](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/7.png) +][17] + +Fill in the site title and description with your info and click "Install Wordpress". + +[ + ![Wordpress Installation - Configure Admin and Site Title](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/8.png) +][18] + +Wait until the installation is finished. You will see the page below, click on "Log In" to log in to the WordPress admin dashboard: + +[ + ![Wordpress Install - Installation Success with HHVM Nginx on CentOS 7](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/9.png) +][19] + +Type in your admin user and password, then click "Log In" again. + +[ + ![Login to wordpress admin dashboard](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/10.png) +][20] + +Now you're on the WordPress admin dashboard. + +[ + ![Wordpress Admin Dashboard](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/11.png) +][21] + +Wordpress Home Page. + +[ + ![Wordpress Home Page Default](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/12.png) +][22] + +Wordpress with Nginx and HHVM on CentOS 7 has been installed successfully. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/ + +作者:[ Muhammad Arul][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/ +[1]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-configure-selinux-and-add-the-epel-repository +[2]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-install-nginx +[3]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-install-and-configure-mariadb +[4]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-install-hhvm +[5]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-configure-hhvm +[6]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-configure-hhvm-and-nginx +[7]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-create-a-virtual-host-with-hhvm-and-nginx +[8]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#step-install-wordpress +[9]:https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/#reference +[10]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/1.png +[11]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/2.png +[12]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/3.png +[13]:http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/ +[14]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/4.png +[15]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/5.png +[16]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/6.png +[17]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/7.png +[18]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/8.png +[19]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/9.png +[20]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/10.png +[21]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/11.png +[22]:https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/big/12.png diff --git a/sources/tech/20170117 The Age of the Unikernel- 10 Projects to Know.md b/sources/tech/20170117 The Age of the Unikernel- 10 Projects to Know.md new file mode 100644 index 0000000000..45cf389712 --- /dev/null +++ b/sources/tech/20170117 The Age of the Unikernel- 10 Projects to Know.md @@ -0,0 +1,94 @@ +The Age of the Unikernel: 10 Projects to Know +============================================================ + + ![unikernels](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/unikernels_0.jpg?itok=r9sGHEL0 "unikernels") +A unikernel is essentially a pared-down operating system that can pair with an application into a unikernel application, typically running within a virtual machine. Download the Guide to the Open Cloud to learn more.[Creative Commons Zero][1]Pixabay + +When it comes to operating systems, container technologies, and unikernels, the trend toward tiny continues. What is a unikernel? It is essentially a pared-down operating system (the unikernel) that can pair with an application into a unikernel application, typically running within a virtual machine. They are sometimes called library operating systems because they include libraries that enable applications to use hardware and network protocols in combination with a set of policies for access control and isolation of the network layer. + +Containers often come to mind when discussion turns to cloud computing and Linux, but unikernels are doing transformative things, too. Neither containers nor unikernels are brand new. There were unikernel-like systems in the 1990s such as Exokernel, but today popular unikernels include MirageOS and OSv. Unikernel applications can be used independently and deployed across heterogeneous environments. They can facilitate specialized and isolated services and have become widely used for developing applications within a microservices architecture. + +As an example of how unikernels are attracting attention, consider the fact that Docker purchased[ Cambridge-based Unikernel Systems][3], and has been working with unikernels in numerous scenarios. + +Unikernels, like container technologies, strip away non-essentials and thus they have a very positive impact on application stability and availability, as well as security. They are also attracting many of the top, most creative developers on the open source scene. + +The Linux Foundation recently[ announced][4] the release of its 2016 report[Guide to the Open Cloud: Current Trends and Open Source Projects.][5] This third annual report provides a comprehensive look at the state of open cloud computing and includes a section on unikernels. You can[ download the report][6] now. It aggregates and analyzes research, illustrating how trends in containers, unikernels, and more are reshaping cloud computing. The report provides descriptions and links to categorized projects central to today’s open cloud environment. + +In this series of articles, we are looking at the projects mentioned in the guide, by category, providing extra insights on how the overall category is evolving. Below, you’ll find a list of several important unikernels and the impact that they are having, along with links to their GitHub repositories, all gathered from the Guide to the Open Cloud: + +[CLICKOS][7] + +ClickOS is NEC’s high-performance, virtualized software middlebox platform for network function virtualization (NFV) built on top of MiniOS/ MirageOS. [ClickOS on GitHub][8] + +[CLIVE][9] + +Clive is an operating system written in Go and designed to work in distributed and cloud computing environments. + +[HALVM][10] + +The Haskell Lightweight Virtual Machine (HaLVM) is a port of the Glasgow Haskell Compiler toolsuite that enables developers to write high-level, lightweight virtual machines that can run directly on the Xen hypervisor. [HaLVM on GitHub][11] + +[INCLUDEOS][12] + +IncludeOS is a unikernel operating system for C++ services running in the cloud. It provides a bootloader, standard libraries and the build- and deployment system on which to run services. Test in VirtualBox or QEMU, and deploy services on OpenStack. [IncludeOS on GitHub][13] + +[LING][14] + +Ling is an Erlang platform for building super-scalable clouds that runs directly on top of the Xen hypervisor. It runs on only three external libraries — no OpenSSL — and the filesystem is read-only to remove the majority of attack vectors. [Ling on GitHub][15] + +[MIRAGEOS][16] + +MirageOS is a library operating system incubating under the Xen Project at The Linux Foundation. It uses the OCaml language to construct unikernels for secure, high-performance network applications across a variety of cloud computing and mobile platforms. Code can be developed on a normal OS such as Linux or MacOS X, and then compiled into a fully-standalone, specialised unikernel that runs under the Xen hypervisor.[ MirageOS on GitHub][17] + +[OSV][18] + +OSv is the open source operating system from Cloudius Systems designed for the cloud. It supports applications written in Java, Ruby (via JRuby), JavaScript (via Rhino and Nashorn), Scala, and others. And it runs on the VMware, VirtualBox, KVM, and Xen hypervisors. [OSv on GitHub][19] + +[RUMPRUN][20] + +Rumprun is a production-ready unikernel that uses the drivers offered by rump kernels, adds a libc and an application environment on top, and provides a toolchain with which to build existing POSIX-y applications as Rumprun unikernels. It works on KVM and Xen hypervisors and on bare metal and supports applications written in C, C++, Erlang, Go, Java, Javascript (Node.js), Python, Ruby, Rust, and more. [Rumprun on GitHub][21] + +[RUNTIME.JS][22] + +Runtime.js is an open source library operating system (unikernel) for the cloud that runs JavaScript, can be bundled up with an application and deployed as a lightweight and immutable VM image. It’s built on V8 JavaScript engine and uses event-driven and non- blocking I/O model inspired by Node.js. KVM is the only supported hypervisor. [Runtime.js on GitHub][23] + +[UNIK][24] + +Unik is EMC’s tool for compiling application sources into unikernels (lightweight bootable disk images) rather than binaries. It allows applications to be deployed securely and with minimal footprint across a variety of cloud providers, embedded devices (IoT), as well as a developer laptop or workstation. It supports multiple unikernel types, processor architectures, hypervisors and orchestration tools including Cloud Foundry, Docker, and Kubernetes. [Unik on GitHub][25] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/open-cloud-report/2016/guide-open-cloud-age-unikernel + +作者:[SAM DEAN][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/sam-dean +[1]:https://www.linux.com/licenses/category/creative-commons-zero +[2]:https://www.linux.com/files/images/unikernelsjpg-0 +[3]:http://www.infoworld.com/article/3024410/application-virtualization/docker-kicks-off-unikernel-revolution.html +[4]:https://www.linux.com/blog/linux-foundation-issues-2016-guide-open-source-cloud-projects +[5]:http://ctt.marketwire.com/?release=11G120876-001&id=10172077&type=0&url=http%3A%2F%2Fgo.linuxfoundation.org%2Frd-open-cloud-report-2016-pr +[6]:http://go.linuxfoundation.org/l/6342/2016-10-31/3krbjr +[7]:http://cnp.neclab.eu/clickos/ +[8]:https://github.com/cnplab/clickos +[9]:http://lsub.org/ls/clive.html +[10]:https://galois.com/project/halvm/ +[11]:https://github.com/GaloisInc/HaLVM +[12]:http://www.includeos.org/ +[13]:https://github.com/hioa-cs/IncludeOS +[14]:http://erlangonxen.org/ +[15]:https://github.com/cloudozer/ling +[16]:https://mirage.io/ +[17]:https://github.com/mirage/mirage +[18]:http://osv.io/ +[19]:https://github.com/cloudius-systems/osv +[20]:http://rumpkernel.org/ +[21]:https://github.com/rumpkernel/rumprun +[22]:http://runtimejs.org/ +[23]:https://github.com/runtimejs/runtime +[24]:http://dojoblog.emc.com/unikernels/unik-build-run-unikernels-easy/ +[25]:https://github.com/emc-advanced-dev/unik diff --git a/sources/tech/20170117 This Script Updates Hosts Files Using a Multi-Source Unified Block List With Whitelisting.md b/sources/tech/20170117 This Script Updates Hosts Files Using a Multi-Source Unified Block List With Whitelisting.md new file mode 100644 index 0000000000..be6c824f9f --- /dev/null +++ b/sources/tech/20170117 This Script Updates Hosts Files Using a Multi-Source Unified Block List With Whitelisting.md @@ -0,0 +1,88 @@ +This Script Updates Hosts Files Using a Multi-Source Unified Block List With Whitelisting +============================================================ + + ![](https://irp-cdn.multiscreensite.com/58a25abc/dms3rep/multi/desktop/host-400x300.jpg) + +There are many helpful lists maintained online with constantly-updated hosts files that contain the domains of various Internet crap peddlers. Copying these lists into your hosts file can easily block a large number of domains that your system would be better off unable to connect to. This method works without installing a browser plug-in and will handle blocking for any browser (and any other program) on the system. + +In this tutorial, I'll show you how to get Steven Black's [Unified Hosts script][1] up and running in Linux. The script will keep your computer's hosts file updated (from multiple sources) with the latest known ad servers, phishing sites and other web scum, all while providing a nice, clean way to manage your own black/whitelists separately from the lists the script manages. + +There are two caveats to note before putting 30,000 domains into your hosts file. First off, these huge lists contain servers that you might need unblocked in order to make an online purchase or for some other temporary situation. You'll know you have a problem when something on the web is broken since you messed with your hosts file. To remedy this, I'm going to show you how to make a handy on/off switch so you can quickly disable your blocklist to buy that Himalayan salt lamp (it's the ions). I still consider it a feature of these lists that all manner of things get blocked (it was only annoying until I thought of making that off switch). If you have a repeat problem with a blocked server that you need often, just add it to your whitelist file and you're all set. + +The second problem is a slight performance hit because the system has to check the entire list each time a domain is called up. Maybe there's a small hit, but not big enough for me to ditch the list and let every connection through. However, consider yourself warned. + +Hosts files block a server by directing requests to that server to either 127.0.0.1 or 0.0.0.0 - in other words, nowhere. Some say using zero's is a faster, less problematic way to accomplish the blocking. You can configure the script to use any blocking ip you want by executing it with the --ip option like "--ip nnn.nnn.nnn.nnn", but the default is 0.0.0.0 and that's where I'm leaving it. + +I used to do what Steven's script does by hand every once in a while, going to each site, copy/pasting their lists into my hosts file, doing a find-replace to change the one-twenty-seven's to zeros, etc. I knew the whole thing could be automated and there were tons of dupes, but I never took the time to address the problems. Since finding this script, that's now a forgotten chore. + +Let's start by getting a fresh copy of Mr. Black's code downloaded (~150MB) so we can push some electrons around. You'll need git installed, so if it's not, go to the terminal and enter: + +**sudo apt-get install git**  + +After it's done installing, enter: + +**mkdir unifiedhosts**  +**cd unifiedhosts**  +**git clone** [**https://github.com/StevenBlack/hosts.git** ][2] +**cd hosts**  + +While your cursor blinks at Steven's script, let's talk about choices. The script has a few options and extensions that I wont cover here, but I figure if you got this far and you're interested, the [readme.md][3] file can tell you all you need to know. + +You need python installed to run the script, and which version you have matters. To find the version of Python you have, enter: + +**python --version**  + +If you don't have python installed: + +**sudo apt-get install python**  + +For Python 2.7, execute the script by entering "python" as I do below. For Python 3, replace "python" in the command with "python3". Upon execution, the script makes sure it has the most recent version of each list and if not, grabs a new copy. It then writes a new hosts file, including anything in your black/whitelists. Let's give it a try using the -r option to replace our active hosts file and the -a option so the script wont ask any questions. Back to the terminal, and: + +**python updateHostsFile.py -r -a**  + +The command will ask for your password so it can write to /etc/. For the newly updated list to be active, some systems require a good flush of the DNS cache. On the same hardware, I've observed different operating systems express very different behavior regarding the length of time it takes for a server to become reachable/unreachable after updating the hosts file without a flush. I've seen everything from instantaneously (Slackware) to never/reboot (Windows). There are commands to flush the DNS cache, but they're different on each OS and even each distro, so just reboot if the changes don't take. + +Now it's as simple as adding your personal exceptions to the black/whitelist files and running the script whenever you want to update the hosts file. The script will adjust the resultant hosts file according to your specs, appending the file with your additions automatically each time you run it. + +Finally, let's create the on/off switches. We need a script for each function, so go back to the terminal to create the OFF switch by entering (replacing leafpad with your text editor): + +**leafpad hosts-off.sh**  + +and enter the following into the new file: + +**#!/bin/sh**  +**sudo mv /etc/hosts /etc/hostsDISABLED**  + +And then make it executable with: + +**chmod +x hosts-off.sh**  + +Similarly, for the ON switch: + +**leafpad hosts-on.sh +** +and enter the following into the new file: + +**#!/bin/sh**  +**sudo mv /etc/hostsDISABLED /etc/hosts +** +And finally make it executable with: + +**chmod +x hosts-on.sh + +**All you need to do is create a shortcut somewhere for each script, labeling them HOSTS-ON and HOSTS-OFF and there you have it. + +-------------------------------------------------------------------------------- + +via: https://www.darrentoback.com/this-script-updates-hosts-files-using-a-multi-source-unified-block-list-with-whitelisting + +作者:[dmt][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.darrentoback.com/about-me +[1]:https://github.com/StevenBlack/hosts +[2]:https://github.com/StevenBlack/hosts.git +[3]:https://github.com/StevenBlack/hosts/blob/master/readme.md diff --git a/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md b/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md new file mode 100644 index 0000000000..77847d9b67 --- /dev/null +++ b/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md @@ -0,0 +1,80 @@ +10 reasons to use Cinnamon as your Linux desktop environment +============================================================ + +### Cinnamon is a Linux desktop environment reminiscent of GNOME 2 that offers flexibility, speed, and a slew of features. + + ![10 reasons to use Cinnamon as your Linux desktop environment](https://opensource.com/sites/default/files/styles/image-full-size/public/cinnamon.jpg?itok=rPZvjqGr "10 reasons to use Cinnamon as your Linux desktop environment") +Image credits :  + +[Sam Mugraby][1], Photos8.com. [CC BY 2.0][2]. + +Recently I installed Fedora 25, and found that the current version of [KDE][3] Plasma was unstable for me; it crashed several times a day before I decided to try to try something different. After installing a number of alternative desktops and trying them all for a couple hours each, I finally settled on using Cinnamon until Plasma is patched and stable. Here's what I found. + +### Introducing Cinnamon + +In 2011, GNOME 3, with the new GNOME Shell was released and the new interface immediately generated both positive and negative responses. Many users and developers liked the original GNOME interface enough that multiple groups forked it and one of those forks was Cinnamon. + +One of the reasons behind the development of the GNOME shell for GNOME 3 was that many components of the original GNOME user interface were no longer being actively developed. This was also an issue for Cinnamon and some of the other forked GNOME projects. The Linux Mint project was one of the prime movers for Cinnamon because GNOME is the official desktop environment for Mint. The Mint developers have continued to develop Cinnamon to the point where GNOME itself is no longer required, and Cinnamon is a completely independent desktop environment that retains many of the interface features that users appreciated about the GNOME interface. + + ![cinnamon-desktop-environment.jpg](https://opensource.com/sites/default/files/images/life-uploads/cinnamon-desktop-environment.jpg) + +Figure 1: The default Cinnamon desktop with the System Settings tool open. + +Cinnamon 3.2 is the current release version. Cinnamon is available for many distros besides Mint, including Fedora, Arch, Gentoo, Debian, and OpenSUSE, among others. + +### Reasons for using Cinnamon + +Here are my top 10 reasons for using Cinnamon. + +1. **Integration.** The choice of a desktop has not been contingent upon the availability of applications written for it in a long time. All of the applications I use, regardless of the desktop for which they were written, will run just fine on any other desktop, and Cinnamon is no exception. All of the libraries required to run applications written for KDE, GNOME—or any other desktop that I use—are available and make using any application with the Cinnamon desktop a seamless experience. + +2. **Looks.** Let's face it, looks are important. Cinnamon has a crisp, clean look that uses easy to read fonts and color combinations. The desktop is not hampered by unnecessary clutter, and you can configure which icons are shown on the desktop using the **System Settings => Desktop** menu. This menu also allows you to specify whether the desktop icons are shown only on the primary monitor, only on secondary monitors, or on all monitors. + +3. **Desklets.** Desklets are small, usually single-purpose applications that can be added to your desktop. Only a few of these are available, but you can choose from things like CPU or disk monitors, a weather app, sticky notes, a desktop photo frame app, and time and date, among others. I like the time and date desklet because it is easier to read than the applet in the Cinnamon panel. + +4. **Speed.** Cinnamon is fast and snappy. Programs load and display fast. The desktop itself loads quickly during login, though this is just my subjective experience and is not based on any timed testing. + +5. **Configuration. **Cinnamon is not as configurable as KDE Plasma, but it is much more configurable than I originally thought the first time I tried it. The Cinnamon Control Center provides centralized access to many of the desktop configuration options. It has a main window from which the specific feature configuration windows can be launched. It is easy to select a new look from those available in the Themes section of System Settings. You can choose window borders, icons, controls, pointers, and the desktop basic scheme. Other choices include fonts and backgrounds. I find many of these configuration tools among the best I have encountered. A modest number of desktop themes are available, providing the ability to significantly alter the look of the desktop without the confusion of the massive numbers of choices that KDE provides. + +6. **The Cinnamon Panel. **The Cinnamon Panel, i.e., the toolbar, is initially configured very simply. It contains the menu used to launch programs, a basic system tray, and an application selector. The panel is easy to configure and adding new program launchers is simply a matter of locating the program you want to add in the main Menu; right click on the program icon and select "Add to panel." You can also add the launcher icon to the desktop itself, and to the Cinnamon "Favorites" launcher bar. You can also enter the panel's **Edit** mode and rearrange the icons. + +7. **Flexibility****.** It can sometimes be difficult to locate a minimized or hidden running application and finding it on the toolbar application selector can be challenging if there are a number of running applications. In part, this is because the applications are not always in a sequence on the selector that makes them easy to find. So one of my favorite features is the ability to drag the buttons for the running applications and rearrange them on the selector. This can make it much easier to find and display windows belonging to applications because they can now be where I put them on the selector. + + The Cinnamon desktop also has a very nice pop-up menu that you can access with a right click. This menu has selections for some frequently used tasks such as accessing the Desktop Settings and adding Desklets, as well as other desktop-related tasks. + + One of these other menu items is “Create New Document” which uses the document templates located in the ~/Templates directory and lists each of them. Simply click on the template you want to use and a new document using that template is created using the default office application. In my case, that is LibreOffice. + +8. **Multiple ****workspaces****.** Cinnamon offers multiple desktops like many other desktop environments. Cinnamon calls these "workspaces." The workspace selector is located on the Cinnamon panel and shows the outlines of the windows located on each workspace. Windows can be moved between workspaces or assigned to all. I did find that the workspace selector is sometimes a bit slow to catch up with the display of window locations so I switched the workspace selector to show the workspace numbers and not shadows of the windows in the workspaces. + +9. **Nemo.** Most desktops use their own preferred default applications for various purposes and Cinnamon is no exception. My preferred desktop file manager is Krusader, but Cinnamon uses Nemo as its default, so I just went with that for the duration of my test. I find that I like Nemo—a lot. It has a nice clean interface and most of the features I like and use frequently. It is easy to use while being flexible enough for my needs. Although Nemo is a fork of Nautilus, I find Nemo to be better integrated into the Cinnamon environment. The Nautilus interface seems to be somewhat poorly integrated and discordant with Cinnamon. + +10. **Stability.** Cinnamon is very stable and just works. + +### Conclusions + +Cinnamon is a fork of the GNOME 3 desktop and appears to be intended as the GNOME desktop that never was. Its development seems to be the logical improvements that the Cinnamon developers thought were needed to improve and extend GNOME while retaining its unique and highly appreciated personality. It is no longer GNOME 3—it is different and better. Cinnamon looks good and it works very well for me and is a very nice change from KDE—which I still like very much. It took me a few days to learn how Cinnamon's differences could make my desktop experience better, and I am very glad to have learned a lot more about an excellent desktop. + +Though I like Cinnamon, I would like to experiment with some others as well, and I am now going to switch to the LXDE desktop and try that out for a few weeks. I will share my experience with LXDE after I have spent some time using it. + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/david-crop.jpg?itok=oePpOpyV) + +David Both is a Linux and Open Source advocate who resides in Raleigh, North Carolina. He has been in the IT industry for over forty years and taught OS/2 for IBM where he worked for over 20 years. While at IBM, he wrote the first training course for the original IBM PC in 1981. He has taught RHCE classes for Red Hat and has worked at MCI Worldcom, Cisco, and the State of North Carolina. He has been working with Linux and Open Source Software for almost 20 years. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/cinnamon-desktop-environment + +作者:[David Both ][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/dboth +[1]:https://commons.wikimedia.org/wiki/File:Cinnamon-other.jpg +[2]:https://creativecommons.org/licenses/by/2.0/deed.en +[3]:https://opensource.com/life/15/4/9-reasons-to-use-kde diff --git a/sources/tech/20170118 Arrive On Time With NTP -- Part 1- Usage Overview.md b/sources/tech/20170118 Arrive On Time With NTP -- Part 1- Usage Overview.md new file mode 100644 index 0000000000..c5ad01dc35 --- /dev/null +++ b/sources/tech/20170118 Arrive On Time With NTP -- Part 1- Usage Overview.md @@ -0,0 +1,61 @@ +Arrive On Time With NTP -- Part 1: Usage Overview +============================================================ + + ![NTP](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ntp-time.jpg?itok=zu8dqpki "NTP") +In this first of a three-part series, Chris Binnie looks at why NTP services are essential to a happy infrastructure.[Used with permission][1] + +Few services on the Internet can claim to be so critical in nature as time. Subtle issues which affect the timekeeping of your systems can sometimes take a day or two to be realized, and they are almost always unwelcome because of the knock-on effects they cause. + +Consider as an example that your backup server loses connectivity to your Network Time Protocol (NTP) server and, over a period of a few days, introduces several hours of clock skew. Your colleagues arrive at work at 9am as usual only to find the bandwidth-intensive backups consuming all the network resources meaning that they can barely even log into their workstations to start their day’s work until the backup has finished. + +In this first of a three-part series, I’ll provide brief overview of NTP to help prevent such disasters. From the timestamps on your emails to remembering when you started your shift at work, NTP services are essential to a happy infrastructure. + +You might consider that the really important NTP servers (from which other servers pick up their clock data) are at the bottom of an inverted pyramid and referred to as Stratum 1 servers (also known as “primary” servers). These servers speak directly to national time services (known as Stratum 0, which might be devices such as atomic clocks or GPS clocks, for example). There are a number of ways of communicating with them securely, via satellite or radio, for example. + +Somewhat surprisingly, it’s reasonably common for even large enterprises to connect to Stratum 2 servers (or “secondary” servers) as opposed to primary servers. Stratum 2 servers, as you’d expect, synchronize directly with Stratum 1 servers. If you consider that a corporation might have their own onsite NTP servers (at least two, usually three, for resilience) then these would be Stratum 3 servers. As a result, such a corporation’s Stratum 3 servers would then connect upstream to predefined secondary servers and dutifully pass the time onto its many client and server machines as an accurate reflection of the current time. + +A simple design component of NTP is that it works on the premise -- thanks to the large geographical distances travelled by Internet traffic -- that round-trip times (of when a packet was sent and how many seconds later it was received) are sensibly taken into account before trusting to a time as being entirely accurate. There’s a lot more to setting a computer’s clock than you might at first think, if you don’t believe me, then [this fascinating web page][3] is well worth looking at. + +At the risk of revisiting the point, NTP is so key to making sure your infrastructure functions as expected that the Stratum servers to which your NTP servers connect to fuel your internal timekeeping must be absolutely trusted and additionally offer redundancy. There’s an informative list of the Stratum 1 servers available at the [main NTP site][4]. + +As you can see from that list, some NTP Stratum 1 servers run in a “ClosedAccount” state; these servers can’t be used without prior consent. However, as long as you adhere to their usage guidelines, “OpenAccess” servers are indeed open for polling. Any “RestrictedAccess” servers can sometimes be limited due to a maximum number of clients or a minimum poll interval. Additionally, these are sometimes only available to certain types of organizations, such as academia. + +### Respect My Authority + +On a public NTP server, you are likely to find that the usage guidelines follow several rules. Let’s have a look at some of them now. + +The “iburst” option involves a client sending a number of packets (eight packets rather than the usual single packet) to an NTP server should it not respond during at a standard polling interval. If, after shouting loudly at the NTP server a few times within a short period of time, a recognized response isn’t forthcoming, then the local time is not  changed. + +Unlike “iburst” the “burst” option is not commonly allowed (so don’t use it!) as per the general rules for NTP servers. That option instead sends numerous packets (eight again apparently) at each polling interval and also when the server is available. If you are continually throwing packets at higher-up Stratum servers even when they are responding normally, you may get blacklisted for using the “burst” option. + +Clearly, how often you connect to a server makes a difference to its load (and the negligible amount of bandwidth used). These settings can be configured locally using the “minpoll” and “maxpoll” options. However, to follow the connecting rules on to an NTP server, you shouldn’t generally alter the the defaults of 64 seconds and 1024 seconds, respectively. + +Another, far from tacit, rule is that clients should always respect Kiss-Of-Death (KOD) messages generated by those servers from which they request time. If an NTP server doesn’t want to respond to a particular request, similar to certain routing and firewalling techniques, then it’s perfectly possible for it to simply discard or blackhole any associated packets. + +In other words, the recipient server of these unwanted packets takes on no extra load to speak of and simply drops the traffic that it doesn’t think it should serve a response to. As you can imagine, however, this isn’t always entirely helpful, and sometimes it’s better to politely ask the client to cease and desist, rather than ignoring the requests. For this reason, there’s a specific packet type called the KOD packet. Should a client be sent an unwelcome KOD packet then it should then remember that particular server as having responded with an access-denied style marker. + +If it’s not the first KOD packet received from back the server, then the client assumes that there is a rate-limiting condition (or something similar) present on the server. It’s common at this stage for the client to write to its local logs, noting the less-than-satisfactory outcome of the transaction with that particular server, if you ever need to troubleshoot such a scenario. + +Bear in mind that, for obvious reasons, it’s key that your NTP’s infrastructure be dynamic. Thus, it’s important not to hard-code IP addresses into your NTP config. By using DNS names, individual servers can fall off the network and the service can still be maintained, IP address space can be reallocated and simple load balancing (with a degree of resilience) can be introduced. + +Let’s not forget that we also need to consider that the exponential growth of the Internet of Things (IoT), eventually involving billions of new devices, will mean a whole host of equipment will need to keep its wristwatches set to the correct time. Should a hardware vendor inadvertently (or purposely) configure their devices to only communicate with one provider’s NTP servers (or even a single server) then there can be -- and have been in the past -- very unwelcome issues. + +As you might imagine, as more units of hardware are purchased and brought online, the owner of the NTP infrastructure is likely to be less than grateful for the associated fees that they are incurring without any clear gain. This scenario is far from being unique to the realms of fantasy. Ongoing headaches -- thanks to NTP traffic forcing a provider’s infrastructure to creak -- have been seen several times over the last few years. + +In the next two articles, I’ll look at some important NTP configuration options and examine server setup. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/arrive-time-ntp-part-1-usage-overview + +作者:[CHRIS BINNIE][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/chrisbinnie +[1]:https://www.linux.com/licenses/category/used-permission +[2]:https://www.linux.com/files/images/ntp-timejpg +[3]:http://www.ntp.org/ntpfaq/NTP-s-sw-clocks-quality.htm +[4]:http://support.ntp.org/bin/view/Servers/StratumOneTimeServers diff --git a/sources/tech/20170118 Red Hat's OpenShift Container Platform Expands Cloud Options.md b/sources/tech/20170118 Red Hat's OpenShift Container Platform Expands Cloud Options.md new file mode 100644 index 0000000000..1c8506e11e --- /dev/null +++ b/sources/tech/20170118 Red Hat's OpenShift Container Platform Expands Cloud Options.md @@ -0,0 +1,104 @@ +Red Hat's OpenShift Container Platform Expands Cloud Options +============================================================ + +Red Hat on Wednesday announced the general availability of Red Hat OpenShift Container Platform 3.4. + + ![Red Hat's OpenShift Container Platform Expands Cloud Options](http://www.linuxinsider.com/ai/465314/red-hat-openshift.jpg) + +This latest version helps organizations better embrace new Linux container technologies that can deliver innovative business applications and services without sacrificing existing IT investments. + +Red Hat OpenShift Container Platform 3.4 provides a platform for innovation without giving up existing mission-critical workloads. It offers dynamic storage provisioning for both traditional and cloud-native applications, as well as multitenant capabilities that can support multiple applications, teams and deployment processes in a hybrid cloud environment. + +Today's enterprises are must balance management of their existing application portfolios with the goal of making it easier for developers to build new applications, observed Brian Gracely, director of product strategy for OpenShift at Red Hat. + +The new release focuses on three complex areas for enterprises: managing storage; isolating resources for multiple groups (multitenancy); and the ability to consistently run applications on multiple cloud environments (public or private). + +"Red Hat OpenShift Container Platform 3.4 builds on the momentum of both the Kubernetes and Docker projects, which are helping developers use containers to modernize existing applications and build new cloud-native microservices," Gracely told LinuxInsider. + +OpenShift Container Platform 3.4 makes storage provisioning easier for developers and operators, and it enhances how the platform can be used to provide multitenant resources to multiple groups within an organization. Additionally, it continues to codify the best practices needed to deploy a consistent container platform across any cloud environment, such as AWS, Azure, GCP, OpenStack or VMware. + +### Pushes Cloud Benefits + +The new platform advances the process of creating and deploying applications by addressing the growing storage needs of applications across the hybrid cloud for enterprises. It allows for coexistence of modern and future-forward workloads on a single, enterprise-ready platform. + +The new OpenShift Container Platform and service gives Red Hat customers an easy way to adopt and use Google Cloud as a public of hybrid cloud environment, noted Charles King, principal analyst at [Pund-IT][1]. + +"It will be a welcome addition in many or most enterprise IT shops, especially those that are active employing or exploring container solutions," he told LinuxInsider. + +"Since Red Hat will act as the service provider of the new offering, customers should also be able to seamlessly integrate OpenShift support with their other Red Hat products and services," King pointed out. + +The new release also provides an enterprise-ready version of Kubernetes 1.4 and the Docker container runtime, which will help customers roll out new services more quickly with the backing of Red Hat Enterprise Linux. + +OpenShift Container Platform 3.4 integrates architectures, processes and services to enable delivery of critical business applications, whether legacy or cloud-native, and containerized workloads. + +### Open Source and Linux Innovation + +Kubernetes is becoming the de facto standard for orchestrating and managing Linux containers. OpenShift is delivering the leading enterprise-ready platform built on Kubernetes, noted Red Hat's Gracely. + +"Kubernetes is one of the fastest-growing open source projects, with contributors from cloud providers, independent software vendors and [individual and business] end-users," he said. "It has become a project that has done an excellent job of considering and addressing the needs of many different groups with many types of application needs." + +Both Red Hat and Google are pushing for innovation. Both companies are among the market's most proactive and innovative supporters of open source and Linux solutions. + +"The pair's collaboration on this new service is a no-brainer that could eventually lead to Red Hat and Google finding or creating further innovative open source offerings," said Pund-IT's King. + +### Features and Benefits + +Among the new capabilities in the latest version of OpenShift Container Platform: + +* Next-level container storage with support for dynamic storage provisioning -- This allows multiple storage types and multitier storage exposure in Kubernetes; +* Container-native storage enabled by Red Hat Gluster Storage -- This now supports dynamic provisioning and push button deployment for stateful and stateless applications; +* Software-defined, highly available and scalable storage solution -- This provides access across on-premises and public cloud environments for more cost efficiency over traditional hardware-based or cloud-only storage services; +* Enhanced multitenancy through more simplified management of projects -- This feature is powered by Kubernetes namespaces in a single Kubernetes cluster. Applications can run fully isolated and share resources on a single Kubernetes cluster in OpenShift Container Platform. + +### More Supplements + +The OpenShift Container Platform upgrade adds the capacity to search for projects and project details, manage project membership, and more via a more streamlined Web console. This capability facilitates working with multiple projects across dispersed teams. + +Another enhancement is the multitenancy feature that provides application development teams with their own cloud-like application environment. It lets them build and deploy customer-facing or internal applications using DevOps processes that are isolated from one another. + +Also available in the new release are new hybrid cloud reference architectures for running Red Hat OpenShift Container Platform on OpenStack, VMware, Amazon Web Services, Google Cloud Engine and Microsoft Azure. These guides help walk a user through deployment across public and private clouds, virtual machines and bare metal. + +"It also drastically simplifies how developers can access storage resources, allowing developers to dynamically provision storage resources/capacity with the click of a button -- effectively self-service for developers. It also allows developers to feel confident that the resources required for their applications will be properly isolated from other resource needs in the platform," said Red Hat's Gracely. + +### Orchestration Backbone + +The foundation for Red Hat OpenShift Container Platform 3.4 is the open source Kubernetes Project community. Kubernetes 1.4 features alpha support for expanded cluster federation APIs. + +It enables multiple clusters federated across a hybrid environment. Red Hat engineers view this feature as a key component to enabling hybrid cloud deployments in the enterprise. + +The latest version of OpenShift is available now via the Red Hat Customer Portal. It offers community innovation as hardened, production-grade features. + +### Ensuring Customer Health + +Red Hat's platform is vital to the success of The Vitality Group's global initiative and reward program, according to CIO Neil Adamson. + +This program is a key component of how the company envisions the future of health, he said. + +"Advanced services for our customers can only be delivered by embracing next-generation technologies, particularly those provided through the open source communities that drive Linux containers, Kubernetes and IoT," said Adamson. + +Red Hat's OpenShift Container Platform provides his company with the best of these communities while still delivering a stable, more secure foundation that help "reap the benefits of open source innovation while lessening the risks often inherent to emerging technologies." + +The latest platform features will further support application development in the cloud. Container solutions are being adopted rapidly for many core IT tasks, including app development projects and processes, according to King, who noted that "being able to seamlessly deploy containers in a widely and easily accessible environment like Google Cloud should simplify development tasks."  + ![](http://www.ectnews.com/images/end-enn.gif) + +-------------------------------------------------------------------------------- + +作者简介: + +![](http://www.linuxinsider.com/ai/465314/red-hat-openshift.jpg) + +**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+][2]. + +-------------------------------------------------------------------------------- + +via: http://www.linuxinsider.com/story/84239.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]:https://plus.google.com/116242401898170634809?rel=author +[1]:http://www.pund-it.com/ +[2]:https://plus.google.com/116242401898170634809?rel=author diff --git a/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md b/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md new file mode 100644 index 0000000000..7d43ffde17 --- /dev/null +++ b/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md @@ -0,0 +1,153 @@ +A beginner's guide to comparing files using visual diff/merge tool Meld on Linux +============================================================ + +### On this page + +1. [About Meld][1] +2. [Meld Installation][2] +3. [Meld Usage][3] +4. [Conclusion][4] + +Now that we've [covered][5] [some][6] command line-based diff/merge tools in Linux, it'd be logical to explain some visual diff/merge tools available for the OS as well. Reason being, not everybody is used-to the command line, and/or command-line based comparison tools could be more difficult to learn and understand for some. + +So, we'll kick off this new series with a GUI-based tool dubbed **Meld**. + +But before we jump onto the installation and explanation part, it'd be worth sharing that all the instructions and examples presented in this tutorial have been tested on Ubuntu 14.04 and the Meld version we've used is 3.14.2. + +### About Meld + +[Meld][7] is basically a visual comparison and merging tool that's primarily aimed at developers (however, rest assured that we'll be explaining the tool keeping in mind end-users). The tool supports both two- and three-way comparisons, and not only lets you compare files, but directories and version controlled projects as well. + +"Meld helps you review code changes and understand patches," the official website says. "It might even help you to figure out what is going on in that merge you keep avoiding." The tool is licensed under GPL v2. + +### Meld Installation + +If you are using Ubuntu or any-other Debian-based Linux distro, you can download and install Meld using the following command: + +sudo apt-get install meld + +Alternatively, you can also use your system's package manager to download the tool. For example, on Ubuntu, you can use the Ubuntu Software Center, or [Ubuntu Software][8], which has replaced the former starting version 16.04 of the OS. + +However, it may be possible that the version of Meld in Ubuntu's official repositories is old. So, in that case if you want to use a more recent version, you can download the package from [here][9].  If you choose this method, then all you have to do is to extract the downloaded package, and then run the 'meld' binary present under the 'bin' folder: + +~/Downloads/meld-3.14.2/bin$ **./meld**  + +FYI, following are the packages that Meld requires: + +* Python 2.7 (Python 3.3 in development) +* GTK+ 3.14 +* GLib 2.36 +* PyGObject 3.14 +* GtkSourceView 3.14 +* pycairo + +### Meld Usage + +When the tool is launched, you'll see a screen similar to the following: + +[ + ![Meld started](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-launch-screen-1.png) +][10] + +So you have three options: File comparison, Directory comparison, and Version control view. + +Click the 'File comparison' option, and you'll be asked to select the files to compare: + +[ + ![Meld file comparison](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-file-comparison-2.png) +][11] + +As clear from the screenshot above, Meld also lets you perform 3-way comparisons, but - in this first part of this article series - we'll stick to two-way comparisons that are more common. + +Moving on, select the files that you want to compare and then click the 'Compare' button. You'll see that the tool opens both files side by side and also highlights the differing lines (as well as differences). + +[ + ![Compare files in Meld](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-diff-in-action-3.png) +][12] + +So the difference is in the second line of both files, and the actual difference is the extra '3' in the second line of file2\. Those black arrows that you see are there to perform the merge/change operation. The right arrow, in this case, will change the second line in 'file2' with the corresponding line from 'file1'. The left arrow will do vice-versa. + +After making changes, you can do a Ctrl+s to save them. + +So that was a simple example to let you know how Meld works on a basic level. Let's take a look at a slightly more complicated comparison: + +[ + ![Meld advanced file comparison](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-multiple-changes-4.png) +][13] + +Before discussing the changes, it's worth mentioning here that there are areas in Meld GUI that give you visual overview of the changes between the files. Specifically, what we're trying to bring into your notice here are vertical bars at the left and right-hand sides of the window. For example, see the following screenshot: + +[ + ![Visual Comparison](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-multiple-colors-5.png) +][14] + +If you observe closely, the bar in the screenshot above contains some coloured blocks. These blocks are designed to give you an overview of all of the differences between the two files. "Each coloured block represents a section that is inserted, deleted, changed or in conflict between your files, depending on the block's colour used," the official documentation explains. + +Now, let's come back to the example we were discussing. The following screenshots show how easy is to understand file changes (as well as merge them) when using Meld: + +[ + ![File changes visualized in Meld](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-makes-it-easy-6.png) +][15] + +[ + ![Meld Example 2](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-makes-it-easy-7.png) +][16] + +[ + ![Meld Example 3](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-makes-it-easy-8.png) +][17] + +Moving on, so far, we jumped from one change to another by scrolling the files. However, there may be times when the files being compared are very large, making it difficult to scroll every time you want to jump to a change. For this, you can use the orange-colored arrows in the toolbar which itself sits above the editing area: + +[ + ![Go to next change in Meld](https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/meld-go-next-prev-9.png) +][18] + +Here's how you do some of the common things while using Meld: You can use the standard Ctrl+f key-combination to find something in the editor area, press F11 key to make the tool go in full screen mode, and Ctrl+r to refresh (usually used when the any or both of files being compared have changed). + +Following are some of the key features that the official Meld website advertises: + +* Two- and three-way comparison of files and directories +* File comparisons update as you type +* Auto-merge mode and actions on change blocks help make merges easier +* Visualisations make it easier to compare your files +* Supports Git, Bazaar, Mercurial, Subversion, etc. + +Note that the list above is not exhaustive. The website contains a dedicated [Features page][19] that contains an exhaustive list of features that Meld offers. All the features listed there are divided in sections based on whether the tool is being used for file comparison, directory comparison, version control, or in the merge mode. + +Like any other software tool, there are certain things that Meld can't do. The official website lists at-least one of them: "When Meld shows differences between files, it shows both files as they would appear in a normal text editor. It does not insert additional lines so that the left and right sides of a particular change are the same size. There is no option to do this.". + +### Conclusion + +We've just scratched the surface here, as Meld is capable of doing a lot more. But it's ok for now, given that it's the first part of the tutorial series. Just to give you an idea about Meld's capabilities, you can configure the tool to ignore certain type of changes, ask it to move, copy or delete individual differences between files, as well as launch it from the command line. We'll discuss all these key functionalities in upcoming parts of this tutorial series. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/ + +作者:[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/beginners-guide-to-visual-merge-tool-meld-on-linux/ +[1]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/#about-meld +[2]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/#meld-installation +[3]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/#meld-usage +[4]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/#conclusion +[5]:https://www.howtoforge.com/tutorial/linux-diff-command-file-comparison/ +[6]:https://www.howtoforge.com/tutorial/how-to-compare-three-files-in-linux-using-diff3-tool/ +[7]:http://meldmerge.org/ +[8]:https://www.howtoforge.com/tutorial/ubuntu-16-04-lts-overview/ +[9]:https://git.gnome.org/browse/meld/refs/tags +[10]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-launch-screen-1.png +[11]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-file-comparison-2.png +[12]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-diff-in-action-3.png +[13]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-multiple-changes-4.png +[14]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-multiple-colors-5.png +[15]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-makes-it-easy-6.png +[16]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-makes-it-easy-7.png +[17]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-makes-it-easy-8.png +[18]:https://www.howtoforge.com/images/how-to-use-visual-diff-and-merge-tools-in-linux-meld-and-kdiff/big/meld-go-next-prev-9.png +[19]:http://meldmerge.org/features.html diff --git a/sources/tech/20170119 How to get started contributing to Mozilla.md b/sources/tech/20170119 How to get started contributing to Mozilla.md new file mode 100644 index 0000000000..9ca6889b97 --- /dev/null +++ b/sources/tech/20170119 How to get started contributing to Mozilla.md @@ -0,0 +1,126 @@ +How to get started contributing to Mozilla +============================================================ + ![How to get started contributing to Mozilla](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=yUgHEdMK "How to get started contributing to Mozilla") +Image by :  + +opensource.com + +_The journey of a thousand miles begins with one step. —Lao Tzu_ + +Open source participation offers a sea of benefits that can fine-tune and speed up your career in the tech, including but not limited to real-world technical experience and expanding your professional network. There are a lot of open source projects out there you can contribute to—of small, medium, and large size, as well as unknown and popular. In this article we'll focus on how to contribute to one of the largest and most popular open source projects on the web: Mozilla. + +### Why contribute to Mozilla? + +### Real world experience + +Mozilla is one of the largest open source projects on the web and is itself a host to many other open source projects. So, when you contribute to large-scale open source projects like Mozilla, you gain real-world exposure to how things really work in the tech field, increased knowledge of technical jargon and complex system functionalities, and most importantly, an understanding of how to take code from a local system to a live code repository. You'll learn many of the tools and techniques contributors are using to manage these large-scale projects, like GitHub, Docker, Bugzilla, etc. + +### Community connections + +Community is the heart of any open source project. Contributing to Mozilla connects you with official Mozilla staff and mentors, senior Mozilla contributors (aka Mozillians), and your own local Mozilla community. These are like-minded people who care and strive for improving open source like you do. + +Also, you'll have a chance to build your own identity in the Mozilla community and to inspire other fellow Mozillians. If you want to, you can also eventually mentor others. + +### Events and swag + +No community is complete without a few fun-filled events and bags of swag. Mozilla is no exception. + +Contributing to Mozilla will give you a chance to take part in exclusive Mozilla events. And once you've become a seasoned Mozilla contributor, you'll be able to host your own local Mozilla community events (and Mozilla may assist with funding). Plus, of course, some cool swag—stickers, T-shirts, mugs, and more. + + ![India Mozilla meetup 2016](https://opensource.com/sites/default/files/mozilla-india-meetup-2016.jpg "India Mozilla meetup 2016") + +CC BY-SA 4.0 Mozilla India Meetup 2016 by Moin Shaikh + +### How to contribute to Mozilla + +Whether you are a programmer, web designer, QA tester, translator, or something in-between, there are many different ways you can contribute to Mozilla. Let's view it in two main parts: technical contribution and nontechnical contribution. + + ![Ways to contribute](https://opensource.com/sites/default/files/ways-to-contribute-mozilla_0.jpg "Ways to contribute") + +CC BY-SA 3.0 by [Mozilla.org][1] + +### Technical contribution + +Technical contribution is for people who love programming and who want to make an impact with their code. There are a number of projects built in specific programming languages where you can hone your talents: + +* If love C++, you can contribute to the core layers of Firefox and other Mozilla products. +* If you know JavaScript, HTML, and CSS, you can contribute to the front-end of Firefox. +* If you know Java, you can contribute to Firefox Mobile, Firefox on Android, and MozStumbler. +* If you know Python, you can contribute to web services, including Firefox Sync or Firefox Accounts. +* If you know Shell, Make, Perl, or Python, you can contribute to Mozilla's build systems and release engineering and automation. +* If you know C language, you can contribute to NSS, Opus, and Daala projects. +* If you know Rust language, you can contribute to RustC, Servo (a web browser engine designed for parallelism and safety), or Quantum (a project to bring large pieces of Servo into Gecko). +* If you know Go language, you can contribute to Heka, a tool for data processing. + +To learn more, visit the [Getting Started][3] section on the Mozilla Developer Network (MDN) to take a look at various contributions areas. + +Apart from languages and code, you can also contribute with your QA and testing skills by actively testing various parts of Firefox web browser, Firefox Android browser, and Mozilla's many web properties, such as Firefox add-ons, etc. + +### Nontechnical contribution + +You can also make nontechnical contributions to Mozilla, focusing on areas like QA testing, document translation, UX/UI design, web literacy, open source advocacy, and providing user support to Mozilla Firefox and Thunderbird users. + +**QA testing:** The Mozilla QA team has a large and vibrant community around the world that is deeply involved in the workings of Firefox and other Mozilla projects. The QA contributors take an early look at various products, explore new features, file bugs, triage existing bugs, write and execute test cases, automate tests, and provide valuable feedback from a usability perspective. To get started or to learn more about the Mozilla QA community resources, visit the [Mozilla QA community][4] website. + +**UX design:** If you're a creative designer or a passionate geek who loves to play with colors and graphics, Mozilla has a lot of space for you in its community where you can design usable, accessible, delightful Mozilla projects. Check out this [Open Design repository][5] on Mozilla's GitHub page. + +**User support (forum and social support):** This is where hundreds of thousands of Firefox and Thunderbird users like you and me come and post questions about Firefox and Thunderbird, and this is where they get answers from Mozilla contributors like us. This requires no coding genius, no design skills, and no testing abilities, only handful of Firefox knowledge to get started as a Firefox User Support contributor. Check out this [Get Involved][6] section to join User Support at [SUMO][7]. Support is probably the easiest yet most important areas to commence your Mozilla journey. (Note: Three years ago, I began my Mozilla journey at the Social Support forums.) + +**Writing knowledgebase and help articles:** If you like writing and teaching, then the Knowledge Base is the place for you. Mozilla is always looking for contributors who can write, edit, or proofread articles in English for Firefox and other products. Thousands of users surf these knowledgebase articles every week, and you can make a robust impact by sharing your wisdom and writing help articles for them. Visit the [Mozilla Knowledge Base][8] site to get involved. + +**Localization, aka l10n:** Mozilla's products, like Firefox, are used by millions around the globe and by those speaking many different languages. People need these products in their own language. Language localization is an area that is very much in need of contributors. Projects requiring your translation and localization skills include: + +* Mozilla products, such as Firefox +* Mozilla websites and services +* Mozilla marketing campaigns +* SUMO product support documentation +* MDN developer documentation + +You can visit [Mozilla's l10n][9] site to get involved. + +**Teaching and web literacy:** One of the fundamental mission objectives of Mozilla is to keep the web accessible to all. To achieve this mission objective, Mozilla strives hard to educate and enable web users by providing them with the tools and technologies of web literacy. This is where you can help with your teaching skills. If you are a passionate teacher who loves to share knowledge and show the masses all about the Internet, take a look at [Teach the Web][10] initiative by Mozilla. Teach your local community, school kids, your friends, and others about the Internet and web literacy. + +**Advocacy:** If you are passionate about Mozilla's mission, you can spread the word by advocating for the Mozilla mission. While advocating for Mozilla's mission, you can contribute by: + +* Tackling public policy and fight for an open internet and user privacy +* Helping the web be more interoperable by working with site owners on compatibility +* Helping web authors improve how they write about the open web +* Showing your Mozilla and Firefox pride as [Firefox Friends][2] + +To begin promoting Mozilla's mission, take a look at the [Mozilla Advocacy][11] page. + +### If you're lost, I'm here to help you get started! + +I know that as a novice contributor, this article might be an overwhelming amount of information for you. If you need further directions, resources, or references, you can ask me in the comments below or you can [ping me on Twitter][12]. I would be very happy to help you get started with your first contribution (of many more!) to Mozilla. + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/15492097_10205888026638370_7707367819712084708_n.jpg?itok=3R90PGkv) + + I am an open source tech geek working as a web analyst and have combined IT experience of over 7 years. I have been contributing to Mozilla for over 2 years. I mainly contribute to: Firefox Web QA, Firefox Technical Support, Localization and community mentoring. Apart from open source contribution, I read, write and speak about UX, Material Design and eCommerce Analysis. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/how-get-started-contributing-mozilla + +作者:[Moin Shaikh][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/moinshaikh +[1]:http://mozilla.org/ +[2]:https://www.mozilla.org/en-US/contribute/friends/ +[3]:https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction#Find_a_bug_we've_identified_as_a_good_fit_for_new_contributors. +[4]:https://quality.mozilla.org/get-involved/ +[5]:https://github.com/mozilla/OpenDesign +[6]:https://support.mozilla.org/en-US/get-involved/questions +[7]:http://support.mozilla.org/ +[8]:https://support.mozilla.org/en-US/get-involved/kb +[9]:https://l10n.mozilla.org/ +[10]:https://learning.mozilla.org/en-US/ +[11]:https://advocacy.mozilla.org/en-US +[12]:https://twitter.com/moingshaikh diff --git a/sources/tech/20170119 The End Of An Era A Look Back At The Most Popular Solaris Milestones.md b/sources/tech/20170119 The End Of An Era A Look Back At The Most Popular Solaris Milestones.md new file mode 100644 index 0000000000..ee8a806b32 --- /dev/null +++ b/sources/tech/20170119 The End Of An Era A Look Back At The Most Popular Solaris Milestones.md @@ -0,0 +1,203 @@ +The End Of An Era: A Look Back At The Most Popular Solaris Milestones & News +================================= + + ![ORACLE -- ](https://www.phoronix.com/assets/categories/oracle.jpg) +With it looking certain now that [Oracle is ending Solaris feature development][42]with the cancelling of Solaris 12, here's a look back at the most popular Solaris news and milestones for the project over the years on Phoronix.  + +There were many great/fun Solaris memories. + +[ + ![](http://www.phoronix.net/image.php?id=982&image=sun_sxce81_03_med) +][1] + +During the Sun Microsystems days, I was genuinely interested in Solaris. There were frequent Solaris articles on Phoronix while Linux was always our main focus. Solaris was fun to play around with, OpenSolaris / SXCE was great, I ported the Phoronix Test Suite to Solaris, we had great relations with the Sun Microsystems folks, was at many Sun events, etc.  + +[ + ![](http://www.phoronix.net/image.php?id=711&image=java7_bash_13_med) +][2] +_Sun had some rather unique events back in the day..._ + +Unfortunately since Oracle acquired Sun, Solaris basically went downhill. The biggest blow was arguably when Oracle ended OpenSolaris and moved all their Solaris efforts back to a proprietary model...  + +[ + ![](http://www.phoronix.net/image.php?id=sun_sxce_farewell&image=sun_sxce_07_med) +][3] + +Lots of great memories for Solaris during the Sun days, so given Oracle wiping "Solaris 12" off their roadmap, I figured it would be fun to look back at the most-viewed Solaris stories on Phoronix while waiting to hear from Oracle about "Solaris 11.next" as their final step to likely winding down the operating system development.  + +[ + ![](http://www.phoronix.net/image.php?id=solaris_200805&image=opensolaris_indiana_03b_med) +][4] + +Though in a post-Solaris world it will be interesting to see what Oracle does with ZFS and if they double down on their RHEL-based Oracle Enterprise Linux. Time will tell.  + +[ + ![](http://www.phoronix.net/image.php?id=oracle_solaris_11&image=oracle_solaris11_02_med) +][5] + +Anyhow, here's a look back at our most-viewed Solaris stories since 2004:  + +**[ATI R500/600 Driver For Solaris Coming?][6]**  +_While no ATI fglrx driver is available for Solaris/OpenSolaris or *BSD, now that AMD will be offering up specifications to X.Org developers and an open-source driver, it certainly is promising for any Solaris user depending upon ATI's Radeon X1000 "R500" or HD 2000 "R600" series. The open-source X.Org driver that will be released next week is far from mature, but it should be able to be ported to Solaris and other operating systems using X.Org with relative ease. What AMD announced today is targeted for the Linux community, but it can certainly help out Solaris/OpenSolaris users that use ATI hardware. Especially with "Project Indiana" coming out soon, it's only a matter of time before the open-source R500/600 driver is ported. Tell us what you think in our Solaris forum._  + +**[Solaris Express Community Build 71][7]**  +_Build 71 of Solaris Express Community Edition (SXCE) is now available. You can find out more about Solaris Express Community Build 71 at OpenSolaris.org. On a side note, with news at the Linux Kernel Summit that AMD will be providing GPU specifications, the resulting X.Org driver could lead to an improved state for Solaris/OpenSolaris on ATI hardware in the future._  + +**[Farewell To OpenSolaris. Oracle Just Killed It Off.][8]**  +_Oracle has finally announced their plans for Solaris operating system and OpenSolaris platform and it's not good. OpenSolaris is now effectively dead and there will not be anymore OpenSolaris releases -- including the long-delayed 2010 release. Solaris will still live-on and Oracle is busy working on Solaris 11 for a release next year and there will be a "Solaris 11 Express" as being a similar product to OpenSolaris, but it will only ship after Oracle's enterprise release._  + +**[Solaris Express Community Build 72][9]**  +_For those of you wanting to try out the latest and greatest in OpenSolaris software right now prior to the release of "Project Indiana", build 72 of Solaris Express Community Edition is now available. Solaris Express Community Edition (SXCE) Build 72 can be downloaded from OpenSolaris.org. Meanwhile, the preview release of Sun's Project Indiana is expected next month._ + +**[OpenSolaris Developer Summit][10]**  +_Announced earlier today on the OpenSolaris Forums was the first-ever OpenSolaris Developer Summit. This summit is taking place in October at the University of California, Santa Cruz. Sara Dornsife describes this summit as "not a conference with presentations or exhibitors, but an in-person, collaborative working session to plan the next release of Project Indiana." Ian Murdock will be keynoting at this Project Indiana fest, but beyond that the schedule is still being planned. Phoronix may be covering this event and you can discuss this summit in our Solaris forums._  + +**[Solaris Containers For Linux][11]**  +_Sun Microsystems has announced that they will soon be supporting Solaris Containers for Linux applications. This will make it possible to run Linux applications under Solaris without any modifications to the binary package. The Solaris Containers for Linux will allow for a smoother migration from Linux to Solaris, assist in cross-platform development,and other benefits. As far as when the support will arrive, it's "coming soon"._  + +**[Oracle Still To Make OpenSolaris Changes][12]**  +_Since Oracle finished its acquisition of Sun Microsystems, there have been many changes to the open-source projects that were once supported under Sun now being discontinued by Oracle and significant changes being made to the remaining open-source products. One of the open-source projects that Oracle hasn't been too open about their intentions with has been OpenSolaris. Solaris Express Community Edition (SXCE) already closed up last month and there hasn't been too much information flowing out about the next OpenSolaris release, which is supposed to be known as OpenSolaris 2010.03 with a release date sometime in March._  + +**[Xen For Solaris Updated][13]**  +_It's been a while, but Xen for Solaris has finally been updated. John Levon poimts out that this latest build is based upon Xen 3.0.4 and Solaris "Nevada" Build 66\. Some of the improvements in this latest build include PAE support, HVM support, new virt-manager tools, improved debugging support, and last but not least is managed domain support. The download for the July 2007 Solaris Xen update can be found over at Sun's website._  + +**[IBM To Distribute Sun's Solaris][14]**  +_Sun Microsystems and IBM are holding a teleconference right now where they have just announced IBM will begin distributing Sun's Solaris operating system on select servers. These IBM servers include the x86-based system X servers as well as Blade Center Servers. The official press release has just been issued and can be read at the Sun news room._  + +**[Oracle Solaris 11 Kernel Source-Code Leaked][15]**  +_It appears that the kernel source-code to Solaris 11 was leaked onto the Internet this past weekend._  + +**[Solaris 12 Might Finally Bring Radeon KMS Driver][16]**  +_It looks like Oracle may be preparing to release their own AMD Radeon kernel mode-setting (KMS) driver for introducing into Oracle Solaris 12._  + +**[OpenSXCE 2013.05 Revives The Solaris Community][17]**  +_OpenSXCE 2013.05 is out in the wild as the community revival of the Solaris Express Community Edition._  + +**[OpenSolaris Will Not Merge With Linux][18]**  +_At LinuxWorld 2007 in San Francisco, Andrew Morton said during his keynote that no key components of OpenSolaris will appear in the Linux kernel. In fact, Morton had even stated that "It’s a great shame that OpenSolaris still exists." Some of these key OpenSolaris components include Zones, ZFS, and DTrace. Though there is the possibility that Project Indiana could turn these into GPLv3 projects... More information is available at ZDNET._  + +**[Oracle Has Yet To Clarify Solaris 11 Kernel Source][19]**  +_It was one month ago that Phoronix was the first to note the Solaris 11 kernel source-code was leaked onto the Internet via Torrent sites. One month later, Oracle still hasn't officially commented on the situation._  + +**[Oracle Might Be Canning Solaris][20]**  +_Oracle might be pulling the plug on the Solaris operating system, at least according to some new rumors._  + +**[Solaris Express Community Build 70][21]**  +_Build 70 for Solaris Express Community Edition "Nevada" (SXCE snv_70) is now available. The announcement with download links can be found in the OpenSolaris Forums. Also announced was the 71st build of their Network Storage that includes source-code from Qlogic for the fibre channel HBA driver._  + +**[Solaris 10 7/07 HW Release][22]**  +_The documentation is now online for the Solaris 10 7/07 HW Release. As noted on the Solaris Releases page, Solaris 10 7/07 is only for SPARC Enterprise M4000-M9000 servers and no x86/x64 version is available. The latest Solaris update for all platforms is Solaris 10 11/06\. You can discuss Solaris 7/07 in the Phoronix Forums._  + +**[Solaris Telecom Servers From Intel][23]**  +_Intel has announced today the availability of Intel-powered Sun Solaris telecommunications rack and blade servers that meet NEBS, ETSI, and ATCA compliance. Of these new carrier grade platforms, the Intel Carrier Grade Rack Mount Server TIGW1U supports both Linux and Solaris 10 and the Intel NetStructure MPCBL0050 SBC will support both operating systems as well. Today's press release can be read here._  + +**[The Sad State Of GPU Drivers For BSD, Solaris][24]**  +_Yesterday a discussion arose on the mailing list about killing off all the old Mesa drivers. These old drivers aren't actively maintained, support vintage graphics processors, and aren't updated to support new Mesa functionality. They're now also getting in the way as Intel and other developers work to clean up the core of Mesa as they bolster this open-source graphics library for the future. There's also some implications for BSD and Solaris users by this move to clean-up Mesa._  + +**[Oracle Solaris 11.1 Brings 300+ Enhancements][25]**  +_Oracle released Solaris 11.1 from their Oracle OpenWorld conference yesterday in San Francisco._  + +[ + ![](http://www.phoronix.net/image.php?id=opensolaris_200906&image=opensolaris_200906_06_med) +][26] + +And then of the most-viewed featured articles with Solaris:  + +**[Ubuntu vs. OpenSolaris vs. FreeBSD Benchmarks][27]**  +_Over the past few weeks we have been providing several in-depth articles looking at the performance of Ubuntu Linux. We had begun by providing Ubuntu 7.04 to 8.10 benchmarks and had found the performance of this popular Linux distribution to become slower with time and that article was followed up with Mac OS X 10.5 vs. Ubuntu 8.10 benchmarks and other articles looking at the state of Ubuntu's performance. In this article, we are now comparing the 64-bit performance of Ubuntu 8.10 against the latest test releases of OpenSolaris 2008.11 and FreeBSD 7.1._  + +**[NVIDIA Performance: Windows vs. Linux vs. Solaris][28]**  +_Earlier this week we previewed the Quadro FX1700, which is one of NVIDIA's mid-range workstation graphics cards that is based upon the G84GL core that in turn is derived from the consumer-class GeForce 8600 series. This PCI Express graphics card offers 512MB of video memory with two dual-link DVI connections and support for OpenGL 2.1 while maintaining a maximum power consumption of just 42 Watts. As we mentioned in the preview article, we would be looking at this graphics card's performance not only under Linux but also testing this workstation solution in both Microsoft Windows and Sun's Solaris. In this article today, we are doing just that as we test the NVIDIA Quadro FX1700 512MB with each of these operating systems and their respective binary display drivers._  + +**[FreeBSD 8.0 Benchmarked Against Linux, OpenSolaris][29]**  +_With the stable release of FreeBSD 8.0 arriving last week we finally were able to put it up on the test bench and give it a thorough look over with the Phoronix Test Suite. We compared the FreeBSD 8.0 performance between it and the earlier FreeBSD 7.2 release along with Fedora 12 and Ubuntu 9.10 on the Linux side and then the OpenSolaris 2010.02 b127 snapshot on the Sun OS side._  + +**[Fedora, Debian, FreeBSD, OpenBSD, OpenSolaris Benchmarks][30]**  +_Last week we published the first Debian GNU/kFreeBSD benchmarks that compared the 32-bit and 64-bit performance of this Debian port -- that straps the FreeBSD kernel underneath a Debian GNU user-land -- to Debian GNU/Linux. We have now extended that comparison to put many other operating systems in a direct performance comparison  +to these Debian GNU/Linux and Debian GNU/kFreeBSD snapshots of 6.0 Squeeze to Fedora 12, FreeBSD 7.2, FreeBSD 8.0, OpenBSD 4.6, and OpenSolaris 2009.06._  + +**[AMD Shanghai Opteron: Linux vs. OpenSolaris Benchmarks][31]**  +_In January we published a review of the AMD Shanghai Opteron CPUs on Linux when we looked at four of the Opteron 2384 models. The performance of these 45nm quad-core workstation/server processors were great when compared to the earlier AMD Barcelona processors on Ubuntu Linux, but how is their performance when running Sun's OpenSolaris operating system? Up for viewing today are dual AMD Shanghai benchmarks when running OpenSolaris 2008.11, Ubuntu 8.10, and a daily build of the forthcoming Ubuntu 9.04 release._  + +**[OpenSolaris vs. Linux Kernel Benchmarks][32]**  +_Earlier this week we delivered benchmarks of Ubuntu 9.04 versus Mac OS X 10.5.6 and found that the Leopard operating system had performed better than the Jaunty Jackalope in a majority of the tests, at least when it came to Ubuntu 32-bit. We are back with more operating system benchmarks today, but this time we are comparing the performance of the Linux and Sun OpenSolaris kernels. We had used the Nexenta Core Platform 2 operating system that combines the OpenSolaris kernel with a GNU/Ubuntu user-land to that of the same Ubuntu package set but with the Linux kernel. Testing was done with both 32-bit and 64-bit Ubuntu server installations._  + +**[Netbook Performance: Ubuntu vs. OpenSolaris][33]**  +_In the past we have published OpenSolaris vs. Linux Kernel benchmarks and similar articles looking at the performance of Sun's OpenSolaris up against popular Linux distributions. We have looked at the performance on high-end AMD workstations, but we have never compared the OpenSolaris and Linux performance on netbooks. Well, not until today. In this article we have results comparing OpenSolaris 2009.06 and Ubuntu 9.04 on the Dell Inspiron Mini 9 netbook._  + +**[NVIDIA Graphics: Linux vs. Solaris][34]**  +_At Phoronix we are constantly exploring the different display drivers under Linux, and while we have reviewed Sun's Check Tool and test motherboards with Solaris in addition to covering a few other areas, we have yet to perform a graphics driver comparison between Linux and Solaris. That is until today. With interest in Solaris on the rise thanks to Project Indiana, we have decided to finally offer our first quantitative graphics comparison between Linux and Solaris with the NVIDIA proprietary drivers._  + +**[OpenSolaris 2008.05 Gives A New Face To Solaris][35]**  +_In early February, Sun Microsystems had released a second preview release of Project Indiana. For those out of the loop, Project Indiana is the codename for the project led by Ian Murdock at Sun that aims to push OpenSolaris on more desktop and notebook computers by addressing the long-standing usability problems of Solaris. We were far from being impressed by Preview 2 as it hadn't possessed any serious advantages over a GNU/Linux desktop that would interest normal users. However, with the release of OpenSolaris 2008.05 "Project Indiana" coming up in May, Sun Microsystems has today released a final test copy of this operating system. Our initial experience with this new OpenSolaris release is vastly better than what we had encountered less than three months ago when last looking at Project Indiana._  + +**[A Quick Tour Of Oracle Solaris 11][36]**  +_Solaris 11 was released on Wednesday as the first major update to the former Sun operating system in seven years. A lot has changed in the Solaris stack in the past seven years, and OpenSolaris has come and gone in that time, but in this article is a brief look through the brand new Oracle Solaris 11 release._  + +**[New Benchmarks Of OpenSolaris, BSD & Linux][37]**  +_Earlier today we put out benchmarks of ZFS on Linux via a native kernel module that will be made publicly available to bring this Sun/Oracle file-system over to more Linux users. Now though as a bonus we happen to have new benchmarks of the latest OpenSolaris-based distributions, including OpenSolaris, OpenIndiana, and Augustiner-Schweinshaxe, compared to PC-BSD, Fedora, and Ubuntu._  + +**[FreeBSD/PC-BSD 9.1 Benchmarked Against Linux, Solaris, BSD][38]**  +_While FreeBSD 9.1 has yet to be officially released, the FreeBSD-based PC-BSD 9.1 "Isotope" release has already been made available this month. In this article are performance benchmarks comparing the 64-bit release of PC-BSD 9.1 against DragonFlyBSD 3.0.3, Oracle Solaris Express 11.1, CentOS 6.3, Ubuntu 12.10, and a development snapshot of Ubuntu 13.04._ + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://www.phoronix.com/assets/categories/michaellarabel.jpg) + +Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com. + +-------------------------------------------------------------------------------- + +via: https://www.phoronix.com/scan.php?page=news_item&px=Solaris-2017-Look-Back + +作者:[Michael Larabel][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:http://www.phoronix.com/image-viewer.php?id=982&image=sun_sxce81_03_lrg +[2]:http://www.phoronix.com/image-viewer.php?id=711&image=java7_bash_13_lrg +[3]:http://www.phoronix.com/image-viewer.php?id=sun_sxce_farewell&image=sun_sxce_07_lrg +[4]:http://www.phoronix.com/image-viewer.php?id=solaris_200805&image=opensolaris_indiana_03b_lrg +[5]:http://www.phoronix.com/image-viewer.php?id=oracle_solaris_11&image=oracle_solaris11_02_lrg +[6]:http://www.phoronix.com/scan.php?page=news_item&px=NjA0Mg +[7]:http://www.phoronix.com/scan.php?page=news_item&px=NjAzNQ +[8]:http://www.phoronix.com/scan.php?page=news_item&px=ODUwNQ +[9]:http://www.phoronix.com/scan.php?page=news_item&px=NjA0Nw +[10]:http://www.phoronix.com/scan.php?page=news_item&px=NjAwNA +[11]:http://www.phoronix.com/scan.php?page=news_item&px=NjAxMQ +[12]:http://www.phoronix.com/scan.php?page=news_item&px=ODAwNg +[13]:http://www.phoronix.com/scan.php?page=news_item&px=NTkzMQ +[14]:http://www.phoronix.com/scan.php?page=news_item&px=NTk4NA +[15]:http://www.phoronix.com/scan.php?page=news_item&px=MTAzMDE +[16]:http://www.phoronix.com/scan.php?page=news_item&px=MTI5MTU +[17]:http://www.phoronix.com/scan.php?page=news_item&px=MTM4Njc +[18]:http://www.phoronix.com/scan.php?page=news_item&px=NTk2Ng +[19]:http://www.phoronix.com/scan.php?page=news_item&px=MTAzOTc +[20]:http://www.phoronix.com/scan.php?page=news_item&px=Oracle-Solaris-Demise-Rumors +[21]:http://www.phoronix.com/scan.php?page=news_item&px=NTk4Nw +[22]:http://www.phoronix.com/scan.php?page=news_item&px=NTkyMA +[23]:http://www.phoronix.com/scan.php?page=news_item&px=NTg5Nw +[24]:http://www.phoronix.com/scan.php?page=news_item&px=OTgzNA +[25]:http://www.phoronix.com/scan.php?page=news_item&px=MTE5OTQ +[26]:http://www.phoronix.com/image-viewer.php?id=opensolaris_200906&image=opensolaris_200906_06_lrg +[27]:http://www.phoronix.com/vr.php?view=13149 +[28]:http://www.phoronix.com/vr.php?view=11968 +[29]:http://www.phoronix.com/vr.php?view=14407 +[30]:http://www.phoronix.com/vr.php?view=14533 +[31]:http://www.phoronix.com/vr.php?view=13475 +[32]:http://www.phoronix.com/vr.php?view=13826 +[33]:http://www.phoronix.com/vr.php?view=14039 +[34]:http://www.phoronix.com/vr.php?view=10301 +[35]:http://www.phoronix.com/vr.php?view=12269 +[36]:http://www.phoronix.com/vr.php?view=16681 +[37]:http://www.phoronix.com/vr.php?view=15476 +[38]:http://www.phoronix.com/vr.php?view=18291 +[39]:http://www.michaellarabel.com/ +[40]:https://www.phoronix.com/scan.php?page=news_topic&q=Oracle +[41]:https://www.phoronix.com/forums/node/925794 +[42]:http://www.phoronix.com/scan.php?page=news_item&px=No-Solaris-12 diff --git a/sources/tech/20170120 How to Install Elastic Stack on CentOS 7.md b/sources/tech/20170120 How to Install Elastic Stack on CentOS 7.md new file mode 100644 index 0000000000..89704e593d --- /dev/null +++ b/sources/tech/20170120 How to Install Elastic Stack on CentOS 7.md @@ -0,0 +1,562 @@ +How to Install Elastic Stack on CentOS 7 +============================================================ + +### On this page + +1. [Step 1 - Prepare the Operating System][1] +2. [Step 2 - Install Java][2] +3. [Step 3 - Install and Configure Elasticsearch][3] +4. [Step 4 - Install and Configure Kibana with Nginx][4] +5. [Step 5 - Install and Configure Logstash][5] +6. [Step 6 - Install and Configure Filebeat on the CentOS Client][6] +7. [Step 7 - Install and Configure Filebeat on the Ubuntu Client][7] +8. [Step 8 - Testing][8] +9. [Reference][9] + +**Elasticsearch** is an open source search engine based on Lucene, developed in Java. It provides a distributed and multitenant full-text search engine with an HTTP Dashboard web-interface (Kibana). The data is queried, retrieved and stored with a JSON document scheme. Elasticsearch is a scalable search engine that can be used to search for all kind of text documents, including log files. Elasticsearch is the heart of the 'Elastic Stack' or ELK Stack. + +**Logstash** is an open source tool for managing events and logs. It provides real-time pipelining for data collections. Logstash will collect your log data, convert the data into JSON documents, and store them in Elasticsearch. + +**Kibana** is an open source data visualization tool for Elasticsearch. Kibana provides a pretty dashboard web interface. It allows you to manage and visualize data from Elasticsearch. It's not just beautiful, but also powerful. + +In this tutorial, I will show you how to install and configure Elastic Stack on a CentOS 7 server for monitoring server logs. Then I'll show you how to install 'Elastic beats' on a CentOS 7 and a Ubuntu 16 client operating system. + +**Prerequisite** + +* CentOS 7 64 bit with 4GB of RAM - elk-master +* CentOS 7 64 bit with 1 GB of RAM - client1 +* Ubuntu 16 64 bit with 1GB of RAM - client2 + +### Step 1 - Prepare the Operating System + +In this tutorial, we will disable SELinux on the CentOS 7 server. Edit the SELinux configuration file. + +vim /etc/sysconfig/selinux + +Change SELINUX value from enforcing to disabled. + +SELINUX=disabled + +Then reboot the server. + +reboot + +Login to the server again and check the SELinux state. + +getenforce + +Make sure the result is disabled. + +### Step 2 - Install Java + +Java is required for the Elastic stack deployment. Elasticsearch requires Java 8, it is recommended to use the Oracle JDK 1.8\. I will install Java 8 from the official Oracle rpm package. + +Download Java 8 JDK with the wget command. + +wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http:%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u77-b02/jdk-8u77-linux-x64.rpm" + +Then install it with this rpm command; + +rpm -ivh jdk-8u77-linux-x64.rpm + +Finally, check java JDK version to ensure that it is working properly. + +java -version + +You will see Java version of the server. + +### Step 3 - Install and Configure Elasticsearch + +In this step, we will install and configure Elasticsearch. I will install Elasticsearch from an rpm package provided by elastic.co and configure it to run on localhost (to make the setup secure and ensure that it is not reachable from the outside). + +Before installing Elasticsearch, add the elastic.co key to the server. + +rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch + +Next, download Elasticsearch 5.1 with wget and then install it. + +wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.rpm +rpm -ivh elasticsearch-5.1.1.rpm + +Elasticsearch is installed. Now go to the configuration directory and edit the elasticsaerch.yml configuration file. + +cd /etc/elasticsearch/ +vim elasticsearch.yml + +Enable memory lock for Elasticsearch by removing a comment on line 40\. This disables memory swapping for Elasticsearch. + +bootstrap.memory_lock: true + +In the 'Network' block, uncomment the network.host and http.port lines. + +network.host: localhost +http.port: 9200 + +Save the file and exit the editor. + +Now edit the elasticsearch.service file for the memory lock configuration. + +vim /usr/lib/systemd/system/elasticsearch.service + +Uncomment LimitMEMLOCK line. + +LimitMEMLOCK=infinity + +Save and exit. + +Edit the sysconfig configuration file for Elasticsearch. + +vim /etc/sysconfig/elasticsearch + +Uncomment line 60 and make sure the value is 'unlimited'. + +MAX_LOCKED_MEMORY=unlimited + +Save and exit. + +The Elasticsearch configuration is finished. Elasticsearch will run on the localhost IP address on port 9200, we disabled memory swapping for it by enabling mlockall on the CentOS server. + +Reload systemd, enable Elasticsearch to start at boot time, then start the service. + +sudo systemctl daemon-reload +sudo systemctl enable elasticsearch +sudo systemctl start elasticsearch + +Wait a second for Eelasticsearch to start, then check the open ports on the server, make sure 'state' for port 9200 is 'LISTEN'. + +netstat -plntu + +[ + ![Check elasticsearch running on port 9200](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/1.png) +][10] + +Then check the memory lock to ensure that mlockall is enabled, and check that Elasticsearch is running with the commands below. + +curl -XGET 'localhost:9200/_nodes?filter_path=**.mlockall&pretty' +curl -XGET 'localhost:9200/?pretty' + +You will see the results below. + +[ + ![Check memory lock elasticsearch and check status](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/2.png) +][11] + +### Step 4 - Install and Configure Kibana with Nginx + +In this step, we will install and configure Kibana with a Nginx web server. Kibana will listen on the localhost IP address and Nginx acts as a reverse proxy for the Kibana application. + +Download Kibana 5.1 with wget, then install it with the rpm command: + +wget https://artifacts.elastic.co/downloads/kibana/kibana-5.1.1-x86_64.rpm +rpm -ivh kibana-5.1.1-x86_64.rpm + +Now edit the Kibana configuration file. + +vim /etc/kibana/kibana.yml + +Uncomment the configuration lines for server.port, server.host and elasticsearch.url. + +server.port: 5601 +server.host: "localhost" +elasticsearch.url: "http://localhost:9200" + +Save and exit. + +Add Kibana to run at boot and start it. + +sudo systemctl enable kibana +sudo systemctl start kibana + +Kibana will run on port 5601 as node application. + +netstat -plntu + +[ + ![Kibana running as node application on port 5601](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/3.png) +][12] + +The Kibana installation is finished. Now we need to install Nginx and configure it as reverse proxy to be able to access Kibana from the public IP address. + +Nginx is available in the Epel repository, install epel-release with yum. + +yum -y install epel-release + +Next, install the Nginx and httpd-tools package. + +yum -y install nginx httpd-tools + +The httpd-tools package contains tools for the web server, we will use htpasswd basic authentication for Kibana. + +Edit the Nginx configuration file and remove the **'server { }**' block, so we can add a new virtual host configuration. + +cd /etc/nginx/ +vim nginx.conf + +Remove the server { } block. + +[ + ![Remove Server Block on Nginx configuration](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/4.png) +][13] + +Save and exit. + +Now we need to create a new virtual host configuration file in the conf.d directory. Create the new file 'kibana.conf' with vim. + +vim /etc/nginx/conf.d/kibana.conf + +Paste the configuration below. + +``` +server { +    listen 80; + +    server_name elk-stack.co; + +    auth_basic "Restricted Access"; +    auth_basic_user_file /etc/nginx/.kibana-user; + +    location / { +        proxy_pass http://localhost:5601; +        proxy_http_version 1.1; +        proxy_set_header Upgrade $http_upgrade; +        proxy_set_header Connection 'upgrade'; +        proxy_set_header Host $host; +        proxy_cache_bypass $http_upgrade; +    } +} +``` + +Save and exit. + +Then create a new basic authentication file with the htpasswd command. + +sudo htpasswd -c /etc/nginx/.kibana-user admin +TYPE YOUR PASSWORD + +Test the Nginx configuration and make sure there is no error. Then add Nginx to run at the boot time and start Nginx. + +nginx -t +systemctl enable nginx +systemctl start nginx + +[ + ![Add nginx virtual host configuration for Kibana Application](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/5.png) +][14] + +### Step 5 - Install and Configure Logstash + +In this step, we will install Logsatash and configure it to centralize server logs from clients with filebeat, then filter and transform the Syslog data and move it into the stash (Elasticsearch). + +Download Logstash and install it with rpm. + +wget https://artifacts.elastic.co/downloads/logstash/logstash-5.1.1.rpm +rpm -ivh logstash-5.1.1.rpm + +Generate a new SSL certificate file so that the client can identify the elastic server. + +Go to the tls directory and edit the openssl.cnf file. + +cd /etc/pki/tls +vim openssl.cnf + +Add a new line in the '[ v3_ca ]' section for the server identification. + +[ v3_ca ] + +# Server IP Address +subjectAltName = IP: 10.0.15.10 + +Save and exit. + +Generate the certificate file with the openssl command. + +openssl req -config /etc/pki/tls/openssl.cnf -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout /etc/pki/tls/private/logstash-forwarder.key -out /etc/pki/tls/certs/logstash-forwarder.crt + +The certificate files can be found in the '/etc/pki/tls/certs/' and '/etc/pki/tls/private/' directories. + +Next, we will create new configuration files for Logstash. We will create a new 'filebeat-input.conf' file to configure the log sources for filebeat, then a 'syslog-filter.conf' file for syslog processing and the 'output-elasticsearch.conf' file to define the Elasticsearch output. + +Go to the logstash configuration directory and create the new configuration files in the 'conf.d' subdirectory. + +cd /etc/logstash/ +vim conf.d/filebeat-input.conf + +Input configuration: paste the configuration below. + +``` +input { +  beats { +    port => 5443 +    ssl => true +    ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt" +    ssl_key => "/etc/pki/tls/private/logstash-forwarder.key" +  } +} +``` + +Save and exit. + +Create the syslog-filter.conf file. + +vim conf.d/syslog-filter.conf + +Paste the configuration below. + +``` +filter { +  if [type] == "syslog" { +    grok { +      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" } +      add_field => [ "received_at", "%{@timestamp}" ] +      add_field => [ "received_from", "%{host}" ] +    } +    date { +      match => [ "syslog_timestamp", "MMM  d HH:mm:ss", "MMM dd HH:mm:ss" ] +    } +  } +} +``` + +We use a filter plugin named '**grok**' to parse the syslog files. + +Save and exit. + +Create the output configuration file 'output-elasticsearch.conf'. + +vim conf.d/output-elasticsearch.conf + +Paste the configuration below. + +``` +output { +  elasticsearch { hosts => ["localhost:9200"] +    hosts => "localhost:9200" +    manage_template => false +    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}" +    document_type => "%{[@metadata][type]}" +  } +} +``` + +Save and exit. + +Finally add logstash to start at boot time and start the service. + +sudo systemctl enable logstash +sudo systemctl start logstash + +[ + ![Logstash started on port 5443 with SSL Connection](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/6.png) +][15] + +### Step 6 - Install and Configure Filebeat on the CentOS Client + +Beats are data shippers, lightweight agents that can be installed on the client nodes to send huge amounts of data from the client machine to the Logstash or Elasticsearch server. There are 4 beats available, 'Filebeat' for 'Log Files', 'Metricbeat' for 'Metrics', 'Packetbeat' for 'Network Data' and 'Winlogbeat' for the Windows client 'Event Log'. + +In this tutorial, I will show you how to install and configure 'Filebeat' to transfer data log files to the Logstash server over an SSL connection. + +Login to the client1 server. Then copy the certificate file from the elastic server to the client1 server.  + +ssh root@client1IP + +Copy the certificate file with the scp command. + +scp root@elk-serverIP:~/logstash-forwarder.crt . +TYPE elk-server password + +Create a new directory and move certificate file to that directory. + +sudo mkdir -p /etc/pki/tls/certs/ +mv ~/logstash-forwarder.crt /etc/pki/tls/certs/ + +Next, import the elastic key on the client1 server. + +rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch + +Download Filebeat and install it with rpm. + +wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.1.1-x86_64.rpm +rpm -ivh filebeat-5.1.1-x86_64.rpm + +Filebeat has been installed, go to the configuration directory and edit the file 'filebeat.yml'. + +cd /etc/filebeat/ +vim filebeat.yml + +In the paths section on line 21, add the new log files. We will add two files '/var/log/secure' for ssh activity and '/var/log/messages' for the server log. + +  paths: +    - /var/log/secure +    - /var/log/messages + +Add a new configuration on line 26 to define the syslog type files. + +  document-type: syslog + +Filebeat is using Elasticsearch as the output target by default. In this tutorial, we will change it to Logshtash. Disable Elasticsearch output by adding comments on the lines 83 and 85. + +Disable elasticsearch output. + +#-------------------------- Elasticsearch output ------------------------------ +#output.elasticsearch: +  # Array of hosts to connect to. +#  hosts: ["localhost:9200"] + +Now add the new logstash output configuration. Uncomment the logstash output configuration and change all value to the configuration that is shown below. + +output.logstash: +  # The Logstash hosts +  hosts: ["10.0.15.10:5443"] +  bulk_max_size: 1024 +  ssl.certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"] +  template.name: "filebeat" +  template.path: "filebeat.template.json" +  template.overwrite: false + +Save the file and exit vim. + +Add Filebeat to start at boot time and start it. + +sudo systemctl enable filebeat +sudo systemctl start filebeat + +### Step 7 - Install and Configure Filebeat on the Ubuntu Client + +Connect to the server by ssh. + +ssh root@ubuntu-clientIP + +Copy the certificate file to the client with the scp command. + +scp root@elk-serverIP:~/logstash-forwarder.crt . + +Create a new directory for the certificate file and move the file to that directory. + +sudo mkdir -p /etc/pki/tls/certs/ +mv ~/logstash-forwarder.crt /etc/pki/tls/certs/ + +Add the elastic key to the server. + +wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - + +Download the Filebeat .deb package and install it with the dpkg command. + +wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.1.1-amd64.deb +dpkg -i filebeat-5.1.1-amd64.deb + +Go to the filebeat configuration directory and edit the file 'filebeat.yml' with vim. + +cd /etc/filebeat/ +vim filebeat.yml + +Add the new log file paths in the paths configuration section. + +  paths: +    - /var/log/auth.log +    - /var/log/syslog + +Set the document type to syslog. + +  document-type: syslog + +Disable elasticsearch output by adding comments to the lines shown below. + +#-------------------------- Elasticsearch output ------------------------------ +#output.elasticsearch: +  # Array of hosts to connect to. +#  hosts: ["localhost:9200"] + +Enable logstash output, uncomment the configuration and change the values as shown below. + +output.logstash: +  # The Logstash hosts +  hosts: ["10.0.15.10:5443"] +  bulk_max_size: 1024 +  ssl.certificate_authorities: ["/etc/pki/tls/certs/logstash-forwarder.crt"] +  template.name: "filebeat" +  template.path: "filebeat.template.json" +  template.overwrite: false + +Save the file and exit vim. + +Add Filebeat to start at boot time and start it. + +sudo systemctl enable filebeat +sudo systemctl start filebeat + +Check the service status. + +systemctl status filebeat + +[ + ![Filebeat is running on the client Ubuntu](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/12.png) +][16] + +### Step 8 - Testing + +Open your web browser and visit the elastic stack domain that you used in the Nginx configuration,  mine is 'elk-stack.co'. Login as admin user with your password and press Enter to log in to the Kibana dashboard. + +[ + ![Login to the Kibana Dashboard with Basic Auth](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/7.png) +][17] + +Create a new default index 'filebeat-*' and click on the 'Create' button. + +[ + ![Create First index filebeat for Kibana](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/8.png) +][18] + +Th default index has been created. If you have multiple beats on the elastic stack, you can configure the default beat with just one click on the 'star' button. + +[ + ![Filebeat index as default index on Kibana Dashboard](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/9.png) +][19] + +Go to the '**Discover**' menu and you will see all the log file from the elk-client1 and elk-client2 servers. + +[ + ![Discover all Log Files from the Servers](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/10.png) +][20] + +An example of JSON output from the elk-client1 server log for an invalid ssh login. + +[ + ![JSON output for Failed SSH Login](https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/11.png) +][21] + +And there is much more that you can do with Kibana dashboard, just play around with the available options. + +Elastic Stack has been installed on a CentOS 7 server. Filebeat has been installed on a CentOS 7 and a Ubuntu client. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/ + +作者:[Muhammad Arul][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/ +[1]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-nbspprepare-the-operating-system +[2]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-install-java +[3]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-install-and-configure-elasticsearch +[4]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-install-and-configure-kibana-with-nginx +[5]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-install-and-configure-logstash +[6]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-install-and-configure-filebeat-on-the-centos-client +[7]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-install-and-configure-filebeat-on-the-ubuntu-client +[8]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#step-testing +[9]:https://www.howtoforge.com/tutorial/how-to-install-elastic-stack-on-centos-7/#reference +[10]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/1.png +[11]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/2.png +[12]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/3.png +[13]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/4.png +[14]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/5.png +[15]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/6.png +[16]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/12.png +[17]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/7.png +[18]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/8.png +[19]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/9.png +[20]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/10.png +[21]:https://www.howtoforge.com/images/how-to-install-elastic-stack-on-centos-7/big/11.png diff --git a/sources/tech/20170123 Linux command line navigation tipstricks 3 - the CDPATH environment variable.md b/sources/tech/20170123 Linux command line navigation tipstricks 3 - the CDPATH environment variable.md new file mode 100644 index 0000000000..9a03fb2102 --- /dev/null +++ b/sources/tech/20170123 Linux command line navigation tipstricks 3 - the CDPATH environment variable.md @@ -0,0 +1,128 @@ +Linux command line navigation tips/tricks 3 - the CDPATH environment variable +============================================================ + +### On this page + +1. [The CDPATH environment variable][1] +2. [Points to keep in mind][2] +3. [Conclusion][3] + +In the first part of this series, we discussed the **cd -** command in detail, and the in the second part, we took an in-depth look into the **pushd** and **popd** commands as well as the scenarios where-in they come in handy. + +Continuing with our discussion on the command line navigation aspects, in this tutorial, we'll discuss the **CDPATH** environment variable through easy to understand examples. We'll also discuss some advance details related to this variable. + +_But before we proceed, it's worth mentioning that all the examples in this tutorial have been tested on Ubuntu 14.04 with Bash version 4.3.11(1)._ + +### The CDPATH environment variable + +Even if your command line work involves performing all operations under a particular directory - say your home directory - then also you have to provide absolute paths while switching directories. For example, consider a situation where-in I am in _/home/himanshu/Downloads_ directory: + +$ pwd +/home/himanshu/Downloads + +And the requirement is to switch to the _/home/himanshu/Desktop_ directory. To do this, usually, I'll have to either run: + +cd /home/himanshu/Desktop/ + +or  + +cd ~/Desktop/ + +or + +cd ../Desktop/ + +Wouldn't it be easy if I could just run the following command: + +cd Desktop + +Yes, that's possible. And this is where the CDPATH environment variable comes in.You can use this variable to define the base directory for the **cd** command. + +If you try printing its value, you'll see that this env variable is empty by default: + +$ echo $CDPATH +$ + +Now, considering the case we've been discussing so far, let's use this environment variable to define _/home/himanshu_ as the base directory for the cd command. + +The easiest way to do this is: + +export CDPATH=/home/himanshu + +And now, I can do what I wasn't able to do earlier - from within the _/home/himanshu/Downloads_ directory, run the _cd Desktop_ command successfully. + +$ pwd +/home/himanshu/Downloads +$ **cd Desktop/** +**/home/himanshu/Desktop** +$ + +This means that I can now do a cd to any directory under _/home/himanshu_ without explicitly specifying _/home/himanshu_ or _~_ or _../_ (or multiple _../_)in the cd command. + +### Points to keep in mind + +So you now know how we used the CDPATH environment variable to easily switch to/from _/home/himanshu/Downloads_ from/to _/home/himanshu/Desktop_. Now, consider a situation where-in the _/home/himanshu/Desktop_ directory contains a subdirectory named _Downloads_, and it's the latter where you intend to switch. + +But suddenly you realize that doing a _cd Desktop_ will take you to _/home/himanshu/Desktop_. So, to make sure that doesn't happen, you do: + +cd ./Downloads + +While there's no problem in the aforementioned command per se, that's an extra effort on your part (howsoever little it may be), especially considering that you'll have to do this each time such a situation arises. A more elegant solution to this problem can be to originally set the CDPATH variable in the following way: + +export CDPATH=".:/home/himanshu" + +This means, you're telling the cd command to first look for the directory in the current working directory, and then try searching the _/home/himanshu_ directory. Of course, whether or not you want the cd command to behave this way depends entirely on your preference or requirement - my idea behind discussing this point was to let you know that this kind of situation may arise. + +As you would have understood by now, once the CDPATH env variable is set, it's value - or the set of paths it contains - are the only places on the system where the cd command searches for directories (except of course the scenarios where-in you use absolute paths). So, it's entirely up to you to make sure that the behavior of the command remains consistent. + +Moving on, if there's a bash script that uses the cd command with relative paths, then it's better to clear or unset the CDPATH environment variable first, unless you are ok with getting trapped into unforeseen problems. Alternatively, rather than using the _export_ command on the terminal to set CDPATH, you can set the environment variable in your `.bashrc` file after testing for interactive/non-interactive shells to make sure that the change you're trying to make is only reflected in interactive shells. + +The order in which paths appear in the environment variable's value is also important. For example, if current directory is listed before _/home/himanshu_, then the cd command will first search for a directory in the present working directory and then move on to _/home/himanshu_. However, if the value is _"/home/himanshu:."_ then the first search will be made in _/home/himanshu_ and after that the current directory. Needless to say, this will effect what the cd command does, and may cause problems if you aren't aware of the order of paths. + +Always keep in mind that the CDPATH environment variable, as the name suggests, works only for the cd command. This means that while inside the _/home/himanshu/Downloads_ directory, you can run the _cd Desktop_ command to switch to _/home/himanshu/Desktop_ directory, but you can't do an _ls_. Here's an example: + +$ pwd +/home/himanshu/Downloads +**$ ls Desktop** +**ls: cannot access Desktop: No such file or directory** +$ + +However, there could be some simple workarounds. For example, we can achieve what we want with minimal effort in the following way: + +$ **cd Desktop/;ls** +/home/himanshu/Desktop +backup backup~ Downloads gdb.html outline~ outline.txt outline.txt~ + +But yeah, there might not be a workaround for every situation. + +Another important point: as you might have observed, whenever you use the cd command with the CDPATH environment variable set, the command produces the full path of directory you are switching to in the output. Needless to say, not everybody would want to have this information each time they run the cd command on their machine.  + +To make sure this output gets suppressed, you can use the following command: + +alias cd='>/dev/null cd' + +The aforementioned command will mute the output whenever the cd command is successful, but will allow the error messages to be produced whenever the command fails. + +Lastly, in case you face a problem where-in after setting the CDPATH environment variable, you can't use the shell's tab completion feature, then you can try installing and enabling bash-completion - more on it [here][4]. + +### Conclusion + +The CDPATH environment variable is a double edged sword - if not used with caution and complete knowledge, it may land you in some complex traps that may require a lot of your time precious time to get resolved. Of course, that doesn't mean you should never give it a try; just evaluate all the available options and if you conclude that using CDPATH would be of great help, then do go ahead and use it. + +Have you been using CDPATH like a pro? Do you have some more tips to share? Please share your thoughts in comments below. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-3-cdpath/ + +作者:[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-tips-tricks-part-3-cdpath/ +[1]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-3-cdpath/#the-cdpath-environment-variable +[2]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-3-cdpath/#points-to-keep-in-mind +[3]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-3-cdpath/#conclusion +[4]:http://bash-completion.alioth.debian.org/ diff --git a/sources/tech/20170125 An executives guide to containers.md b/sources/tech/20170125 An executives guide to containers.md new file mode 100644 index 0000000000..6967275d56 --- /dev/null +++ b/sources/tech/20170125 An executives guide to containers.md @@ -0,0 +1,130 @@ +An executive's guide to containers +============================================================ + + ![An executive's guide to containers](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/containers_2015-1-osdc-lead.png?itok=E1imOYe4 "An executive's guide to containers") +Image credits : [Maersk Line][1]. [CC SA-BY 4.0][2] + +Discussions with IT leaders about "[containers][4]" can often be summarized as this: + +_As a CxO, I face the constant challenge of doing more with less. IT budgets continue to decrease and I have less resources, yet the amount of work to deliver is greater than ever before. I spend far too many hours dedicated to resolving budgetary constraints. In addition, the IT landscape is undergoing a rapid change and new technologies are being introduced all the time. The latest topic I hear from my trusted advisors is the implementation of a "container strategy." I want to understand:_ + +1. _What are containers?_ +2. _What is the enterprise value to transitioning to containers?_ +3. _Why should I shift to containers now? Are there disadvantages if we don't adopt?_ +4. _Are containers mature enough for enterprise consumption?_ +5. _How do I get my enterprise up to speed with container adoption?_ + +Let's start at the beginning. + +### Containers + +In the past 10 years or so, enterprises have moved from physical infrastructure to virtual machines (VMs). The key advantage of moving towards VMs is a reduction in the datacenter footprint. You can fit more applications on a fewer number of physical machines by running multiple VMs on the same physical box. Using containers is another way of packing applications in a much lighter weight and with a much faster delivery model. They are a fancy way of running multiple application processes on a single box, regardless of whether that box is a VM or a physical machine. In addition, containers also play a major role in the context of fulfilling DevOps, microservices, and cloud strategy. + +### Containers versus VMs + +Containers differ from VMs in a few simple ways. A VM, while not a physical machine, behaves just like one. It is an isolated environment that includes everything, starting with a complete (guest) operating system. On the other hand, containers are processes that share the resources on the same machine, which could be physical or virtual. Containers are notably interesting because: + +* VMs are heavy, comparatively. Containers are light because they only include those libraries needed by the applications they run. +* VMs take minutes to start up. Containers start up in seconds. +* Typically, many more containers fit into your infrastructure than VMs. + + ![Containers versus VMs](https://opensource.com/sites/default/files/containersvmvscontainers.png "Containers versus VMs") + +The technology has evolved enough to keep these containers secure, isolated from each other, and "with right design choices" to make sure that bad containers don't affect the performance of other containers running on the same box. In fact, operating systems are built to optimize and run containers natively. + +Still, you need to make the right choices when moving toward containers. You need to do enough due diligence so you choose the right technology partners and vendors to enable containers. Open source technologies play a key role. The open source [Docker project][5] has made containers with a layering format that is easy to build and use. The [Open Container Initiative][6] (OCI) has become an open source standard for containers supported by all major technology vendors. Open source technology providers like Red Hat make container-ready, secure operating systems available. For example, Red Hat Enterprise Linux 7.x , including Red Hat Enterprise Linux Atomic Host, are optimized to run containers natively and also provide tools to monitor and manage containers. Other open source projects such as CoreOS from Tectonic are also coming into the market. Indeed, containers are ready for adoption by enterprises. + +### Container platforms + +Container platforms make containers enterprise-consumable. You may have dealt with VM sprawl in your enterprises over the past decade, and container sprawl can be many times worse. Running your containers at scale across the various hosts in your datacenter, ensuring high availability for your applications despite container failure, automated health checks, automated scaling of containers based on incoming workloads, etc., are some of the key features you can expect from a container platform. + +While running containers on such a platform is positioned as Container-as-a-Service model (CaaS), some additional features of these platforms, such as build and deployment automation, make this platform a full-fledged Platform-as-a-Service (PaaS). While CaaS can run containers for you at scale, PaaS would take your source code, build it, create containers, and run those containers for you. In addition, these platforms provide complete operations management features, such as management and monitoring of the cluster, detection of security flaws with the containers and run safe containers, tracking logs and metrics, etc. + +While some vendors are using their proprietary technologies to build container platforms, in general, companies are standardizing them around open source technologies built around [Kubernetes][7] (or K8S in short). K8S is an open source project that was started by Google, and many large platform vendors now support it. K8S is also part of [Cloud Native Computing Foundation][8] (CNCF), which is evolving as a standards body for cloud-centric technologies. Standardization around open source orchestration technologies is very important when you make your choices on a container platform. It basically allows you be portable across container platforms if you don't like the choice you made the first time. K8S also allows your container workloads to be portable across different public clouds. These are the reasons why we see more and more technology companies using Kubernetes. + +A few enterprises are trying to build their own DIY container platforms by stitching together several open source projects that include K8S. This is definitely a better solution than going with proprietary technologies, but it also includes lot of plumbing to get it to work. However, an enterprise's ability to sustain and maintain such DIY platforms should be considered seriously. Many enterprises are not in the job of creating IT Platforms, rather they wish to run their mainstream business. There are many K8S-based solutions available, such as [Red Hat's OpenShift Container Platform][9], [Apprenda][10], [Deis][11], [Rancher][12], etc., which provide enterprise-ready versions of a platform, each with different levels of maturity in terms of features they provide. + +These solutions are certified and supported by vendors. Some of these are comprehensive open source PaaS solutions, while others may be CaaS. Based on your enterprise needs, these solutions may serve as better alternatives than a DIY container platform. + +### Enterprise concerns and their relationship to containers + +Today, almost every enterprise is dealing with a digital transformation that impacts multiple areas, including strategies for DevOps, microservices, and the cloud. Containers play a particular role in each of these areas. + +### DevOps strategy + +IT organizations are divided into operations and application development. They operate as two separate teams, and each has its own set of goals. Most of the enterprises are moving in the direction of DevOps to bring these two teams together. + +Containers have a major role to play in the success of DevOps initiatives. One of the key success criteria in DevOps is to increase the developer's stake in operations. Developers should not only hand off code to operations, but also, they should be concerned about how their code runs in the production. The common technique is to treat "infrastructure as code." Rather than provide pages of installation instructions that are error prone, the development team should provide the environment setup as code. + +This is the exact problem that containers solve. Container images, which are templates for containers, include the entire stack, starting from the base operating system through to the application code. With containers, developers would not just build an application artifact (such as a .jar file) from Dev to QA to Prod; instead, they would pass a versioned container image that includes both the built artifact and the environment in which the artifact runs. The container is all inclusive, with everything from operating system libraries to middleware to the application bundled into one image. Therefore, the way the container runs in Development is the same exact way it runs in QA and Production. Containers are essential ingredients for DevOps success. + + ![Container-based model](https://opensource.com/sites/default/files/containerbasedmodel.png "Container-based model") + +In addition, container platforms are going a step further. Typical Continuous Integration and Delivery (CICD) tools, such as [Jenkins][13], are available as containers that run the entire CICD process on the container platform itself without the need for additional infrastructure. Now, you can use the PaaS platform to build and run your CICD pipelines. + +### Microservices strategy + +[Microservices][14] are another hot topic in IT today. Breaking down applications into discrete, small services, each of which do a small job, pretty well, is how applications are being designed. Each of these microservices could be written in a different language based on the technology suitable. They would be created and managed by small (two-pizza fed) teams and they can be changed fast. All these requirements again allude to containers. Containers are small enough to be the foundation for microservices. Containers can support any technology and language of your choice. They are easy to create and run and can be changed fast. Microservices and containers are considered married now, and if people talk of implementing microservices without using containers, they are often given a strange look. + +The reality is that while microservices promise simplicity, their proliferation also increases complexity. Several microservices design and deployment patterns are coming up to ease their implementation. This means developers are now in need of a platform where they can deploy and orchestrate these microservices with ease and that: + +* Implements these microservices design patterns, in a language agnostic way +* Does not increase the complexity of code with code intrusion so that developers have to include a great deal of pattern code into their business logic +* Is flexible enough to deploy on the infrastructure of your choice and not does not tie you to particular clouds + +This is where choosing a right container platform comes into play. Implementing these microservices on specific infrastructures in a particular vendor's way will tie your applications to those vendor platforms. Containerizing microservices using standard technologies such as OCI-compliant containers will ensure your microservices can be run on any OCI-compliant platform. + +Choosing the right container platform to run your microservices is another important decision to make. Today there are very few choices and a lot of FUD. Some of these choices would take you down the non-standard, vendor-specific route if you are not diligent enough when making this choice. + +### Cloud strategy + +Cloud strategy is one more hot topic in IT. Whether you like it or not, the "as-a-Service" model is an inevitable change. If you don't provide this as a service from IT, your development teams will probably find ways to create shadow IT to get to the cloud. In addition, while using the cloud will move you from capital expenditure to operating expenditure, managing cloud expenditure is a constant challenge. + +Cloud provides VMs, and you want to make sure that the CPU, memory and network resources on this cloud are used optimally before you spin up additional VMs. Containers play an important role here. Because containers are much smaller than VMs, and if your applications are run in containers, you can fit more containers in VMs than running one application component per VM. + +Public cloud vendors are numerous, with Amazon Web Services (AWS), Microsoft Azure, and Google Cloud being a few of the more popular ones. In addition, you may want your own private cloud in your datacenter based on OpenStack. Each of these cloud environments have their own protocols, APIs, and tools. While you want your applications to run on the cloud, you don't want to make your application orchestration be cloud vendor specific and you don't want to maintain any cloud-specific code. Locking in your technology with a specific cloud vendor is like signing blank checks to the vendor for years to come. + +Portability across the cloud is important to your cloud strategy. You can write your applications without worrying about where they run, and the container platform shields you from specific cloud vendor protocols, preventing you from being locked in with one cloud vendor. + +### Legacy systems + +The pluses brought to development by the microservices architecture are many, but not every application can be refactored into them and some only in part. Traditional applications are here to stay and they need to be maintained and managed. While containers enable microservices, containers are not _just_ microservices. Conceivably, you can run large applications and non-microservices as containers, so as long as you choose the right container technology and the right application platform, you can run many, if not all, legacy applications as containers. + +### Wrapping up + +I hope this deep dive into various strategies and containers helps your company evaluate your next step. Let me know in the comments lessons your company has learned or if they haven't taken the leap, what information they need I haven't provided. + +-------------------------------------------------------------------------------- + +作者简介: + +Veer Muchandi - Open source enthusiast. Container and PaaS advocate. Loves to learn and share. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/container-strategy-for-executives + +作者:[Veer Muchandi][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/veermuchandi +[1]:https://www.flickr.com/photos/maerskline/6955071566 +[2]:https://creativecommons.org/licenses/by-sa/4.0/ +[3]:https://opensource.com/article/17/1/container-strategy-for-executives?rate=DuiecCOvGMj-GXcdlJsN8xdZJ82yPUX1M3M9ZNkT99A +[4]:https://opensource.com/resources/what-are-linux-containers +[5]:https://opensource.com/resources/what-docker +[6]:https://opensource.com/business/16/8/inside-look-future-linux-containers +[7]:https://opensource.com/resources/what-is-kubernetes +[8]:https://www.cncf.io/ +[9]:https://www.openshift.com/container-platform/ +[10]:https://apprenda.com/ +[11]:http://deis.io/ +[12]:http://rancher.com/ +[13]:https://jenkins.io/ +[14]:https://opensource.com/resources/what-are-microservices +[15]:https://opensource.com/user/92826/feed +[16]:https://opensource.com/article/17/1/container-strategy-for-executives#comments +[17]:https://opensource.com/users/veermuchandi diff --git a/sources/tech/20170125 Command line aliases in the Linux Shell.md b/sources/tech/20170125 Command line aliases in the Linux Shell.md new file mode 100644 index 0000000000..d223917d3c --- /dev/null +++ b/sources/tech/20170125 Command line aliases in the Linux Shell.md @@ -0,0 +1,138 @@ +Command line aliases in the Linux Shell +============================================================ + +### On this page + +1. [Command line aliases in Linux][1] +2. [Related details][2] +3. [Conclusion][3] + +So far, in this tutorial series, we have discussed the basic usage as well as related details of the [cd -][5] and **pushd**/**popd** commands, as well as the **CDPATH** environment variable. In this fourth and the final installment, we will discuss the concept of aliases as well how you can use them to make your command line navigation easier and smoother. + +As always, before jumping on to the heart of the tutorial, it's worth sharing 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). + +### Command line aliases in Linux + +In layman's terms, aliases can be thought of as short names or abbreviations to a complex command or a group of commands, including their arguments or options. So basically, with aliases, you create easy to remember names for not-so-easy-to-type/remember commands. + +For example, the following command creates an alias 'home' for the 'cd ~' command: + +alias home="cd ~" + +This means that now you can quickly type 'home' and press enter whenever you want to come back to your home directory from anywhere on your system. + +Here's what the alias command man page says about this utility: + +``` +The alias utility shall create or redefine alias definitions or write the values of existing alias definitions to standard output. An alias definition provides a string value that shall replace a command name when it is encountered + +An alias definition shall affect the current shell execution environment and the execution environments of the subshells of the current shell. When used as specified by this volume of IEEE Std 1003.1-2001, the alias definition shall not affect the parent process of the current shell nor any utility environment invoked by the shell. +``` + +So, how exactly aliases help in command line navigation? Well, here's a simple example: + +Suppose you are working in the _/home/himanshu/projects/howtoforge_ directory, which further contains many subdirectories, and sub-subdirectories. For example, following is one complete directory branch: + +``` +/home/himanshu/projects/howtoforge/command-line/navigation/tips-tricks/part4/final +``` + +Now imagine, you are in the 'final' directory, and then you want to get back to the 'tips-tricks' directory, and from there, you need to get back to the 'howtoforge' directory. What would you do? + +Well, normally, you'd run the following set of commands: + +cd ../.. + +cd ../../.. + +While this approach isn't wrong per se, it's definitely not convenient, especially when you've to go back, say 5 directories in a very long path. So, what's the solution? The answer is: aliases. + +What you can do is, you can create easy to remember (and type) aliases for each of the _cd .._ commands. For example: + +alias bk1="cd .." +alias bk2="cd ../.." +alias bk3="cd ../../.." +alias bk4="cd ../../../.." +alias bk5="cd ../../../../.." + +So now whenever you want to go back, say 5 places, from your current working directory, you can just run the following command: + +bk5 + +Isn't that easy now? + +### Related details + +While the technique we've used to define aliases so far (using the alias command) on the shell prompt does the trick, the aliases exist only for the current terminal session. There are good chances that you may want aliases defined by you to persist so that they can be used in any new command line terminal window/tab you launch thereafter. + +For this, you need to define your aliases in the _~/.bash_aliases_ file, which is loaded by your _~/.bashrc_ file by default (please verify this if you are using an older Ubuntu version). + +Following is the excerpt from my .bashrc file that talks about the .bash_aliases file: + +``` +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi +``` + +Once you've added an alias definition to your .bash_aliases file, that alias will be available on any and every new terminal. However, you'll not be able to use it in any other terminal which was already open when you defined that alias - the way out is to source .bashrc from those terminals. Following is the exact command that you'll have to run: + +source ~/.bashrc + +If that sounds a little too much of work (yes, I am looking at you LAZY ONES), then here's a shortcut to do all this: + +"alias [the-alias]" >> ~/.bash_aliases && source ~/.bash_aliases + +Needless to say, you'll have to replace [the-alias] with the actual command. For example: + +"alias bk5='cd ../../../../..'" >> ~/.bash_aliases && source ~/.bash_aliases + +Moving on, now suppose you've created some aliases, and have been using them on and off for a few months. Suddenly, one day, you doubt that one of them isn't working as expected. So you feel the need to look at the exact command that was assigned to that alias. What would you do? + +Of course, you can open your .bash_aliases file and take a look there, but this process can be a bit time consuming, especially when the file contains a lot of aliases. So, if you're looking for an easy way out, here's one: all you have to do is to run the _alias_ command with the alias-name as argument. + +Here's an example: + +$ alias bk6 +alias bk6='cd ../../../../../..' + +As you can see, the aforementioned command displayed the actual command assigned to the bk6 alias. There's one more way: to use the _type_ command. Following is an example: + +$ type bk6 +bk6 is aliased to `cd ../../../../../..' + +So the type command produces a more human-understandable output. + +Another thing worth sharing here is that you can use aliases for the common typos you make. For example: + +alias mroe='more' + +_Finally, it's also worth mentioning that not everybody is in favor of using aliases. Most of them argue that once you get used to the aliases you define for your ease, it gets really difficult for you to work on some other system where those aliases don't exist (and you're not allowed to create any as well). For more (as well as precise reasons) why some experts don't recommend using aliases, you can head[here][4]. _ + +### Conclusion + +Like the CDPATH environment variable we discussed in the previous part, alias is also a double edged sword that one should use very cautiously. Don't get discouraged though, as everything has its own advantages and disadvantages. Just that practice and complete knowledge is the key when you're dealing with concepts like aliases. + +So this marks the end of this tutorial series. Hope you enjoyed it as well learned some new things/concepts from it. In case you have any doubts or queries, please share them with us (and the rest of the world) in comments below. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/command-line-aliases-in-linux/ + +作者:[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/command-line-aliases-in-linux/ +[1]:https://www.howtoforge.com/tutorial/command-line-aliases-in-linux/#command-line-aliases-in-linux +[2]:https://www.howtoforge.com/tutorial/command-line-aliases-in-linux/#related-details +[3]:https://www.howtoforge.com/tutorial/command-line-aliases-in-linux/#conclusion +[4]:http://unix.stackexchange.com/questions/66934/why-is-aliasing-over-standard-commands-not-recommended +[5]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/ diff --git a/sources/tech/20170126 Useful Meld tipstricks for intermediate users.md b/sources/tech/20170126 Useful Meld tipstricks for intermediate users.md new file mode 100644 index 0000000000..7894ceb69d --- /dev/null +++ b/sources/tech/20170126 Useful Meld tipstricks for intermediate users.md @@ -0,0 +1,134 @@ +Useful Meld tips/tricks for intermediate users +============================================================ + +### On this page + +1. [1\. Navigation][1] +2. [2\. Things you can do with changes][2] +3. [4\. Filtering text][3] + +* [Conclusion][4] + +Meld is a feature-rich visual comparison and merging tool available for Linux. If you're new to the tool, you can head to our [beginner's guide][5] to get a quick know-how of how the utility works. However, if you've already read that, or are already using Meld for basic comparison/merging tasks, you'll be glad to know that in this tutorial, we will be discussing some really useful tips/tricks that will make your experience with the tool even better. + +_But before we jump onto the installation and explanation part, it'd be worth sharing that all the instructions and examples presented in this tutorial have been tested on Ubuntu 14.04 and the Meld version we've used is 3.14.2_. + +### Meld tips/tricks for intermediate users + +### 1\. Navigation + +As you might already know (and we've also mentioned this in our beginner's guide), standard scrolling is not the only way to navigate between changes while using Meld - you can easily switch from one change to another using the up and down arrow keys located in the pane that sits above the edit area: + +[ + ![Navigating in Meld](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-go-next-prev-9.png) +][6] + +However, this requires you to move your mouse pointer to these arrows and then click one of them (depending on where you want to go - up or down) repeatedly. You'll be glad to know that there exists an even easier way to jump between changes: just use your mouse's scroll wheel to perform scrolling when mouse pointer is on the central change bar. + +[ + ![The change bar](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-center-area-scrolling.png) +][7] + +This way, you can navigate between changes without taking your eyes off them, or getting distracted. + +### 2\. Things you can do with changes + +Just look at the last screenshot in the previous section. You know what those black arrows do, right? By default, they let you perform the merge/change operation - merge when there's no confliction, and change when there's a conflict in the same line. + +But do you know you can delete individual changes if you want. Yes, that's possible. For this, all you have to do is to press the Shift key when dealing with changes. You'll observe that arrows get converted into crosses.  + +[ + ![Things you can do with changes](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-delete-changes.png) +][8] + +Just click any of them, and the corresponding change will get deleted. + +Not only delete, you can also make sure that conflicting changes do not change the lines when merged. For example, here's an example of a conflicting change: + +[ + ![Delete changes in Meld](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-conflicting-change.png) +][9]  + +Now, if you click any the two black arrows, the line where the arrow points will get changed, and will become similar to the corresponding line of other file. That's fine as long as you want this to happen. But what if you don't want any of the lines to get changed? Instead, the aim is to insert the changed line above or below the corresponding line in other file. + +What I am trying to say is that, for example, in the screenshot above, the need is to add 'test 2' above or below 'test23', rather than changing 'test23' to 'test2'. You'll be glad to know that even that's possible with Meld. Just like you press the Shift key to delete comments, in this case, you'll have to press the Ctrl key.  + +And you'll observe that the current action will be changed to insert - the dual arrow icons will confirm this. + +[ + ![Change actions](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-ctrl-insert.png) +][10] + +As clear from the direction of arrows, this action helps users to insert the current change above or below (as selected) the corresponding change in other file. + +### 3\. Customize the way files are displayed in Meld's editor area + +There might be times when you would want the text size in Meld's editor area to be a bit large (for better  or more comfortable viewing), or you would want the text lines to wrap instead of going out of visual area (meaning you don't want to use the horizontal scroll bar at the bottom). + +Meld provides some display- and font-related customization options in its _Preferences_ menu under the _Editor_ tab (_Edit->Preferences->Editor_) where you'll be able to make these kind of tweaks: + +[ + ![Meld preferences](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-editor-tab.png) +][11] + +So here you can see that, by default, Meld uses the system defined font width. Just uncheck that box under the _Font_ category, and you'll have a plethora of font type and size options to select from. + +Then in the _Display_ section, you'll see all the customization options we were talking about: you can set Tab width, tell the tool whether or not to insert spaces instead of tabs, enable/disable text wrapping, make Meld show line numbers and whitespaces (very useful in some cases) as well as use syntax highlighting. + +### 4\. Filtering text + +There are times when not all the changes that Meld shows are important to you. For example, while comparing two C programming files, you may not want changes in comments to be shown by Meld as you only want to focus on code-related changes. So, in that case, you can tell Meld to filter (or ignore) comment-related changes. + +For example, here's a Meld comparison where comment-related changes are highlighted by the tool: + +[ + ![Filter Text in Meld](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-changes-with-comments.png) +][12] + +And here's the case where Meld has ignored the same changes, focusing only on the code-related changes: + +[ + ![Ignore Changes in Meld](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-changes-without-comments.png) +][13] + +Cool, isn't it? So, how did that happen? Well, for this, what I did was, I enabled the 'C comments' text filter in _Edit->Preferences->Text Filters_ tab: + +[ + ![C-Comments in Meld](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/meld-text-filters.png) +][14] + +As you can see, aside from 'C comments', you can also filter out C++ comments, Script comments, leading or all whitespaces, and more. What more, you can also define custom text filters for any specific case you are dealing with. For example, if you are dealing with log-files and don't want changes in lines that begin with a particular pattern to be highlighted by Meld, then you can define a custom text filter for that case. + +However, keep in mind that in order to define a new text filter, you need to know Python language as well as how to create regular expressions in that language. + +### Conclusion + +All the four tips/tricks discussed here aren't very difficult to understand and use (except, of course, if you want to create custom text filters right away), and once you start using them, you'll agree that they are really beneficial.  The key here is to keep practicing, otherwise any tip/trick you learn will slip out of your mind in no time. + +Do you know or use any other intermediate level Meld tip or trick? If yes, then you are welcome to share that in comments below. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/ + +作者:[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/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/ +[1]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/#-navigation +[2]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/#-things-you-can-do-with-changes +[3]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/#-filtering-text +[4]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/#conclusion +[5]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/ +[6]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-go-next-prev-9.png +[7]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-center-area-scrolling.png +[8]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-delete-changes.png +[9]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-conflicting-change.png +[10]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-ctrl-insert.png +[11]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-editor-tab.png +[12]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-changes-with-comments.png +[13]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-changes-without-comments.png +[14]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-2/big/meld-text-filters.png diff --git a/sources/tech/20170126 Using rsync to back up your Linux system.md b/sources/tech/20170126 Using rsync to back up your Linux system.md new file mode 100644 index 0000000000..446c2c6d05 --- /dev/null +++ b/sources/tech/20170126 Using rsync to back up your Linux system.md @@ -0,0 +1,117 @@ +Using rsync to back up your Linux system +============================================================ + +### Find out how to use rsync in a backup scenario. + + ![Using rsync to back up your Linux system](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/hard_drives.png?itok=yZWyaSO6 "Using rsync to back up your Linux system") +Image credits : [WIlliam][2][ Warby][3]. Modified by [Jason Baker][4]. Creative Commons [BY-SA 2.0][5]. + +Backups are an incredibly important aspect of a system administrator’s job. Without good backups and a well-planned backup policy and process, it is a near certainty that sooner or later some critical data will be irretrievably lost. + +All companies, regardless of how large or small, run on their data. Consider the financial and business cost of losing all of the data you need to run your business. There is not a business today ranging from the smallest sole proprietorship to the largest global corporation that could survive the loss of all or even a large fraction of its data. Your place of business can be rebuilt using insurance, but your data can never be rebuilt. + +By loss, here, I don't mean stolen data; that is an entirely different type of disaster. What I mean here is the complete destruction of the data. + +Even if you are an individual and not running a large corporation, backing up your data is very important. I have two decades of personal financial data as well as that for my now closed businesses, including a large number of electronic receipts. I also have many documents, presentations, and spreadsheets of various types that I have created over the years. I really don't want to lose all of that. + +So backups are imperative to ensure the long-term safety of my data. + +### Backup options + +There are many options for performing backups. Most Linux distributions are provided with one or more open source programs specially designed to perform backups. There are many commercial options available as well. But none of those directly met my needs so I decided to use basic Linux tools to do the job. + +In my article for the Open Source Yearbook last year, [Best Couple of 2015: tar and ssh][6], I showed that fancy and expensive backup programs are not really necessary to design and implement a viable backup program. + +Since last year, I have been experimenting with another backup option, the [**rsync**][7] command which has some very interesting features that I have been able to use to good advantage. My primary objectives were to create backups from which users could locate and restore files without having to untar a backup tarball, and to reduce the amount of time taken to create the backups. + +This article is intended only to describe my own use of rsync in a backup scenario. It is not a look at all of the capabilities of rsync or the many ways in which it can be used. + +### The rsync command + +The rsync command was written by Andrew Tridgell and Paul Mackerras and first released in 1996\. The primary intention for rsync is to remotely synchronize the files on one computer with those on another. Did you notice what they did to create the name there? rsync is open source software and is provided with almost all major distributions. + +The rsync command can be used to synchronize two directories or directory trees whether they are on the same computer or on different computers but it can do so much more than that. rsync creates or updates the target directory to be identical to the source directory. The target directory is freely accessible by all the usual Linux tools because it is not stored in a tarball or zip file or any other archival file type; it is just a regular directory with regular files that can be navigated by regular users using basic Linux tools. This meets one of my primary objectives. + +One of the most important features of rsync is the method it uses to synchronize preexisting files that have changed in the source directory. Rather than copying the entire file from the source, it uses checksums to compare blocks of the source and target files. If all of the blocks in the two files are the same, no data is transferred. If the data differs, only the block that has changed on the source is transferred to the target. This saves an immense amount of time and network bandwidth for remote sync. For example, when I first used my rsync Bash script to back up all of my hosts to a large external USB hard drive, it took about three hours. That is because all of the data had to be transferred. Subsequent syncs took 3-8 minutes of real time, depending upon how many files had been changed or created since the previous sync. I used the time command to determine this so it is empirical data. Last night, for example, it took just over three minutes to complete a sync of approximately 750GB of data from six remote systems and the local workstation. Of course, only a few hundred megabytes of data were actually altered during the day and needed to be synchronized. + +The following simple rsync command can be used to synchronize the contents of two directories and any of their subdirectories. That is, the contents of the target directory are synchronized with the contents of the source directory so that at the end of the sync, the target directory is identical to the source directory. + +`rsync ``-aH sourcedir targetdir` + +The **-a** option is for archive mode which preserves permissions, ownerships and symbolic (soft) links. The -H is used to preserve hard links. Note that either the source or target directories can be on a remote host. + +Now let's assume that yesterday we used rsync to synchronized two directories. Today we want to resync them, but we have deleted some files from the source directory. The normal way in which rsync would do this is to simply copy all the new or changed files to the target location and leave the deleted files in place on the target. This may be the behavior you want, but if you would prefer that files deleted from the source also be deleted from the target, you can add the **--delete** option to make that happen. + +Another interesting option, and my personal favorite because it increases the power and flexibility of rsync immensely, is the **--link-dest** option. The **--link-dest** option allows a series of daily backups that take up very little additional space for each day and also take very little time to create. + +Specify the previous day's target directory with this option and a new directory for today. rsync then creates today's new directory and a hard link for each file in yesterday's directory is created in today's directory. So we now have a bunch of hard links to yesterday's files in today's directory. No new files have been created or duplicated. Just a bunch of hard links have been created. Wikipedia has a very good description of [hard links][8]. After creating the target directory for today with this set of hard links to yesterday's target directory, rsync performs its sync as usual, but when a change is detected in a file, the target hard link is replaced by a copy of the file from yesterday and the changes to the file are then copied from the source to the target. + +So now our command looks like the following. + +`rsync ``-aH --delete --link-dest=yesterdaystargetdir sourcedir todaystargetdir` + +There are also times when it is desirable to exclude certain directories or files from being synchronized. For this, there is the **--exclude** option. Use this option and the pattern for the files or directories you want to exclude. You might want to exclude browser cache files so your new command will look like this. + +`rsync -aH --delete --exclude Cache --link-dest=yesterdaystargetdir sourcedir todaystargetdir` + +Note that each file pattern you want to exclude must have a separate exclude option. + +rsync can sync files with remote hosts as either the source or the target. For the next example, let's assume that the source directory is on a remote computer with the hostname remote1 and the target directory is on the local host. Even though SSH is the default communications protocol used when transferring data to or from a remote host, I always add the ssh option. The command now looks like this. + +`rsync -aH -e ssh --delete --exclude Cache --link-dest=yesterdaystargetdir remote1:sourcedir todaystargetdir` + +This is the final form of my rsync backup command. + +rsync has a very large number of options that you can use to customize the synchronization process. For the most part, the relatively simple commands that I have described here are perfect for making backups for my personal needs. Be sure to read the extensive man page for rsync to learn about more of its capabilities as well as the options discussed here. + +### Performing backups + +I automated my backups because – “automate everything.” I wrote a BASH script that handles the details of creating a series of daily backups using rsync. This includes ensuring that the backup medium is mounted, generating the names for yesterday and today's backup directories, creating appropriate directory structures on the backup medium if they are not already there, performing the actual backups and unmounting the medium. + +I run the script daily, early every morning, as a cron job to ensure that I never forget to perform my backups. + +My script, rsbu, and its configuration file, rsbu.conf, are available at [https://github.com/opensourceway/rsync-backup-script][9] + +### Recovery testing + +No backup regimen would be complete without testing. You should regularly test recovery of random files or entire directory structures to ensure not only that the backups are working, but that the data in the backups can be recovered for use after a disaster. I have seen too many instances where a backup could not be restored for one reason or another and valuable data was lost because the lack of testing prevented discovery of the problem. + +Just select a file or directory to test and restore it to a test location such as /tmp so that you won't overwrite a file that may have been updated since the backup was performed. Verify that the files' contents are as you expect them to be. Restoring files from a backup made using the rsync commands above simply a matter of finding the file you want to restore from the backup and then copying it to the location you want to restore it to. + +I have had a few circumstances where I have had to restore individual files and, occasionally, a complete directory structure. Most of the time this has been self-inflicted when I accidentally deleted a file or directory. At least a few times it has been due to a crashed hard drive. So those backups do come in handy. + +### The last step + +But just creating the backups will not save your business. You need to make regular backups and keep the most recent copies at a remote location, that is not in the same building or even within a few miles of your business location, if at all possible. This helps to ensure that a large-scale disaster does not destroy all of your backups. + +A reasonable option for most small businesses is to make daily backups on removable media and take the latest copy home at night. The next morning, take an older backup back to the office. You should have several rotating copies of your backups. Even better would be to take the latest backup to the bank and place it in your safe deposit box, then return with the backup from the day before. + +-------------------------------------------------------------------------------- + +作者简介: + +David Both - David Both is a Linux and Open Source advocate who resides in Raleigh, North Carolina. He has been in the IT industry for over forty years and taught OS/2 for IBM where he worked for over 20 years. While at IBM, he wrote the first training course for the original IBM PC in 1981. He has taught RHCE classes for Red Hat and has worked at MCI Worldcom, Cisco, and the State of North Carolina. He has been working with Linux and Open Source Software for almost 20 years. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/rsync-backup-linux + +作者:[David Both][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/dboth +[1]:https://opensource.com/article/17/1/rsync-backup-linux?rate=xmBjzZgqTu6p-Dw2gXy5cq43KHcSNs4-nisv_jnUgbw +[2]:https://www.flickr.com/photos/wwarby/11644168395 +[3]:https://www.flickr.com/photos/wwarby/11644168395 +[4]:https://opensource.com/users/jason-baker +[5]:https://creativecommons.org/licenses/by/2.0/ +[6]:https://opensource.com/business/15/12/best-couple-2015-tar-and-ssh +[7]:https://en.wikipedia.org/wiki/Rsync +[8]:https://en.wikipedia.org/wiki/Hard_link +[9]:https://github.com/opensourceway/rsync-backup-script +[10]:https://opensource.com/user/14106/feed +[11]:https://opensource.com/article/17/1/rsync-backup-linux#comments +[12]:https://opensource.com/users/dboth diff --git a/sources/tech/20170127 How to compare directories with Meld on Linux.md b/sources/tech/20170127 How to compare directories with Meld on Linux.md new file mode 100644 index 0000000000..ae9591bcc8 --- /dev/null +++ b/sources/tech/20170127 How to compare directories with Meld on Linux.md @@ -0,0 +1,144 @@ +How to compare directories with Meld on Linux +============================================================ + +### On this page + +1. [Compare directories using Meld][1] +2. [Conclusion][2] + +We've [already covered][4] Meld from a beginner's point of view (including the tool's installation part), and we've also covered some tips/tricks that are primarily aimed at intermediate Meld users. If you remember, in the beginner's tutorial, we mentioned that Meld can be used to compare both files as well as directories. Now that we've already covered file comparison, it's time to discuss the tool's directory comparison feature. + +_But before we do that it'd be worth sharing that all the instructions and examples presented in this tutorial have been tested on Ubuntu 14.04 and the Meld version we've used is 3.14.2._ + +### Compare directories using Meld + +To compare two directories using Meld, launch the tool and select the _Directory comparison_ option. + +[ + ![Compare directories using Meld](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-dir-comp-1.png) +][5] + +Then select the directories that you want to compare: + +[ + ![select the directories](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-sel-dir-2.png) +][6] + +Once that is done, click the _Compare_ button, and you'll see that Meld will compare both directories side by side, like the tool does in case of files: + +[ + ![Compare directories visually](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-dircomp-begins-3.png) +][7] + +Of course, these being directories, they are displayed as side-by-side trees. And as you can see in the screenshot above, the differences - whether it's a new file or a changed file -  are highlighted in different colors. + +According to Meld's official documentation, each file or folder that you see in the comparison area of the window has a state of its own. A state basically reveals how a particular file/folder is different from the corresponding entry in the other directory. + +The following table - taken from the tool's website - explains in details the folder comparison states in Meld. + +|**State** | **Appearance** | **Meaning** | +| --- | --- | --- | +| Same | Normal font | The file/folder is the same across all compared folders. | +| Same when filtered | Italics | These files are different across folders, but once text filters are applied, these files become identical. | +| Modified | Blue and bold | These files differ between the folders being compared. | +| New | Green and bold | This file/folder exists in this folder, but not in the others. | +| Missing | Greyed out text with a line through the middle | This file/folder doesn't exist in this folder, but does in one of the others. | +| Error | Bright red with a yellow background and bold | When comparing this file, an error occurred. The most common error causes are file permissions (i.e., Meld was not allowed to open the file) and filename encoding errors. | + +By default, Meld shows all the contents of the folders being compared, even if they are same (meaning there's no difference between them). However, you can ask the tool to not display these files/directories by clicking the _Same_ button in the toolbar - the click should disable this button. + +[ + ![same button](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-same-button.png) +][3] + +[ + ![Meld compare buttons](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-same-disabled.png) +][8] + +For example, here's our directory comparison when I clicked and disabled the _Same_ button: + +[ + ![Directory Comparison without same files](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-only-diff.png) +][9] + +So you can see that only the differences between the two directories (new and modified files) are shown now. Similarly, if you disable the _New_ button, only the modified files will be displayed. So basically, you can use these buttons to customize what kind of changes are displayed by Meld while comparing two directories. + +Coming to the changes, you can hop from one change to another using the up and down arrow keys that sit above the display area in the tool's window, and to open two files for side-by-side comparison, you can either double click the name of any of the files, or click the _Compare_ button that sits beside the arrows. + +[ + ![meld compare arrow keys](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-compare-arrows.png) +][10] + +**Note 1**: If you observe closely, there are bars on the left and right-hand sides of the display area in Meld window. These bars basically provide "a simple coloured summary of the comparison results." For each differing file or folder, there's a small colored section in these bars. You can click any such section to directly jump to that place in the comparison area. + +**Note 2**: While you can always open files side by side and merge changes the way you want, in case you want all the changes to be merged to the corresponding file/folder (meaning you want to make the corresponding file/folder exactly same) then you can use the _Copy Left_ and _Copy Right_ buttons: + +[ + ![meld copy right part](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-copy-right-left.png) +][11] + +For example, select a file or folder in the left pane and click the _Copy Right_ button to make the corresponding entry in the right pane exactly same. + +Moving on, there's a _Filters_ drop-down menu that sits just next to the _Same_, _New_, and _Modified_ trio of buttons. Here you can select/deselect file types to tell Meld whether or not to show these kind of files/folders in the display area during a directory comparison. The official documentation explains the entries in this menu as "patterns of filenames that will not be looked at when performing a folder comparison." + +The entries in the list include backups, OS-specific metadata, version control, binaries, and media. + +[ + ![Meld filters](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-filters.png) +][12] + +The aforementioned menu is also accessible by heading to _View->File Filters_. You can add new elements to this menu (as well as remove existing ones if you want) by going to _Edit->Preferences->File Filters_. + +[ + ![Meld preferences](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-edit-filters-menu.png) +][13] + +To create a new filter, you need to use shell glob patterns. Following is the list of shell glob characters that Meld recognises: + +| **Wildcard** | **Matches** | +| --- | --- | +| * | anything (i.e., zero or more characters) | +| ? | exactly one character | +| [abc] | any one of the listed characters | +| [!abc] | anything except one of the listed characters | +| {cat,dog} | either "cat" or "dog" | + +Finally, an important point worth knowing about Meld is that the case of a file's name plays an important part as comparison is case sensitive by default. This means that, for example, the files README, readme and ReadMe would all be treated by the tool as different files. + +Thankfully, however, Meld also provides you a way to turn off this feature. All you have to do is to head to the _View_ menu and then select the _Ignore Filename Case_ option. + +[ + ![Meld ignore filename case](https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/meld-ignore-case.png) +][14] + +### Conclusion + +As you'd agree, directory comparison using Meld isn't difficult - in fact I'd say it's pretty easy. The only area that might require time to learn is creating file filters, but that's not to say you should never learn it. Obviously, it all depends on what your requirement is.  + +Oh, and yes, you can even compare three directories using Meld, a feature that you can access by _clicking the 3-way comparison_ box when you choose the directories that you want to compare. We didn't discuss the feature in this article, but definitely will in one of our future articles. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-perform-directory-comparison-using-meld/ + +作者:[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/how-to-perform-directory-comparison-using-meld/ +[1]:https://www.howtoforge.com/tutorial/how-to-perform-directory-comparison-using-meld/#compare-directories-using-meld +[2]:https://www.howtoforge.com/tutorial/how-to-perform-directory-comparison-using-meld/#conclusion +[3]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-same-button.png +[4]:https://www.howtoforge.com/tutorial/beginners-guide-to-visual-merge-tool-meld-on-linux/ +[5]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-dir-comp-1.png +[6]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-sel-dir-2.png +[7]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-dircomp-begins-3.png +[8]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-same-disabled.png +[9]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-only-diff.png +[10]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-compare-arrows.png +[11]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-copy-right-left.png +[12]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-filters.png +[13]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-edit-filters-menu.png +[14]:https://www.howtoforge.com/images/beginners-guide-to-visual-merge-tool-meld-on-linux-part-3/big/meld-ignore-case.png diff --git a/sources/tech/20170128 How communities in India support privacy and software freedom.md b/sources/tech/20170128 How communities in India support privacy and software freedom.md new file mode 100644 index 0000000000..28e7adf42e --- /dev/null +++ b/sources/tech/20170128 How communities in India support privacy and software freedom.md @@ -0,0 +1,74 @@ +How communities in India support privacy and software freedom +============================================================ + + ![How communities in India support privacy and software freedom](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/people_remote_teams_world.png?itok=wI-GW8zX "How communities in India support privacy and software freedom") +Image by : opensource.com + +The free and open source communities in India, particularly Mozilla and Wikimedia communities, are leading two unique global events for better privacy and in support of free software. + +[January Privacy Month][3] is led by the Mozilla community in India to educate the masses about online privacy via both online and offline outreach events. And, [Freedom in Feb][4] is led by the [Centre for Internet and Society][5] to educate content producers like bloggers and photographers on how to donate their content under [open licenses][6]. + +### January Privacy Month + +Mozilla's January Privacy Month [began last year][7] to help celebrate the annual [Data Privacy Day][8]. In 2016, this campaign held several in-person and online events that reached [14,339,443 people across 10 countries][9]. "This was possible by sharing 1 privacy tip per day for 31 days throughout the month," says [Ankit Gadgil][10], one of the core organizers. "And this year, we have three focus areas. First of all, we have made this campaign more open and global. Mozilla communities from Brazil, Italy, and Czech Republic are actively participating this year. All essential documents is localized so that we can target more users. Secondly, We are educating participants of offline events about marketing Firefox and other Mozilla products so that the users can have hands-on experience of using these tools that help protect their privacy. The third thing is, we are encouraging everyone that participate an offline event to blog about their learning. For instance, there was a Maker Fest in in the Indian state of Gujarat recently where they used Mozilla products to teach about privacy." + +This year, the campaign continues to engage people at in-person and online events. Follow #PrivacyAware to engage. + +### Security tips + +Mozilla products like Firefox have a security settings—both [in built][11] and in the add-on library that are fully [accessible][12] to disabled people—that help protect user’s privacy and security, are all built collaboratively and are open source. + +[HTTPS Everywhere][13] can be used for [Chrome][14] and [Opera][15] to encrypt user communications so that external websites cannot see user's information. The project is built collaboratively by [The Tor Project][16] and the [Electronic Frontier Foundation][17]. + +### Freedom in February + +[Freedom in Feb][18] is an online campaign aimed at educating content creators about [free content][19] and show them how to contribute their work under free licenses.  + +**To participate:** + +* The works you will create or publish in February must be licensed under a [free license][1]. +* Content types include blog posts, other writings, and images. + +Creative works like multimedia, text-based content, art and design, etc. can be licensed under several [Creative Commons licenses][20] (CC), and other types of documents can be licensed under the [GNU Free Documentation Licenses][21] (GFDL). Good examples can be found on Wikipedia, where the content is licensed under both CC and GFDL licenses, allowing people to use, share, remix, and distribute derived work both commercially and non-commercially with attribution. Additionally, there are [free software licenses][22] that allow developers to share their software and software-related documentations. + +-------------------------------------------------------------------------------- + +作者简介: + +Subhashish Panigrahi - Subhashish Panigrahi (@subhapa) is the Asia Community Catalyzer at Mozilla's Participation team, and is transitioning from his role as Programme Officer of the Centre for Internet and Society's Access To Knowledge program Earlier with Wikimedia Foundation's India Program, he is an India based educator, + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom + +作者:[Subhashish Panigrahi][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/psubhashish +[1]:https://en.wikipedia.org/wiki/Free_license#Classification_and_licenses +[2]:https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom?rate=WhGQOnXdk0m1Yq63nNe0wTVBP-75ALKLlrssFW2lCLk +[3]:https://wiki.mozilla.org/India/task_force/Policy_and_Advocacy/January_Privacy_Month_Campaign +[4]:http://www.freedominfeb.org/ +[5]:http://cis-india.org/ +[6]:https://opensource.com/education/16/8/3-copyright-tips-students-and-educators +[7]:https://reps.mozilla.org/e/privacy-month-campaign/ +[8]:https://en.wikipedia.org/wiki/Data_Privacy_Day +[9]:http://blog.mozillaindia.org/1611 +[10]:https://reps.mozilla.org/u/ankitgadgil +[11]:https://support.mozilla.org/en-US/products/firefox/protect-your-privacy +[12]:https://support.mozilla.org/en-US/kb/advanced-panel-settings-in-firefox +[13]:https://www.eff.org/files/https-everywhere-latest.xpi +[14]:https://chrome.google.com/webstore/detail/gcbommkclmclpchllfjekcdonpmejbdp +[15]:https://addons.opera.com/extensions/details/https-everywhere/ +[16]:https://www.torproject.org/ +[17]:https://eff.org/ +[18]:http://www.freedominfeb.org/ +[19]:https://en.wikipedia.org/wiki/Free_content +[20]:https://creativecommons.org/licenses/ +[21]:https://en.wikipedia.org/wiki/GNU_Free_Documentation_License +[22]:https://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses +[23]:https://opensource.com/user/21177/feed +[24]:https://opensource.com/users/psubhashish diff --git a/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md b/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md new file mode 100644 index 0000000000..f49a66bf10 --- /dev/null +++ b/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md @@ -0,0 +1,212 @@ +Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux +============================================================ + +**Wkhtmltopdf** is an open source simple and much effective command-line shell utility that enables user to convert any given **HTML** (**Web Page**) to **PDF** document or an image (**jpg**, **png**, etc). + +Wkhtmltopdf is written in **C++** programming language and distributed under **GNU/GPL** (**General Public License**). It uses **WebKit** rendering layout engine to convert **HTML** pages to** PDF**document without loosing the quality of the pages. Its is really very useful and trustworthy solution for creating and storing snapshots of web pages in real-time. + +### Wkhtmltopdf Features + +1. Open source and cross platform. +2. Convert any **HTML** web pages to **PDF** files using **WebKit** engine. +3. Options to add headers and footers +4. Table of Content (**TOC**) generation option. +5. Provides batch mode conversions. +6. Support for **PHP** or **Python** via bindings to libwkhtmltox. + +In this article we will show you how to install **Wkhtmltopdf** program under Linux systems using source tarball files. + +### Install Evince (PDF Viewer) + +Let’s install **evince** (a **PDF** reader) program for viewing **PDF** files in Linux systems. + +``` +$ sudo yum install evince [RHEL/CentOS and Fedora] +$ sudo dnf install evince [On Fedora 22+ versions] +$ sudo apt-get install evince [On Debian/Ubuntu systems] +``` + +### Download Wkhtmltopdf Source File + +Download **wkhtmltopdf** source files for your **Linux** architecture using [Wget command][1], or you can also download latest versions (current stable series is **0.12.4**) at [wkhtmltopdf download][2] page. + +##### On 64-bit Linux OS + +``` +$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz +``` + +##### On 32-bit Linux OS + +``` +$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-i386.tar.xz +``` + +### Install Wkhtmltopdf in Linux + +Extract the files to a current working directory using following [tar command][3]. + +``` +------ On 64-bit Linux OS ------ +$ sudo tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz +------ On 32-bit Linux OS ------ +$ sudo tar -xvzf wkhtmltox-0.12.4_linux-generic-i386.tar.xz +``` + +Install the **wkhtmltopdf** under **/usr/bin** directory for easy execution of program from any path. + +``` +$ sudo cp wkhtmltox/bin/wkhtmltopdf /usr/bin/ +``` + +### How to Use Wkhtmltopdf? + +Here we will see how to covert remote **HTML** pages to **PDF** files, verify information, view created files using **evince** program from the **GNOME** Desktop. + +#### Convert Website HTML Page to PDF File + +To convert any website **HTML** web page to **PDF**, run the following example command. It will convert the given webpage to [10-Sudo-Configurations.pdf][4] in current working directory. + +``` +# wkhtmltopdf http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf +``` + +##### Sample Output : + +``` +Loading pages (1/6) +Counting pages (2/6) +Resolving links (4/6) +Loading headers and footers (5/6) +Printing pages (6/6) +Done +``` + +#### View Generated PDF File + +To verify that the file is created, use the following command. + +``` +$ file 10-Sudo-Configurations.pdf +``` + +##### Sample Output : + +``` +10-Sudo-Configurations.pdf: PDF document, version 1.4 +``` + +#### View Information of Generated PDF File + +To view the information of generated file, issue the following command. + +``` +$ pdfinfo 10-Sudo-Configurations.pdf +``` + +##### Sample Output : + +``` +Title: 10 Useful Sudoers Configurations for Setting 'sudo' in Linux +Creator: wkhtmltopdf 0.12.4 +Producer: Qt 4.8.7 +CreationDate: Sat Jan 28 13:02:58 2017 +Tagged: no +UserProperties: no +Suspects: no +Form: none +JavaScript: no +Pages: 13 +Encrypted: no +Page size: 595 x 842 pts (A4) +Page rot: 0 +File size: 697827 bytes +Optimized: no +PDF version: 1.4 +``` + +#### View Created PDF File + +Take a look at the newly created **PDF** file using **evince** program from the desktop. + +``` +$ evince 10-Sudo-Configurations.pdf +``` + +##### Sample Screenshot : + +Looks pretty nice under my Linux Mint 17 box. + +[ + ![View Website Page in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png) +][5] + +View Website Page in PDF + +#### Create TOC (Table Of Content) of a Page to PDF + +To create a table of content for a **PDF** file, use the option as **toc**. + +``` +$ wkhtmltopdf toc http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf +``` + +##### Sample Output : + +``` +Loading pages (1/6) +Counting pages (2/6) +Loading TOC (3/6) +Resolving links (4/6) +Loading headers and footers (5/6) +Printing pages (6/6) +Done +``` + +To check the **TOC** for the created file, again use evince program. + +``` +$ evince 10-Sudo-Configurations.pdf +``` + +##### Sample Screenshot : + +Take a look at the picture below. it looks even more better than the above. + +[ + ![Create Website Page to Table of Contents in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png) +][6] + +Create Website Page to Table of Contents in PDF + +#### Wkhtmltopdf Options and Usage + +For **Wkhtmltopdf** more usage and options, use the following help command. It will display list of all available options that you can use with it. + +``` +$ wkhtmltopdf --help +``` + +-------------------------------------------------------------------------------- + +作者简介: + +I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+ + +-------------------------------------------------- + +via: http://www.tecmint.com/wkhtmltopdf-convert-website-html-page-to-pdf-linux/ + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ +[2]:http://wkhtmltopdf.org/downloads.html +[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ +[4]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ +[5]:http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png +[6]:http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png diff --git a/sources/tech/20170130 4 ways to improve your security online right now.md b/sources/tech/20170130 4 ways to improve your security online right now.md new file mode 100644 index 0000000000..97fd19cdbe --- /dev/null +++ b/sources/tech/20170130 4 ways to improve your security online right now.md @@ -0,0 +1,89 @@ +4 ways to improve your security online right now +============================================================ + + ![4 ways to improve your security online right now](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=VNmpz6K- "4 ways to improve your security online right now") +Image by : Opensource.com + +The last few years have seen a massive jump in the frequency of reports about digital security breaches and personal privacy issues, and no doubt this trend will continue. We hear about scammers moving to social media, nations using cyberattacks as part of coordinated offensive strategies, and the rise of companies making millions tracking our online behavior.  + +Feeling apathetic about these events is all too easy, but you can do a great deal to improve your online security so that when you are caught up by a security event, you can mitigate the risk to yourself and quickly protect yourself from further risk. Security consciousness is surprisingly easy to learn, and many open source projects exist that can help you. + +The point of security isn't to turn your computer into a virtual Fort Knox, but to make accessing your data a big enough task that attackers will move on to easier targets.  + +### Get a password manager + +In a world where almost every site you visit has a username and password requirement, most people are suffering from password fatigue and have developed complex systems to create and remember usernames and passwords (or have given up entirely and just use the same username and password everywhere). Password managers are the solution to this issue, and I don't know a single security professional that doesn't use them. Also, they are surprisingly easy to set up and use.  + +For those who have not encountered one before, a password manager is software that acts like a digital vault for information, storing it in an encrypted environment. You create a master password, which is a single, strong password that protects access to a vault containing your collection of other username and passwords. Often password managers will auto-input stored passwords when you connect to a known site, generate strong passwords, and allow you to store other information.  + +A good number of password managers are available, and many of them are FOSS solutions. I have personal experience with [KeePass][4] on Windows and [KeePassX][5] on Linux and MacOS, and I recommend them as a good place to start. (Here are three more [open source password managers][6] you might like to try.) + +However, each person should choose the best solution his or her situation. Some password managers have cloud storage in addition to local storage, which can be useful if you use multiple devices. More popular managers are more likely to be maintained and receive regular security updates. Some password managers have 2FA integration, which I would highly recommend you enable along with any other account you have that incorporates it.  + +Most password managers do not have a facility to recover forgotten master passwords. Choose wisely and make sure it's something you can or will remember.  + +### Use a VPN to improve security on shared networks + +Virtual private networks (VPNs) allow your computer to send and receive data over a shared network as if it was communicating directly with a server on a private network through end-to-end encryption. + +You may be familiar with the process from connecting to your corporate intranet while working away from the office. While using a VPN that is connected to a public network at a cafe or hotel will protect you from others on the public network seeing your traffic, it does not stop your VPN provider from seeing that traffic, and disreputable providers have been known to collect and sell data. A VPN provider may also receive pressure from governments or law enforcement to pass on information about the data that you have sent over their network. For this reason, remember that VPNs do not protect if you are carrying out illicit activities. + +When choosing a VPN provider, consider which country it operates from because these are the laws it will be bound by, and even the most innocuous of activities might land you in hot water. + +[OpenVPN][7] is a free and open source VPN protocol that is available on most platforms and has become one of the most widely used VPNs. You can even host your own OpenVPN server—just be careful to implement it securely. If you would prefer to use a VPN service, remember that many reputable providers want your business. + +Some charge a fee, like [ExpressVPN][8], [NordVPN][9], or [AirVPN][10]. Some providers offer free services; however, I would strongly recommend that you do not use them. Remember, when you aren't paying for the service, your data is the product.  + +### Browser extensions are your friend + +While Internet browsers have some built-in security tools, extensions are a great way to increase both your privacy and security. There's a huge variety of them though, so which extensions are the right ones for you? This probably depends on what you use the Internet for primarily and how tech savvy you are. As a baseline, I would use the following extensions: + +* [Privacy Badger​][1]: This extension, developed by the EFF, blocks spying adverts and hidden trackers. It works by putting a Do Not Track header in traffic requests and then evaluating how likely it is that the traffic is still being tracked. If that likelihood is high, it blocks further traffic from that domain unless you tell it otherwise. The extension is licensed under GNU GPL v3. +* [HTTPS Everywhere​][2]: A joint collaboration between the EFF and The Tor Project, this extension ensures that HTTPS is used automatically wherever possible. This is important, because it means that your web traffic with a given domain is encrypted rather than in plain text, providing privacy and ensuring integrity of exchanged data. The extension is licensed under GNU GPL v3. + +### Don't forget about old accounts + +Do you remember Bebo, iTunes Ping, Del.icio.us, Digg, MySpace, or Friendster? Did you have accounts on any of them? Did you actually close your account or did you just stop using it? Have you ever stopped to wonder what information may be sitting on these sites, forgotten? + +Old social media accounts can be a goldmine for those who trawl and collect data, including marketers, fraudsters, and hackers alike. They can use this information to build a picture of you as a person, and such information can often reveal important facts that are used for identification in password resets, such as the name of your first pet or what your first car was.  + +Some sites can make deleting an account a difficult process or actually impossible. [Justdelete.me][11] is a great resource for finding instructions on how to delete social media accounts across a wide variety of platforms. If the website you're looking for isn't there and you find the information yourself, consider contributing to the project on GitHub. If you aren't sure of the social media accounts you may have forgotten about, [Knowem.com][12] allows you to search a large selection of social networks by user name. The search facility isn't immune to false positives though and you may not have been the only person to have ever used a given username, but it's a good starting place, despite not being open source.  + +If you are unsure what old usernames you may have used, Google is a great resource. Try searching old nicknames and email addresses. You may be surprised by what you find.  + +### Conclusion + +Regardless of how monumental a task digital security can seem, you can lay a strong foundation when you get started. Remember that being secure is an ongoing process, rather than a state of being. Keep the tools you use up to date and periodically check your habits and tools to ensure your security is the best it can be. Security doesn't have to be overly complex if you take it one step at a time. + +-------------------------------------------------------------------------------- + +作者简介: + +Tiberius Hefflin - Tibbs recently graduated from the University of West of Scotland with a degree in computer security. She has relocated to Portland, OR, where she evangelizes for privacy and security while doing security assurance work for Portland General Electric. She is passionate about encouraging small children to take the plunge into STEM and about laughing at cats on the internet. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/4-ways-improve-your-online-security + +作者:[Tiberius Hefflin][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/whatatiberius +[1]:https://www.eff.org/privacybadger +[2]:https://www.eff.org/Https-everywhere +[3]:https://opensource.com/article/17/1/4-ways-improve-your-online-security?rate=sa9kEW1QXWaWvvq4F5YWv2EhiAHVDoWOqzZS2a95Uas +[4]:http://keepass.info/ +[5]:https://opensource.com/business/16/5/keepassx +[6]:https://opensource.com/article/16/12/password-managers +[7]:https://openvpn.net/ +[8]:https://www.expressvpn.com/ +[9]:https://nordvpn.com/ +[10]:https://airvpn.org/ +[11]:http://backgroundchecks.org/justdeleteme/ +[12]:http://knowem.com/ +[13]:https://opensource.com/user/108496/feed +[14]:https://opensource.com/article/17/1/4-ways-improve-your-online-security#comments +[15]:https://opensource.com/users/whatatiberius diff --git a/sources/tech/20170130 5 Reasons To Install Linux Today.md b/sources/tech/20170130 5 Reasons To Install Linux Today.md new file mode 100644 index 0000000000..e287927e01 --- /dev/null +++ b/sources/tech/20170130 5 Reasons To Install Linux Today.md @@ -0,0 +1,111 @@ +5 Reasons To Install Linux Today +============================================================ + +If you are reading this article, chances are you are a new or prospective Linux user. Or perhaps you’re not – and are curious as to what I consider the 5 top reasons why someone would want to install Linux today. + +Either way, you are welcome to join me as I do my best to explain. If you bear with me enough to reach the end of this post, feel free to add your own voice using the comment form below. + +**Suggested Read:** [5 Things I Dislike and Love About GNU/Linux][1] + +**DISCLAIMER**: The reasons below are not listed in any specific order of importance. That said, you can read them from top to bottom or the other way around – your choice. + +### Reason #1 – Linux is Free + +In the Linux ecosystem, the word **“free”** has two meanings: **1) Free as in freedom**, and **2) Free as in beer**. The first one refers to the freedom of doing whatever you wish with the operating system (for example, personal or commercial use). + +The second is indicative of the fact that most (**99%**) Linux distributions (the “flavors” of Linux, so to speak) can be downloaded and used on as many computers at absolutely no cost. + +**Suggested Read:** [Top Most Popular Linux Distributions of 2016][2] + +Commercial distributions are sometimes preferred on enterprise environments due to the available support contracts offered by the companies behind them. Red Hat, Inc. with its superstar [Red Hat Enterprise Linux][3] is just an example. + +[ + ![Linux is Free](http://www.tecmint.com/wp-content/uploads/2017/01/Linux-is-Free.png) +][4] + +Linux is Free + +### Reason #2 – Linux can Bring old Hardware back to Life + +Yes, you read that right. If you have an old computer gathering dust because it no longer can afford the system requirements of other operating systems, Linux is here to save your day. And I speak out of experience on this: my first computer (a high school graduation present my mother gave me near the end of 2000) has now been running as a home server for 5 years now – always with the latest Debian stable release. + +**Suggested Read:** [6 Linux Distributions to Try on Old PC’s and Laptops][5] + +[ + ![Linux Supports Old Hardware](http://www.tecmint.com/wp-content/uploads/2017/01/Linux-Supports-Old-Hardware.jpg) +][6] + +Linux Supports Old Hardware + +### Reason #3 – Linux is the Best Tool to Learn How Computers Work + +Even for new users, it is relatively easy to access information about and interact with the computer’s hardware. With [command-line tools][7] such as [dmesg][8] (which lists messages from the kernel) and a little patience, you can easily learn what happens internally since you press the power button until you get a fully-usable operating system. And that is just one example. + +[ + ![Learn Linux](http://www.tecmint.com/wp-content/uploads/2017/01/Learn-Linux.jpg) +][9] + +Learn Linux + +### Reason #4 – Linux is the Best Tool to Get Started with Programming + +I always say that I would have loved to have been introduced to Linux much earlier than I was. When the operating system is installed, it includes all the necessary tools to get started with [Python programming][10]. One of the most popular object-oriented programming languages in use today, Python is used to introduce computer science majors to programming in several top-notch universities. + +[ + ![Learn Linux + Python Programming](http://www.tecmint.com/wp-content/uploads/2017/01/Learn-Linux-with-Python-Programming.png) +][11] + +Learn Linux + Python Programming + +### Reason #5 – Lots (and I mean LOTS) of Free world-class Software + +I know, I know. This item is closely related to **#1** but I decided to make it a separate one. Why? Because it highlights the fact that the software available for Linux today is mostly made possible by a large army of volunteers. + +Yes – people who write outstanding software without making a quarter out of it. In some cases, there are companies providing the funds for the development and maintenance of the software. + +**Suggested Read:** [20 Free Open Source Software I Found in Year 2015][12] + +The operating system is so stable that they want to make sure their software runs on it. That is why large companies make substantial contributions (in terms of donations or manpower) to the Linux ecosystem. + +[ + ![Free Open Source Software](http://www.tecmint.com/wp-content/uploads/2017/01/Free-Open-Source-Software.jpg) +][13] + +Free Open Source Software + +##### Summary + +Thank you for taking the time to read this post! Please note that I’ve done my best to describe the reasons I would give to someone considering using Linux for the first time. + +If you can think of other reasons not present in this article, feel free to share them with our community using the comment form below. + +-------------------------------------------------------------------------------- + +作者简介: + +Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work. + +----------------------------------------- + +via: http://www.tecmint.com/install-linux-today/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/install-linux-today/ +[1]:http://www.tecmint.com/things-i-dislike-and-love-about-gnu-linux/ +[2]:http://www.tecmint.com/top-best-linux-distributions-2016/ +[3]:http://www.tecmint.com/red-hat-rhcsa-rhce-exam-certification-book/ +[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-is-Free.png +[5]:http://www.tecmint.com/linux-distributions-for-old-computers/ +[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Linux-Supports-Old-Hardware.jpg +[7]:http://www.tecmint.com/category/linux-commands/ +[8]:http://www.tecmint.com/dmesg-commands/ +[9]:http://www.tecmint.com/wp-content/uploads/2017/01/Learn-Linux.jpg +[10]:http://www.tecmint.com/category/python/ +[11]:http://www.tecmint.com/wp-content/uploads/2017/01/Learn-Linux-with-Python-Programming.png +[12]:http://www.tecmint.com/best-free-open-source-softwares-of-2015/ +[13]:http://www.tecmint.com/wp-content/uploads/2017/01/Free-Open-Source-Software.jpg diff --git a/sources/tech/20170130 How to get up and running with sweet Orange Pi.md b/sources/tech/20170130 How to get up and running with sweet Orange Pi.md new file mode 100644 index 0000000000..abdbcea25d --- /dev/null +++ b/sources/tech/20170130 How to get up and running with sweet Orange Pi.md @@ -0,0 +1,86 @@ +How to get up and running with sweet Orange Pi +============================================================ + + ![How to get up and running with sweet Orange Pi](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/the_orange_pi_zero.jpg?itok=00T8KODN "How to get up and running with sweet Orange Pi") +Image credits :  + +Dave Egts, CC BY-SA 4.0 + +As open source-powered hardware like [Arduino][2] and [Raspberry Pi][3] becomes more and more mainstream, its cost keeps dropping, which opens the door to new and innovative [IoT][4] and [STEM][5] applications. As someone who's passionate about both, I'm always on the lookout for new innovations that can be applied in industry, the classroom, and [my daughter's robotics team][6]. When I heard about the Orange Pi as being a "[Raspberry Pi killer][7]," I paused to take notice. + +Despite the sour sounding name, the Orange Pi Zero intrigued me. I recently got my hands on one and in this article share my first impressions. Spoiler alert: I was very impressed. + +### Why Orange Pi? + +Orange Pi is a family of Linux-powered, single board computers manufactured by [Shenzhen Xunlong Software Co., Limited][8], and [sold on AliExpress][9]. As with anything sold on AliExpress, be patient and plan ahead for shipping times of two to four or more weeks, because the products are shipped directly from mainland China to locations around the world. + +Unlike the Raspberry Pi, which has had a small but growing family of single board computers for different price points, form factors, and features, the number of Orange Pi boards is much larger. The good news is that you have a tremendous amount of choice in the application you want, but the bad news is that amount of choice could be overwhelming. In my case, I went with the [Orange Pi Zero][10] 512MB version, because it has the right balance of features and is priced for use in high school, academic environments. + +To see a high-resolution image with all the specs, go to the [Orange Pi Zero website][11]. + +Specifically, I needed the device to be as inexpensive as possible, but still useful out of the box, with Internet connectivity for SSH and IoT applications. The Orange Pi Zero meets these requirements by having onboard 10/100M Ethernet and 802.11 b/g/n Wi-Fi for Internet connectivity. It also has 26 Raspberry Pi-compatible [GPIO ports][12] for connecting sensors for IoT applications. I went with the 512MB version of the Orange Pi Zero over the 256MB version because more memory is typically better and it was only $2 more. Out the door, the unit was US $12.30 shipped, which makes it cost effective for classroom environments where experimentation and creating [magic smoke][13] is encouraged. + +Compared to a $5 [Raspberry Pi Zero][14], the Orange Pi Zero is only a few dollars more expensive, but it is much more useful out of the box because it has onboard Internet connectivity and four CPU cores instead of one. This onboard networking capability also makes the Orange Pi Zero a better gift than a Raspberry Pi Zero because the Raspberry Pi Zero needs Micro-USB-to-USB adapters and a Wi-Fi USB adapter to connect to the Internet. When giving IoT devices as gifts, you want the recipient to enjoy the product as quickly and easily as possible, instead of giving something incomplete that will just end up on a shelf. + +### Out of the box experience + +One of my initial concerns about the Orange Pi is that the vendor and community support wouldn't be as strong as the Raspberry Pi Foundation's and its community's support, leaving the end user all alone putting in extra effort to get the device going. If that's the case, I'd be reluctant to recommend the Orange Pi for classroom use or as a gift. The good news is that the Orange Pi Zero worked well right away and was actually easier to get going than a Raspberry Pi. + +The Orange Pi arrived in my mailbox two weeks after ordering. I unpacked it and got it up and running in a matter of minutes. Most of my time was spent downloading the operating system. The Orange Pi can run a variety of operating systems, ranging from Android to Debian variants. I went with [Armbian][15] as it appeared to be the most popular choice for Orange Pi enthusiasts. Since Armbian supports many ARM-based single-board computers, you need to select [the right Armbian build for the Orange Pi Zero][16]. By following the [Getting Started section][17] of the Armbian User Guide, I was easily able to image a microSD card, insert the microSD card and Ethernet cable, power the unit with an existing 3A Micro-USB power adapter I use with my Raspberry Pis, and SSH into it. + + ![Orange Pi interface](https://opensource.com/sites/default/files/orange_pi_screen_shot.png "Orange Pi interface") + +SSHing into the Orange Pi Zero. + +Once SSHed in via Ethernet, I was able to connect to my wireless access point easily using [nmtui-connect][18]. Then I performed an **apt-get update && apt-get upgrade** and noticed that the update ran much faster than a Raspberry Pi Zero and closer to the performance of a [Raspberry Pi 3][19]. Others have [observed similar results][20], too. It may not be as fast as a Raspberry Pi 3, but I wasn't planning to sequence genomes or mine Bitcoin with it. I also noticed that Armbian automatically resizes the root partition to fill the entire microSD card, which is an explicit, manual, and sometimes forgotten step when using Raspbian. Finally, for the US $12 price, three times as many students can learn on their own Orange Pi Zero as compared to a $35 Raspberry Pi 3, and you can give an Orange Pi Zero to three times as many friends. + + ![Orange Pi Form Factor](https://opensource.com/sites/default/files/the_orange_pi_zero_form_factor.jpg "Orange Pi Form Factor") + +The Orange Pi Zero form factor compared with the Raspberry Pi 3. + +### Closing thoughts + +The Orange Pi is definitely a solution looking for problems. Given its low cost, ability to get up and running quickly, relatively quick performance, and GPIO-pin compatibility with Raspberry Pi, the Orange Pi, and Orange Pi Zero in particular, should definitely be on your short list for experimentation in your workshop, classroom, or robot. + +Have you tried the Orange Pi? I'd love to hear about your experiences in the comments below. + +-------------------------------------------------------------------------------- + +作者简介: + +David Egts - David Egts | Chief Technologist, North America Public Sector, Red Hat. Drum playing, motorcycle riding, computer geek, husband, dad, and catechist. Follow me on Twitter at @davidegts and check out the podcast I co-host! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/how-to-orange-pi + +作者:[David Egts][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/daveegts +[1]:https://opensource.com/article/17/1/how-to-orange-pi?rate=ZJsifrA90bn7TAU6NWgsxdYtRQjRhq5n7NiPZD8876M +[2]:https://en.wikipedia.org/wiki/Arduino +[3]:https://en.wikipedia.org/wiki/Raspberry_Pi +[4]:https://en.wikipedia.org/wiki/Internet_of_things +[5]:https://en.wikipedia.org/wiki/Science,_technology,_engineering,_and_mathematics +[6]:https://opensource.com/education/14/3/fighting-unicorns-robotics-team +[7]:http://sprtechuk.blogspot.com/2015/09/15-computer-orange-pi-pc-is-powerful.html +[8]:http://www.xunlong.tv/ +[9]:https://www.aliexpress.com/store/1553371 +[10]:http://www.orangepi.org/orangepizero/ +[11]:http://www.orangepi.org/orangepizero/ +[12]:http://linux-sunxi.org/Xunlong_Orange_Pi_Zero#Expansion_Port +[13]:https://en.wikipedia.org/wiki/Magic_smoke +[14]:https://www.raspberrypi.org/products/pi-zero/ +[15]:https://www.armbian.com/ +[16]:https://www.armbian.com/orange-pi-zero/ +[17]:https://docs.armbian.com/User-Guide_Getting-Started/ +[18]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Networking_Config_Using_nmtui.html +[19]:https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ +[20]:https://openbenchmarking.org/result/1612154-TA-1603058GA04,1612151-MICK-MICKMAK70,1612095-TA-1603058GA97,1612095-TA-1603058GA50 +[21]:https://opensource.com/user/24799/feed +[22]:https://opensource.com/article/17/1/how-to-orange-pi#comments +[23]:https://opensource.com/users/daveegts diff --git a/sources/tech/20170131 Getting Started with MySQL Clusters as a Service.md b/sources/tech/20170131 Getting Started with MySQL Clusters as a Service.md new file mode 100644 index 0000000000..c00b10aa7b --- /dev/null +++ b/sources/tech/20170131 Getting Started with MySQL Clusters as a Service.md @@ -0,0 +1,84 @@ +Getting Started with MySQL Clusters as a Service +============================================================ + +[MySQL Cluster.me][1] starts offering **MySQL Clusters** and **MariaDB Clusters** as a service based on **Galera Replication** technology. + +In this article we will go through the main features of a **MySQL** and **MariaDB** clusters as a service. + +[ + ![MySQL Clusters as a Service](http://www.tecmint.com/wp-content/uploads/2017/01/MySQL-Clusters-Service.png) +][2] + +MySQL Clusters as a Service + +### What is a MySQL Cluster? + +If you have ever wondered how you can increase the reliability and scalability of your MySQL database you might have found that one of the ways to do that is through a **MySQL Cluster** based on **Galera Cluster** technology. + +This technology allows you to have a complete copy of the MySQL database synchronized across many servers in one or several datacenters. This lets you achieve high database availability – which means that if `1` or more of your database servers crash then you will still have a fully operational database on another server. + +It is important to note that the minimum number of servers in a **MySQL Cluster** is `3` because when one server recovers from a crash it needs to copy data from one of the remaining two servers making one of them a “**donor**“. So in case of crash recovery you must have at least two online servers from which the crashed server can recover the data. + +Also, a [MariaDB cluster][3] is essentially the same thing as MySQL cluster just based on a newer and more optimized version on MySQL. + +[ + ![MySQL Clusters Galera Replications](http://www.tecmint.com/wp-content/uploads/2017/01/MySQL-Clusters-Galera-Replications.png) +][4] + +MySQL Clusters Galera Replications + +### What is a MySQL Cluster and MariaDB Cluster as a Service? + +**MySQL Clusters** as a service offer you a great way to achieve both requirements at the same time. + +First, you get **High Database Availability** with a high probability of **100% Uptime** in case of any datacenter issues. + +Secondly, outsourcing the tedious tasks associated with managing a mysql cluster let you focus on your business instead of spending time on cluster management. + +In fact, managing a cluster on your own may require you to perform the following tasks: + +1. **Provision and setup the cluster** – may take you a few hours of an experienced database administrator to fully setup an operational cluster. +2. **Monitor the cluster** – one of your techs must keep an eye on the cluster 24×7 because many issues can happen – cluster desynchronization, server crash, disk getting full etc. +3. **Optimize and resize the cluster** – this can be a huge pain if you have a large database and you need to resize the cluster. This task needs to be handled with extra care. +4. **Backups management** – you need to backup your cluster data to avoid it being lost if your cluster fails. +5. **Issue resolution** – you need an experienced engineer who will be able to dedicate a lot of effort optimizing and solving issues with your cluster. + +Instead, you can save a lot of time and money by going with a **MySQL Cluster** as a Service offered by **MySQLcluster.me** team. + +###### So what’s included into MySQL Cluster as a Service offered by MySQLcluster.me? + +Apart from high database availability with an almost guaranteed uptime of **100%**, you get the ability to: + +1. **Resize the MySQL Cluster at any time** – you can increase or decrease cluster resources to adjust for the spikes in your traffic (RAM, CPU, Disk). +2. **Optimized Disks and Database Performance** – disks can achieve a rate of **100,000 IOPS** which is crucial for database operation. +3. **Datacenter Choice** – you can decide in which datacenter you would like to host the cluster. Currently supported – Digital Ocean, Amazon AWS, RackSpace, Google Compute Engine. +4. **24×7 Cluster Support** – if anything happens to your cluster our team will always assist you and even provide you advice on your cluster architecture. +5. **Cluster Backups** – our team sets up backups for you so that your cluster is automatically backed up on a daily basis to a secure location. +6. **Cluster Monitoring** – our team sets up automatic monitoring so in case of any issue our team starts working on your cluster even if you are away from your desk. + +There are a lot of advantages of having your own **MySQL Cluster** but this must be done with care and experience. + +Speak to [MySQL Cluster][5] team to find the best suitable package for you. + +-------------------------------------------------------------------------------- + +作者简介: + +I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+ + +-------------------------------------------- + +via: http://www.tecmint.com/getting-started-with-mysql-clusters-as-a-service/ + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:https://www.mysqlcluster.me/#utm_source=tecmintpost1&utm_campaign=tecmintpost1&utm_medium=tecmintpost1 +[2]:http://www.tecmint.com/wp-content/uploads/2017/01/MySQL-Clusters-Service.png +[3]:https://www.mysqlcluster.me/#utm_source=tecmintpost1&utm_campaign=tecmintpost1&utm_medium=tecmintpost1 +[4]:http://www.tecmint.com/wp-content/uploads/2017/01/MySQL-Clusters-Galera-Replications.png +[5]:https://www.mysqlcluster.me/#utm_source=tecmintpost1&utm_campaign=tecmintpost1&utm_medium=tecmintpost1 diff --git a/sources/tech/20170131 How to install OTRS (OpenSource Trouble Ticket System) on CentOS 7.md b/sources/tech/20170131 How to install OTRS (OpenSource Trouble Ticket System) on CentOS 7.md new file mode 100644 index 0000000000..4a3c3e18a0 --- /dev/null +++ b/sources/tech/20170131 How to install OTRS (OpenSource Trouble Ticket System) on CentOS 7.md @@ -0,0 +1,631 @@ +How to install OTRS (OpenSource Trouble Ticket System) on CentOS 7 +============================================================ + +### On this page + +1. [The Environment][1] +2. [Preparation][2] +3. [Install MariaDB on Centos 7][3] +4. [Install EPEL ][4] +5. [Install OTRS][5] +6. [Configure OTRS on CentOS 7][6] + +OTRS (open-source trouble ticket system software) is a sophisticated open source software used by companies to improve their operation related to customer support, help desk, call centers and more. OTRS is written in PERL and provides the following important features: + +* Customers can register and create/interact with a Ticket via the customer portal and by email, phone, and fax with each queue (Attendants/Technicians post box). +* Tickets can be managed by their priority, assignment, transmission and follow-up. A ticket can be split, merged, bulk actions can be applied, and links to each other and notifications can be set. Services can be configurated through the service catalog. +* To increase the team capacity, auto email (automatic answers), text templates and signatures can be configured. The system supports notes and attachments on tickets. +* Others capabilities include: statistics and reports (CSV/PDF), SLA and many other features. + +### The Environment + +This article covers the OTRS 5 installation and basic configuration. This article was writen based on the following enviroment: A Virtual Box VM with CENTOS 7 Minimal, 2GB RAM, 8GB HD and 2 network interfaces (host only and NAT). + +### Preparation + +Assuming that you use a fresh installation of Centos 7 Minimal,  before to install OTRS, run the following command to update the system and install aditional packages:  + +``` +yum update +``` + +Transaction Summary ================================================================================ Install 1 Package Upgrade 39 Packages Total download size: 91 M Is this ok [y/d/N]: **y** + +Install a text editor or use VI. In this article we use VIM, run the following command to install it: + +``` +yum install vim +``` + +To install the WGET package, run the following command: + +``` +yum install wget +``` + +To configure the Centos 7 network, run the following command to open the NMTUI (Network Manager Text User Interface) tool and edit the interfaces and hostname if nescessary: + +``` +nmtui +``` + +[ + ![](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.jpg) +][7] + + After setup of network settings and hostname on CentOS 7, run the following command to apply the changes: + +``` +service networks restart +``` + +To verify the network information, run the following command: + +``` +ip addr +``` + +The output looks like this on my system: + +``` +1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: enp0s3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 08:00:27:67:bc:73 brd ff:ff:ff:ff:ff:ff + inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3 + valid_lft 84631sec preferred_lft 84631sec + inet6 fe80::9e25:c982:1091:90eb/64 scope link + valid_lft forever preferred_lft forever +3: enp0s8: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 08:00:27:68:88:f3 brd ff:ff:ff:ff:ff:ff + inet 192.168.56.101/24 brd 192.168.56.255 scope global dynamic enp0s8 + valid_lft 1044sec preferred_lft 1044sec + inet6 fe80::a00:27ff:fe68:88f3/64 scope link + valid_lft forever preferred_lft forever +``` + +Disable SELINUX (Security Enhanced Linux) on Centos 7, edit the following config file: + +``` +vim /etc/selinux/config +``` + +``` +"/etc/selinux/config" 14L, 547C# This file controls the state of SELinux on the system. +# SELINUX= can take one of these three values: +# enforcing - SELinux security policy is enforced. +# permissive - SELinux prints warnings instead of enforcing. +# disabled - No SELinux policy is loaded. +SELINUX=enforcing +# SELINUXTYPE= can take one of three two values: +# targeted - Targeted processes are protected, +# minimum - Modification of targeted policy. Only selected processes are prootected. +# mls - Multi Level Security protection. +SELINUXTYPE=targeted +``` + +Change the value **enforcing** of directive SELINUX to **disabled**, save the file and reboot the server. + +To check the status of SELinux on Centos 7, run the following command: + +``` +getenforce +``` + +The output must be: + +``` +Disabled +``` + +### Install MariaDB on Centos 7 + +To install MariaDB on Centos 7, run the following command: + +``` +yum -y install mariadb-server +``` + +Create the file with the name **zotrs.cnf** in the following directory: + +``` +/etc/my.cnf.d/ +``` + +To create and edit the file, run the following command: + +``` +vim /etc/my.cnf.d/zotrs.cnf +``` + +Fill the file with the following content and save it: + +``` +max_allowed_packet = 20M +query_cache_size = 32M +innodb_log_file_size = 256M +``` + +To start MariaDB, run the following command: + +``` +systemctl start mariadb +``` + +To increase the security of MariaDB, run the following command: + +``` +/usr/bin/mysql_secure_installation +``` + +Setup the options accordind the following output: + +``` +NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB + SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! + +In order to log into MariaDB to secure it, we'll need the current +password for the root user. If you've just installed MariaDB, and +you haven't set the root password yet, the password will be blank, +so you should just press enter here. + +Enter current password for root (enter for none): +``` + +``` +OK, successfully used password, moving on... + +Setting the root password ensures that nobody can log into the MariaDB +root user without the proper authorisation. + +Set root password? [Y/n] +``` + +Set the root password: + +``` +New password: +Re-enter new password: +Password updated successfully! +Reloading privilege tables.. + ... Success! + +By default, a MariaDB installation has an anonymous user, allowing anyone +to log into MariaDB without having to have a user account created for +them. This is intended only for testing, and to make the installation +go a bit smoother. You should remove them before moving into a +production environment. + +Remove anonymous users? [Y/n] +``` + +``` + ... Success! + +Normally, root should only be allowed to connect from 'localhost'. This +ensures that someone cannot guess at the root password from the network. + +Disallow root login remotely? [Y/n] +``` + +``` + ... Success! + +By default, MariaDB comes with a database named 'test' that anyone can +access. This is also intended only for testing, and should be removed +before moving into a production environment. + +Remove test database and access to it? [Y/n] +``` + +``` + - Dropping test database... + ... Success! + - Removing privileges on test database... + ... Success! + +Reloading the privilege tables will ensure that all changes made so far +will take effect immediately. + +Reload privilege tables now? [Y/n] +``` + +``` + ... Success! + +Cleaning up... + +All done! If you've completed all of the above steps, your MariaDB +installation should now be secure. + +Thanks for using MariaDB! + +``` + +Setup MariaDB to start up automatically at boot time: + +systemctl enable mariadb.service + +To download OTRS, run the following command: + +``` +wget http://ftp.otrs.org/pub/otrs/RPMS/rhel/7/otrs-5.0.15-01.n oarch.rpm +``` + +### Install EPEL  + +Before we install OTRS, setup the EPEL repositoy on Centos 7\. Run the following command to do so: + +``` +[root@centos7 ~]# yum -y http://mirror.globo.com/epel/7/x86_64/e/epel-r release-7-9.noarch.rpm +``` + +### Install OTRS + +Install OTRS with the following command: + +``` +yum install -nogpgcheck otrs-5.0.15-01.noarch.rpm +``` + +A list of software package will be installed, eg. Apache and all dependencies will be resolved automatically, at to the end of output press Y: + +``` +Transaction Summary +================================================================================ +Install 1 Package (+143 Dependent packages) + +Total size: 148 M +Total download size: 23 M +Installed size: 181 M +Is this ok [y/d/N]: y +``` + +To start Apache (httpd), run the following command: + +``` +systemctl start httpd.service +``` + +To enable Apache (httpd) startup with systemd on Centos7, run the following command: + +``` +systemctl enable httpd.service +``` + +Enable SSL in Apache and configure a SelfSigned Certificate. Install the Mod_SSL module for the Apache HTTP Server, run the following command: + +``` +yum -y install mod_ssl +``` + +To generate a self-signed SSL certificate, go to the following directory: + +``` +cd /etc/pki/tls/certs/ +``` + +And run the following command to generate the key (centos7.key is the name of my certificate, feel free to change it): + +``` +make centos7.key +``` + +``` +umask 77 ; \ /usr/bin/openssl genrsa -aes128 2048 > centos7.key Generating RSA private key, 2048 bit long modulus .+++ .........................................................................................+++ e is 65537 (0x10001) Enter pass phrase: **** + +Verifying - Enter pass phrase:**** +``` + +To generate the server SSL private key with OpenSSL, run the following command: + +``` +openssl rsa -in centos7.key -out centos7.key +``` + +``` +Enter pass phrase for centos7.key: ** **writing RSA key +``` + +Run the following command to create the CSR (Certificate Signing Request) file (centos7.csr is the name of my certificate, feel free to change it): + +``` +make centos7.csr +``` + +Fill the questions acording your needs: + +``` +umask 77 ; \ /usr/bin/openssl req -utf8 -new -key centos7.key -out centos7.csr You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- + +Country Name (2 letter code) [XX]: + +State or Province Name (full name) []: + +Locality Name (eg, city) [Default City]: + +Organization Name (eg, company) [Default Company Ltd]: + +Organizational Unit Name (eg, section) []: + +Centos7 Common Name (eg, your name or your server's hostname) []: + +Email Address []: + +Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: **** + +An optional company name []: +``` + +Generate a CSR (Certificate Signing Request) for the server with the OpenSSL tool: + +``` +openssl x509 -in centos7.csr -out centos7.crt -req -signkey centos7.key +``` + +The output is: + +``` +Signature ok subject=/C=BR/ST=SP/L=Campinas/O=Centos7/OU=Centos7/CN=centos7.local Getting Private key +``` + +Before we edit the ssl.conf file, make a copy of the file with the following command: + +``` +cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.old +``` + +Then edit the file: + +``` +vim /etc/httpd/conf.d/ssl.conf +``` + +Find the following directives, uncomment each one and edit them like this: + +``` +SSLCertificateKeyFile /etc/pki/tls/certs/centos7.key + +SSLCertificateFile /etc/pki/tls/certs/centos7.csr + +SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2 + +ServerName centos7.local:443 +``` + +Restart Apache with the following command: + +``` +systemctl restart httpd +``` + +To force OTRS to run in https mode, edit the following file: + +``` +vim /etc/httpd/conf/httpd.conf +``` + +At the end of file, uncoment the following directive: + +``` +IncludeOptional conf.d/*.conf +``` + +Edit the file zzz_otrs.conf: + +``` +vim /etc/httpd/conf.d/zzz_otrs.conf +``` + +After the line 26 (before the line module  mod_version.c) add the following directives: + +``` +RewriteEngine On +RewriteCond %{HTTPS} off +RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} +``` + +Restart Apache: + +``` +[root@centos7 ~]# systemctl restart httpd +``` + +To use extended features in OTRS, we have to install some PERL modules. Run the following command to install them: + +``` +yum -y install "perl(Text::CSV_XS)" "perl(Crypt::Eksblowfish::Bcrypt)" "perl(YAML::XS)" "perl(JSON::XS)" "perl(Encode::HanExtra)" "perl(Mail::IMAPClient)" "perl(ModPerl::Util)" +``` + +The OTRS system has a tool to check the PERL modules, run it like this to verify the system requirements: + +``` +cd /opt/otrs/bin +``` + +and run: + +``` +./otrs.CheckModules.pl +``` + +The output for our configuration must be: + +``` +o Apache::DBI......................ok (v1.12) o Apache2::Reload..................ok (v0.13) o Archive::Tar.....................ok (v1.92) o Archive::Zip.....................ok (v1.30) o Crypt::Eksblowfish::Bcrypt.......ok (v0.009) o Crypt::SSLeay....................ok (v0.64) o Date::Format.....................ok (v2.24) o DBI..............................ok (v1.627) o DBD::mysql.......................ok (v4.023) o DBD::ODBC........................Not installed! (optional - Required to connect to a MS-SQL database.) o DBD::Oracle......................Not installed! (optional - Required to connect to a Oracle database.) o DBD::Pg..........................Not installed! Use: 'yum install "perl(DBD::Pg)"' (optional - Required to connect to a PostgreSQL database.) o Digest::SHA......................ok (v5.85) o Encode::HanExtra.................ok (v0.23) o IO::Socket::SSL..................ok (v1.94) o JSON::XS.........................ok (v3.01) o List::Util::XS...................ok (v1.27) o LWP::UserAgent...................ok (v6.13) o Mail::IMAPClient.................ok (v3.37) o IO::Socket::SSL................ok (v1.94) o ModPerl::Util....................ok (v2.000010) o Net::DNS.........................ok (v0.72) o Net::LDAP........................ok (v0.56) o Template.........................ok (v2.24) o Template::Stash::XS..............ok (undef) o Text::CSV_XS.....................ok (v1.00) o Time::HiRes......................ok (v1.9725) o Time::Piece......................ok (v1.20_01) o XML::LibXML......................ok (v2.0018) o XML::LibXSLT.....................ok (v1.80) o XML::Parser......................ok (v2.41) o YAML::XS.........................ok (v0.54) +``` + +To start the OTRS Daemon with the "otrs" user, run the following command: + +``` +su -c "/opt/otrs/bin/otrs.Daemon.pl start" -s /bin/bash otrs +``` + +To disable the CentOS 7 firewall, run the following command: + +``` +systemctl stop firewalld +``` + +To disable CentOS 7 Firewall to start up automaticaly, run: + +``` +systemctl disable firewalld.service +``` + +Start the OTRS Daemon with: + +``` +su -c "/opt/otrs/bin/otrs.Daemon.pl start" -s /bin/bash otrsCron.sh +``` + +The output of command must be: + +``` +/opt/otrs/bin Cron.sh - start/stop OTRS cronjobs Copyright (C) 2001-2012 OTRS AG, http://otrs.org/ (using /opt/otrs) done +``` + +If you want to check the OTRS Daemon status, run the following command: + +``` +su -c "/opt/otrs/bin/otrs.Daemon.pl status" -s /bin/bash otrsCron.sh +``` + +Configuring OTRS in the crontab. Change the user root to otrs and start to edit the crontab: + +``` +su otrs + +crontab -e +``` + +Fill the crontab with the following content and save it: + +``` +# -- +# Copyright (C) 2001-2016 OTRS AG, http://otrs.com/ +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- + +# Who gets the cron emails? +MAILTO="root@localhost" +# -- +# Copyright (C) 2001-2016 OTRS AG, http://otrs.com/ +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- + +# check OTRS daemon status +*/5 * * * * $HOME/bin/otrs.Daemon.pl start >> /dev/null +``` + +### Configure OTRS on CentOS 7 + +Open a web browser and open the URL [https://centos7.local/otrs/installer.pl][8]. Remember, centos7.local is the name of my server, insert your hostname or IP address. The first screen shows the 4 steps to conclude the OTRS installation, press Next.   + +[ + ![OTRS installation screen](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.13_.jpg) +][9] + +License: to continue, read and accept the license to continue: + +[ + ![Accept the license and continue](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.14_.jpg) +][10]  + +Database Selection: select  the option **MySQL** and in the Install Type, mark the Create a new database for OTRS option and click on the next button: + +[ + ![Select database type mysql](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.15_.jpg) +][11] + +Configure MySQL: fill the fields User, Password and Host (remember the data of the MariaDB configuration that we made) and press check database settings: + +[ + ![Insert database login details](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.16_.jpg) +][12] + +The OTRS installer will create the database in MariaDB, press next button: + +[ + ![Create OTRS database](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.17_.jpg) +][13] + +OTRS database created successfully:  + +[ + ![OTRS Database created](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.18_.jpg) +][14] + +Config system settings: fill the fields with your own information and press next: + +[ + ![Set the personal config details](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.19_.jpg) +][15] + +OTRS E-mail configuration: fill in the fields acording your e-mail server. In my setup, for outbound email I use SMPTTLS and port 587, for inbound email, I use pop3, you will need an e-mail account. Check mail configuration or skip this step: + +[ + ![Email setup in OTRS](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.21_.jpg) +][16] + +To finish, take a note about the user and password to access the OTRS, after login you can change the password: + +[ + ![OTRS Username and password](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.23_.jpg) +][17] + +The OTRS url login is [https://centos7.local/otrs/index.pl?][18]. Remember, centos7.local is the name of my server, insert your hostnamen or IP address.: + +[ + ![Login to OTRS](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.25_.jpg) +][19] + +Login at the OTRS: + +[ + ![OTRS Admin Login](https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/OTRS_How_To_Alexandre_Costa.27_.jpg) +][20] + +OTRS is installed and ready to be configured with your support rules or business model. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/ + +作者:[Alexandre Costa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/ +[1]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/#thenbspenvironment +[2]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/#preparation +[3]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/#install-mariadb-on-centos- +[4]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/#install-epelnbsp +[5]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/#install-otrs +[6]:https://www.howtoforge.com/tutorial/how-to-install-otrs-on-centos-7/#configure-otrs-on-centos- +[7]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.jpg +[8]:http://centos7.local/otrs/installer.pl +[9]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.13_.jpg +[10]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.14_.jpg +[11]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.15_.jpg +[12]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.16_.jpg +[13]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.17_.jpg +[14]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.18_.jpg +[15]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.19_.jpg +[16]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.21_.jpg +[17]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.23_.jpg +[18]:https://centos7.local/otrs/index.pl +[19]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.25_.jpg +[20]:https://www.howtoforge.com/images/how_to_install_and_configure_otrs_open_source_trouble_ticket_system_software_on_centos_7/big/OTRS_How_To_Alexandre_Costa.27_.jpg diff --git a/sources/tech/20170201 lnav – An Advanced Console Based Log File Viewer for Linux.md b/sources/tech/20170201 lnav – An Advanced Console Based Log File Viewer for Linux.md new file mode 100644 index 0000000000..b040e51264 --- /dev/null +++ b/sources/tech/20170201 lnav – An Advanced Console Based Log File Viewer for Linux.md @@ -0,0 +1,194 @@ +lnav – An Advanced Console Based Log File Viewer for Linux +============================================================ + +[LNAV][3] stands for Log file Navigator is an advanced console based log file viewer for Linux. It does the same job how other file viewers doing like cat, more, tail, etc but have more enhanced features which is not available in normal file viewers (especially, it will comes with set of color and easy to read format). + +This can decompresses all the compressed log files (zip, gzip, bzip) on the fly and merge them together for easy navigation. lnav Merge more than one log files (Single Log View) into a single view based on message timestamps which will reduce multiple windows open. The color bars on the left-hand side help to show which file a message belongs to. + +The number of warnings and errors are highlighted in the display (Yellow & Red), so that we can easily see where the problems have occurred. New log lines are automatically loaded. + +It display the log messages from all files sorted by the message timestamps. Top & Bottom status bars will tell you, where you are in the logs. If you want to grep any particular pattern, just type your inputs on search prompt which will be highlighted instantly. + +The built-in log message parser can automatically discover and extract the each lines with detailed information. + +A server log is a log file which is created and frequently updated by a server to capture all the activity for the particular service or application. This can be very useful when you have an issue with application or service. In log files you can get all the information about the issue like when it start behaving abnormal based on warning or error message. + +When you open a log file with normal file viewer, it will display all the details in plain format (If i want to tell you in straight forward, plain white) it’s very difficult to identify/understand where is warning & errors messages are there. To overcome this kind of situation and quickly find the warning & error message to troubleshoot the issue, lnav comes in handy for a better solution. + +Most of the common Linux log files are located at `/var/log/`. + +**lnav automatically detect below log formats** + +* Common Web Access Log format +* CUPS page_log +* Syslog +* Glog +* VMware ESXi/vCenter Logs +* dpkg.log +* uwsgi +* “Generic” – Any message that starts with a timestamp +* Strace +* sudo +* gzib & bizp + +**Awesome lnav features** + +* Single Log View – All log file contents are merged into a single view based on message timestamps. +* Automatic Log Format Detection – Most of the log format is supported by lnav +* Filters – regular expressions based filters can be performed. +* Timeline View +* Pretty-Print View +* Query Logs Using SQL +* Automatic Data Extraction +* “Live” Operation +* Syntax Highlighting +* Tab-completion +* Session information is saved automatically and restored when you are viewing the same set of files. +* Headless Mode + +#### How to install lnav on Linux + +Most of the distribution (Debian, Ubuntu, Mint, Fedora, suse, openSUSE, Arch Linux, Manjaro, Mageia, etc.) has the lnav package by default, so we can easily install it from distribution official repository with help of package manager. For CentOS/RHEL we need to enable **[EPEL Repository][1]**. + +``` +[Install lnav on Debian/Ubuntu/LinuxMint] +$ sudo apt-get install lnav + +[Install lnav on RHEL/CentOS] +$ sudo yum install lnav + +[Install lnav on Fedora] +$ sudo dnf install lnav + +[Install lnav on openSUSE] +$ sudo zypper install lnav + +[Install lnav on Mageia] +$ sudo urpmi lnav + +[Install lnav on Arch Linux based system] +$ yaourt -S lnav +``` + +If the distribution doesn’t have the lnav package don’t worry, Developer offering the `.rpm & .deb`packages, so we can easily install without any issues. Make sure you have to download the latest one from [developer github page][4]. + +``` +[Install lnav on Debian/Ubuntu/LinuxMint] +$ sudo wget https://github.com/tstack/lnav/releases/download/v0.8.1/lnav_0.8.1_amd64.deb +$ sudo dpkg -i lnav_0.8.1_amd64.deb + +[Install lnav on RHEL/CentOS] +$ sudo yum install https://github.com/tstack/lnav/releases/download/v0.8.1/lnav-0.8.1-1.x86_64.rpm + +[Install lnav on Fedora] +$ sudo dnf install https://github.com/tstack/lnav/releases/download/v0.8.1/lnav-0.8.1-1.x86_64.rpm + +[Install lnav on openSUSE] +$ sudo zypper install https://github.com/tstack/lnav/releases/download/v0.8.1/lnav-0.8.1-1.x86_64.rpm + +[Install lnav on Mageia] +$ sudo rpm -ivh https://github.com/tstack/lnav/releases/download/v0.8.1/lnav-0.8.1-1.x86_64.rpm +``` + +#### Run lnav without any argument + +By default lnav brings `syslog` file when you are running without any arguments. + +``` +# lnav +``` + +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-1.png) +][5] + +#### To view specific logs with lnav + +To view specific logs with lnav, add the log file `path` followed by lnav command. For example we are going to view `/var/log/dpkg.log` logs. + +``` +# lnav /var/log/dpkg.log +``` + +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-2.png) +][6] + +#### To view multiple log files with lnav + +To view multiple log files with lnav, add the log files `path` one by one with single space followed by lnav command. For example we are going to view `/var/log/dpkg.log` & `/var/log/kern.log` logs. + +The color bars on the left-hand side help to show which file a message belongs to. Alternatively top bar also showing the current log file name. Most of the application used to open multiple windows or horizontal or vertical windows within the window to display more than one log but lnav doing in different way (It display multiple logs in the same window based on date combination). + +``` +# lnav /var/log/dpkg.log /var/log/kern.log +``` + +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-3.png) +][7] + +#### To view older/compressed logs with lnav + +To view older/compressed logs which will decompresses all the compressed log files (zip, gzip, bzip) on the fly, add `-r` option followed by lnav command. + +``` +# lnav -r /var/log/Xorg.0.log.old.gz +``` + +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-6.png) +][8] + +#### Histogram view + +First run `lnav` then hit `i` to Switch to/from the histogram view. +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-4.png) +][9] + +#### View log parser results + +First run `lnav` then hit `p` to Toggle the display of the log parser results. +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-5.png) +][10] + +#### Syntax Highlighting + +You can search any given string which will be highlighting on screen. First run `lnav` then hit `/` and type the string which you want to grep. For testing purpose, i’m searching `Default` string, See the below screenshot. +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-7.png) +][11] + +#### Tab-completion + +The command prompt supports tab-completion for almost all operations. For example, when doing a search, you can tab-complete words that are displayed on screen rather than having to do a copy & paste. For testing purpose, i’m searching `/var/log/Xorg` string, See the below screenshot. +[ + ![](http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-8.png) +][12] + + +-------------------------------------------------------------------------------- + +via: http://www.2daygeek.com/install-and-use-advanced-log-file-viewer-navigator-lnav-in-linux/ + +作者:[Magesh Maruthamuthu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.2daygeek.com/author/magesh/ +[1]:http://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/ +[2]:http://www.2daygeek.com/author/magesh/ +[3]:http://lnav.org/ +[4]:https://github.com/tstack/lnav/releases +[5]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-1.png +[6]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-2.png +[7]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-3.png +[8]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-6.png +[9]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-4.png +[10]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-5.png +[11]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-7.png +[12]:http://www.2daygeek.com/wp-content/uploads/2017/01/lnav-advanced-log-file-viewer-8.png diff --git a/translated/talk/20161227 2017 is the year that front-end developers should go back and master the basics.md b/translated/talk/20161227 2017 is the year that front-end developers should go back and master the basics.md new file mode 100644 index 0000000000..c1ffa1349e --- /dev/null +++ b/translated/talk/20161227 2017 is the year that front-end developers should go back and master the basics.md @@ -0,0 +1,152 @@ +2017年:前端开发者都应该回顾并掌握的基础 +====================== + + ![](https://cdn-images-1.medium.com/max/1000/1*1Xsnx4_M8uJc2klBxEtGLQ.jpeg) + +在当今的快节奏生态中,我们都倾向于将时间花在尝试那些最新的创意软件中,然后在网络进行激烈的辩论。 + +这里,我并不是说我们不能这样做。但我们的确应该把脚步放慢一些,并认真了解那些变化不太大的事情。这样不仅会提高工作质量和我们创造的价值 —— 这还讲循序渐进的帮助我们更快理解这些行的工具。 + +本文融合了我的个人经历以及对新一年的希冀。正如我想热切表达自己想法一样,我也期待能在评论区看到你的建议。 + +### 学习如何写出易读的代码 + +我们多数的工作并不是编写新代码,而是维护已有代码。这意味着你最终阅读代码的时间要比编写它所花费的时间要长,所以你需要为 _之后需要阅读你代码的程序员_ 精简代码,而非让代码区适应解释器。 + +这里我推荐你按以下顺序 — 由浅入深 — 阅读下面三本书: + +* Dustin Boswell 的 《[编写可读代码的艺术 (The Art of Readable Code)][1]》 +* Robert C. Martin 的 《[代码整洁之道 (Clean Code: A Handbook of Agile Software Craftsmanship)][2]》 +* Steve McConnell 的 《[代码大全 (Code Complete: A Practical Handbook of Software Construction)][3]》 + + ![](https://cdn-images-1.medium.com/max/1000/1*YQGwR6skf705fovSLCbmXQ.jpeg) + +### 深入学习 JavaScript + +现如今,每周都会出现一个新的 JavaScript 框架,并标榜自己比其他的任何旧框架都要好用。这样的情况下,我们很多人更倾向于花费时间来学习框架,而且这样也要比学习 JavaScript 本身要容易的多。如果说你正在使用框架,但并不了解该框架的工作方式,_立刻停止,并学习 JavaScript,直到你能够理解这些工具的工作方式为止_ 。 + +* 可以从 [Kyle Simpson][4] 的 [你所不知道的 JavaScript][5] 系列开始,这个可以在线免费阅读。 +* [Eric Elliott][6] 列出的 [2017 年:JavaScript 的学习目标][7]. +* [Henrique Alves][8] 列出的 [进行响应式开发之前必须了解的事情][9](实际上就是一个知识框架)。 +* Mike Pennisi 的 [JavaScript 开发者:注意你的语言][10] — 了解 ECMAScript 新特性的中 TC-39 发展过程。 + +### 学习函数式编程 + +多年以来,我们一直期待着 JavaScript 引入类,但真正有类之后,我们却不想在 JavaScript 中使用类了,我们只想使用函数。即使是编写 HTML,我们也是使用函数 (JSX)。 + +* Kyle Simpson 的 [轻量级函数式 JavaScript][11]。 +* Professor Frisby 的 [函数式编程完全指南][12] 和 [在线免费课程][13]。 + + ![](https://cdn-images-1.medium.com/max/1000/1*Helkj3sq3oVOc-dtjRgrYQ.jpeg) + +### 学习设计基础知识 + +作为一个前端开发者,我们比这个生态中的任何人 —— 可能甚至是设计人员 —— 都要更加接近用户。如果设计人员要指定你呈现在屏幕上的每一个像素,你可能会遇到各种莫名其妙的错误。 + +* [David Kadavy][16] 的《[黑客设计][14]》或对应的 [免费课程][15]。  +* [Tracy Osborn][18] 的讲座:[为非设计人员的设计知识][17]。 +* [Nathan Barry][20] 的 [Web 应用设计][19]。 +* [Jason Santa Maria][22] 的 [Web 页面设计][21]。 +* Alan Cooper 的 [The Inmates Are Running the Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity][23]。 +* 两篇关于 UI 动画的文章:[如何使用动画来提高 UX][24]、[过渡界面][25]。 + +### 学习如何与人协作 + +有些人很喜欢通过编程来与电脑而非与人进行交互。不幸的是,这样的结果并不是很好。 + +我们基本上不可能完全脱离群体来工作:我们总是需要和其他开发者、设计师以及项目经理 —— 有时候甚至要和用户 —— 交换意见。这是比较难的任务,但如果你想要真正理解你在做什么以及为什么要这么做的话,这一步是非常重要的,因为这正是我们工作的价值所在。 + +* [John Sonmez][27] 的《[软技能:代码之外的生存指南][26]》。 +* Robert C. Martin 的《[代码整洁之道:程序员的职业素养][28]》。 +* Jim Camp 的 《[从零开始:专业人士不想让你了解的谈判工具][29]》。 + + ![](https://cdn-images-1.medium.com/max/1000/1*zv6BXllLujNl-vDqkXQMqw.jpeg) + +### 学习如何为用户编写代码 + +与同事或其他人的交流大部分是以文本的形式进行的:目标描述和评论、代码注释、Git commit、即时聊天消息、电子邮件、推文、博客等。 + +想象一下,人们要花费多少时间来理解所有以上提到的这些。你过你能够书写的更加明确和简洁,这个时间便会大大减少,然后世界将是一个更好工作的地方。 + +* William Zinsserd 的《[On Writing Well: The Classic Guide to Writing Nonfiction][30]》。 +* William Strunk 和 E. B. White 的《[英文写作指南 (The Elements of Style)][31]》。 +* [奥威尔写作规则][32]。 +* 俄国:很好的 [Glavred course][33]。 + +### 学习计算机科学智慧 + +前端开发已经不仅仅简单的下拉菜单了,它比以前要复杂的多了。随着我们所需解决问题的复杂度越来越高,声名狼藉的“JavaScript 疲乏症”也随之出现了。 + +这意味着现在需要学习非前端开发人员近十年所积累形成的知识精华。而这也是我最想听到你向我推荐的内容了。 + +以下是我个人给大家的推荐: + +* Coursera 的 [学习想计算机科学家的思考方式][34]。 +* [DHH][36] 的 [对我意义非凡的五本书][35]。 + + +* * * + +读完本文,你有些什么建议呢?在这新的 2017 年里你又想学习些什么呢? + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://cdn-images-1.medium.com/fit/c/60/60/0*FXw8cxdKYar82R9X.jpeg) + +Web 开发者,充满激情的摄影者,疯狗的主人 (owner of crazy dogs ?)。 + +译者简介: + +![GHLandy](http://GHLandy.com/images/GHLandy.ico) + +[GHLandy](http://GHLandy.com) —— 欲得之,则为之奋斗 (If you want it, work for it.)。 + +-------------------------------------------------------------------------------- + +via: https://medium.freecodecamp.com/what-to-learn-in-2017-if-youre-a-frontend-developer-b6cfef46effd#.ss9xbwrew + +作者:[Artem Sapegin][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者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 diff --git a/translated/talk/20170109 How to get started as an open source programmer .md b/translated/talk/20170109 How to get started as an open source programmer .md new file mode 100644 index 0000000000..e53505dfd1 --- /dev/null +++ b/translated/talk/20170109 How to get started as an open source programmer .md @@ -0,0 +1,151 @@ +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") + +图片来源 : + +Zagrev [Flickr 网站][1] [CC BY-SA 2.0][2]。 + +当我们探索科技世界的时候,总是让人兴奋不已。很多科技的发展日新月异,你探索得越远越深,你看到的世界就越广阔无穷,这就像是[一只只驼下去的海龟][3]一样。因此,科技世界也像宇宙一样无穷无尽。如果你也渴望加入到推动技术世界发展的社区中,你应该如何开始呢?你要做的第一步是什么?以后应该怎么做? + +首先你得明白开源指的是开放软件源代码的意思。这个很好理解,但是“开源”这个词最近一段时间经常出现在我们身边,所以估计有时候大家都忘记了开源只是用来形容一种文化现象,而不是一家世界 500 强公司的名字。跟其它工作或组织不同的是,你不用去参加面试或填个申请表或注册表的方式来成为一名开源程序员。你需要做的就是_编程_,然后把代码共享出来,并且完全保证在任何情况下该代码都保持开放状态。 + +仅此而已,你已经成为一名开源程序员了! + +现在你已经明确自己的目标了,那么应该如何 + +### 技能树 + +你玩过 RPG 游戏吗?在那些游戏中就有线性“技能树”的相关概念。当你玩游戏时,你掌握了基本技能后,游戏便会自动“升级”,并且你也会获得新的技能,然后你再使用这些新的技能将游戏“升级”到一个更高的等级,你又会得到更多新的技能。通过这样不断的升级,获取新技能,以让你的游戏角色变得更强大。 + +成为一个程序员有点像提升你的技能树等级。你掌握了一些基础的技术,在参与开源项目开发的过程中,你不断实践,直至自己的技术等级上升到一个新的层次,之后你又懂了一些新的技术,并在项目开发过程中不断实践,不断提升技术等级,然后你再根据这个技能树不断成长,不断进步。 + +你会发现自己面临的不只一棵技能树。开源软件涉及到的技术比较多,包括很多参与者自身的优势、能力及兴趣爱好等。然而,有一些非常重要的技能有助于你成为一名伟大的程序员,不断的提高这些技能是成功参与到开源项目中的重要组成部分。 + +### 脚本编程 + + ![Scroll--How to program ](https://opensource.com/sites/default/files/scroll.png "Scroll--How to program") + +对于 POSIX 系统,比如 Linux 或 BSD 系统最大的优势之一就是在你每次使用电脑的过程中,你都有机会练习编程。如果你不知道如何开始编程,你可以从解决工作中的一些基本问题做起。想想你日常工作中有哪些重复性的工作,你可以通过编写脚本的方式来让它们自动执行。这一步非常简单,比如说批量转换文件格式或重置图片的大小、检查邮件,甚至是通过单击运行你最常用的五个应用程序。无论是什么任务,你可以花一些时间去编写脚本以让它们自动完成。 + +如果有些工作需要在控制终端下操作,那么你就可以编写脚本来完成。学习 'bash' 或 'tsch’ 编程,把编写系统脚本作为你写代码和理解系统的工作原理的第一步。 + +### 系统管理 + + ![Caesar head](https://opensource.com/sites/default/files/caesar_0.png "Caesar head") + +从这一点来讲,你也可以同时作为一个程序员,或者你还可以学习到多个技能树中的技能:那就是系统管理工作。跟程序员比起来,这两个职业在技能上有一些相似(一个优秀的系统管理员应该有一些编程经验,并能够熟练使用 Python , Perl ,或者其它类似的编程言语来解决一些独特的问题),而_程序员_指的是那些一直编写代码的人。 + +### 程序员 + + ![Wizard hat--How to program](https://opensource.com/sites/default/files/pointy-hat.png "Wizard hat--How to program") + +开源是学习编程技巧最好的方式:你可以查看其他人写的代码,从中借鉴他们的想法和技术,从他们的错误中学习,并跟自己写的代码进行对比以发现两者的优缺点,如果你是使用 Linux 或 BSD 操作系统,整个堆栈对你来说都是开放的,你可以随便操作。 + +这就像旅游指南里所说的,随心所欲。事实上你不太可能会去深入研究一个项目的源代码,然后你就很快学会编程了。编程是一份很难的技术活,否则大家都可以从事编程工作了。 + +幸运的是,编程是有逻辑和数据结构的,这些特性跟编程语言相关。你也许不会深入的去研究编程,但是你研究得越深,你懂的越多。 + +懂得如何控制和让电脑自动执行任务是一回事,但是知道如何编写其它人想自动实现任务的代码,才能说明你已经真正进入到编程领域了。 + +### 精通多种编程语言 + + ![Parrot--How to Program](https://opensource.com/sites/default/files/parrot-head.png "Parrot--How to Program") + +所有的编程语言都旨在处理相同的任务:让计算机能够完成计算工作。选择一种编程语言时你得考虑以下几个因素,你学编程的目的是什么,你所做的工作最常用的编程语言是什么,你最容易理解哪一种编程语言以及你的学习方式。 + +随便查下相关资料,你就可以了解编程语言的复杂性了,然后再根据自己的能力水平来决定先学习哪种编程语言。 + +选择编程语言的另一个方式是根据你的使用目的来决定,看看你身边的同事使用哪种编程语言。如果大家都是为了开发桌面环境的工具,你应该学习 C 语言和 Vala 语言,或者 C++ 语言。 + +总之,不要在各种编程语言之间不知所措。编程语言之间都是相通的。当你学好一种编程语言并能用它来解决工作中的一些实际问题的时候,你会发现学习另外一种编程语言更容易。毕竟,编程语言只是一些语法和相关规则的集合;学会一种编程语言后,再使用同样的方法去搞懂另外一种语言完全不是个事。 + +主要目的还是学会一种编程语言。选择一个比较适合自己或者你感兴趣的编程语言,或者是你的朋友在用的编程语言,或者是选择文档比较丰富,并且你理解起来也容易的编程语言,但是,最好是只关注并先学会其中的一种编程语言。 + +### 这是一个开源项目吗? + +无论你是编程新手还是一个老司机,在你进入到开源世界之前,你需要搞明白组成开源软件的重要一点就是“开放源代码”。 + +最近一些厂商惯用的市场营销策略就是宣称他们的软件是开源的。然而,有些厂商只是发布了一个公共的 API 或者表示他们愿意接受其它开源用户提交的代码而已。“开源”这个词不是一个商标,并且也没有任何组织来决定怎么使用这个词。但是, Debian Linux 创造人 Ian Murdock 联合成立的[开放源代码促进会][4]对开源这个词进行了[定义][5](授权“允许软件被用户免费使用,随意修改及分享”),并且被正式批准和[授予][6]许可证的软件才属于真正的开源软件。 + +把这些许可证条例应用到你的软件代码中,你就成为一名开源程序员了。 +恭喜你! + +### 开源社区 + + ![Community--How to program](https://opensource.com/sites/default/files/minions.png "Community--How to program") + +咨询任何开源软件爱好者,他们会告诉你开源软件最关键的是人。没有积极的开源贡献者,软件开发就会中止。计算机需要用户,提交缺陷的人、设计师及程序员。 + +如果你想加入全球开源社区为开源软件做贡献,即使你是个人用户,你同样需要成为该社区的一个成员。这通常包括预定邮件列表,加入 IRC 频道,或者在论坛里表现活跃,并从最低级别开始。任何成熟的开源社区都有很多积极的参与者,因此你得理解在这个社区同意你加入之前,你必须证明自己不会轻易地离开这个社区。并且准备好为那些你非常感兴趣的项目提供长期的支持。 + +如果你只是想给他们提供一些小的帮助,这也是可以接受的。我自己也提交一些小的更新包到一些项目中,有时候项目管理者会觉得这个更新比较好,有时候他们也会拒绝我提交的代码更新包。但是,如果这个被拒绝的更新包对我很重要,我同样会维护并应用到客户的系统中,之后,我同样会继续努力。 + +这只是参与到开源项目中的一部分。 + +但是这些社区在哪里呢?这个跟开源项目有关。有些项目有专职的社区管理员,他们会把所有的社区参与者招集到一起,让彼此之间更了解。有些项目则来自你身边的一些论坛,他们使用邮件列表,或者使用问题追踪器与参与者联系。找到这些开源社区对你来说也不是个事儿。 + +还有个重要的事情就是研究他们的源代码!有些开发商由于某些原因宣称他们的软件是开源的,因此你还得了解下他们的源代码。尽管要全面了解他们的项目绝非易事,但是你也知道了这个项目是如何管理的,他们最可能需要帮助的是什么。关于代码是如何组织的?这些代码有注释吗?它们使用统一的程序风格吗?这些问题你可以查阅相关文档,尤其是 README , LICENSE ,或者是 COPYING 这几个文件。 + +不要低估遵守开放式源代码承诺的重要性。这是你被允许参与进来到开源项目来的原因,因此,你得深入地考虑下你能从中学习到什么,以及你将如何为该项目提供帮助。 + +找到最佳的开源社区更像是约会,尤其更像是在[圣烛节][7]上的聚会。这需要时间,并且刚开始那几次有可能会失败。你参与这样的聚会越多,你就越了解这些开源项目。最后,你会更了解自己,当你找到了与其它参与者融为一体的方式时,你就已经成功了。总之,你得要有耐心,一切顺其自然。 + +### 行动比语言更重要 + + ![Wingfoot--How to Program](https://opensource.com/sites/default/files/wingfoot.png "Wingfoot--How to Program") + +作为一名开源程序员最重要的是写代码,任何想法都没多少意义。关键是把你的想法变成实际的东西。你要让大家都知道你很了解自己的工作,你不怕苦不怕累,也愿意在开源项目上花时间,并且能够通过编程的方式来实现自己的各种想法。 + +为了更高效地完成那些工作,当然,除了完成开源项目上的工作,你还要懂得如何授受其它参与者提交的更新,以及哪一个更新更有助于系统的稳定及发展。 + +从下面几点开始: + +* 熟悉一个项目及其它协作开发模式,并且也要支持这种开发模式。 +* 编写软件升级包,缺陷修复包,或者一些小功能,并且提交它们。 +* 如果你提交的更新补丁被拒绝了,也不要难过。他们拒绝的不是你个人,而是开发小组在针对你提交的代码进行评估后作出的一个反馈。 +* 如果你提交的代码被改得面目全非后才被接受也不要泄气。 +* 重头再来,不断努力,再接受更大的挑战。 + + ![Leaderboard--How to program](https://opensource.com/sites/default/files/leaderboard.png "Leaderboard--How to program") + +在开源项目中不应该开设排行榜。然而,有些开源社区却弄了个贡献排名,其实这没必要。大家只需要积极参与、贡献、提交自己的更新,然后把自己所做的提交都隐藏,这样就可以了。 + +### 开发软件 + + ![Treasure Map--How to Program](https://opensource.com/sites/default/files/treasure-map.png "Treasure Map--How to Program") + +编程在任何情况下都是为了自身的发展。无论你是否为了寻找解决问题的新方法,寻找优化代码的方式,学习新的编程语言,或者是学习如何更好的与其它人员合作,你都不要停止学习。你自己成长得越多,对开源项目越有帮助。 + +个人成长和职业技能的提升是你参与开源项目的终极目标,但是实际上这是一个贯穿整个项目的持续过程。开源程序员跟工务员不一样;这是一个持之以恒的过程。你需要持续不断的学习技术,分享知识,这个过程就像[游戏人生][8]中一样,但是你也学到了很多的东西。 + +这就是开源程序的过程:自由开发每一行代码。因此,找到你的技能树,激发出自己的潜能,不断提高自己的技能,并且积极参与到开源项目中。 +-------------------------------------------------------------------------------- + +作者简介: + +![](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/17/1/how-get-started-open-source-programmer + +作者:[Seth Kenlon][a] +译者:[rusking](https://github.com/rusking) +校对:[校对者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 diff --git a/translated/talk/20170110 What engineers and marketers can learn from each other.md b/translated/talk/20170110 What engineers and marketers can learn from each other.md new file mode 100644 index 0000000000..239dc17491 --- /dev/null +++ b/translated/talk/20170110 What engineers and marketers can learn from each other.md @@ -0,0 +1,104 @@ + +What engineers and marketers can learn from each other +============================================================ +工程师和市场营销人员之间能够相互学习什么? + +### 营销人员觉得工程师在工作中都太严谨了;而工程师则认为营销人员都很懒散。但是他们都错了。 + + ![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") +图片来源 : + +opensource.com + +在 B2B 行业从事多年的销售实践过程中,我经常听到工程师对营销人员的各种误解。下面这些是比较常见的: + +* ”搞市场营销真是浪费钱,还不如把更多的资金投入到实际的产品开发中来。“ +* ”那些营销人员只是一个劲儿往墙上贴各种广告,还祈祷着它们不要掉下来。这么做有啥科学依据啊?“ +* ”谁愿意去看哪些广告啊?“ +* ”对待一个营销人员最好的办法就是不订阅,不关注,也不理睬。“ + +这是我最感兴趣的一点: +_“营销人员都很懒散。”_ + +最后一点说的不对,不够全面,懒散实际上是阻碍一个公司发展的巨大绊脚石。 + +我来跟大家解释一下原因吧。 + +### 看到自己的身影 + +这些工程师的的评论让我十分的苦恼,因为我从中看到了自己当年的身影。 + +你们知道吗?我曾经也跟你们一样是一位自豪的技术极客。我在 Rensselaer Polytechnic 学院的电气工程专业本科毕业后便在美国空军开始了我的职业生涯,而且美国空军在那段时间还发动了军事上的沙漠风暴行动。在那里我主要负责开发并部属一套智能的实时战况分析系统,用于根据各种各样的数据源来构建出战场上的画面。 + +在我离开空军之后,我本打算去麻省理工学院攻读博士学位。但是上校强烈建议我去报读这个学校的商学院。“你真的想一辈子待实验室里吗?”他问我。“你想就这么去大学里当个教书匠吗? Jackie ,你在组织管理那些复杂的工作中比较有天赋。我觉得你非常有必要去了解下 MIT 的斯隆商学院。” + +我觉得自己也可以同时参加一些 MIT 技术方面的课程,因此我采纳了他的建议。但是,如果要参加市场营销管理方面的课程,我还有很长的路要走,这完全是在浪费时间。因此,在日常工作学习中,我始终是用自己所擅长的分析能力去解决一切问题。 + +不久后,我在波士顿咨询集团公司做咨询顾问工作。在那六年的时间里,我经常听到大家对我的评论: Jackie ,你太没远见了。考虑问题也不够周全。你总是通过自己的分析数据去找答案。“ + +确实如此啊,我很赞同他们的想法——因为这个世界的工作方式本该如此,任何问题都要基于数据进行分析,不对吗?直到现在我才意识到(我多么希望自己早一些发现自己的问题)自己以前惯用的分析问题的方法遗漏了很多重要的东西:开放的心态,艺术修养,情感——人和创造性思维相关的因素。 + +我在 2001 年 9 月 11 日加入达美航空公司不久后,被调去管理消费者市场部门,之前我意识到的所有问题变得更加明显。这本来不是我的强项,但是在公司需要的情况下,我也愿意出手相肋。 + +但是突然之间,我一直惯用的方法获取到的常规数据分析结果却与实际情况完全相反。这个问题导致上千人(包括航线内外的人)受到影响。我忽略了一个很重要的人本身的情感因素。我所面临的问题需要各种各样的解决方案才能处理,而不是简单的从那些死板的分析数据中就能得到答案。 + +那段时间,我快速地学到了很多东西,因为如果我们想把达美航空公司恢复到正常状态,还需要做很多的工作——市场营销更像是一个以解决问题为导向,以用户为中心的充满挑战性的大工程,只是销售人员和工程师这两大阵营都没有迅速地意识到这个问题。 + +### 两大文件差异 + +工程管理和市场营销之间的这个“巨大鸿沟”确实是根深蒂固的,这跟 C.P. Snow (英语物理化学家和小说家)提出的[“两大文化差异"问题][1]很相似。具有科学素质的工程师和具有艺术细胞的营销人员操着不同的语言,不同的文化观念导致他们不同的价值取向。 + +但是,事实上他们有更多的相似之处。华盛顿大学[最新研究][2](由微软、谷歌和美国国家科学基金会共同赞助)发现”一个伟大软件工程师必须具备哪些优秀的素质,“毫无疑问,一个伟大的销售人员同样也应该具备这些素质。例如,专家们给出的一些优秀品质如下: + +* 充满激情 +* 性格开朗 +* 强烈的好奇心 +* 技艺精湛 +* 解决复杂难题的能力 + +这些只是其中很小的一部分!当然,并不是所有的素质都适用于市场营销人员,但是如果用文氏图来表示这“两大文化“的交集,就很容易看出营销人员和工程师之间的关系要远比我们想象中密切得多。他们都是竭力去解决与用户或客户相关的难题,只是他们所采取的方式和角度不一致罢了。 + +看到上面的那几点后,我深深的陷入思考:_要是这两类员工彼此之间再多了解对方一些会怎样呢?这会给公司带来很强大的动力吧?_ + +确实如此。我在红帽公司就亲眼看到过样的情形,我身边都是一些“思想极端”的员工,要是之前,肯定早被我炒鱿鱼了。我相信公司里绝对发生过很多次类似这样的事情,一个销售人员看完工程师递交上来的分析报表后,心想,“这些书呆子,思想太局限了。真是一叶障目,不见泰山;两豆塞耳,不闻雷霆。” + +现在我才明白了公司里有这两种人才的重要性。在现实工作当中,工程师和营销人员都是围绕着客户、创新及数据分析来完成工作。如果他们能够懂得相互尊重、彼此理解、相辅相成,那么我们将会看到公司里所产生的那种积极强大的动力,这种超乎寻常的革新力量要远比两个独立的团队强大得多。 + +### 听一听他们的想法 + +成功案例:_建立开放式组织_ + +在红帽任职期间,我的主要工作就是想办法提升公司的品牌影响力——但是我从未想过让公司的 CEO 去写一本书。我把公司多个部门的“想法极端”的同事召集在一起,希望他们帮我设计出一个新颖的解决方案来提升公司的影响力,结果他们提出让公司的 CEO 写书这样一个想法。 + +当我听到这个想法的时候,我很快意识到应该把红帽公司一些经典的管理模式写入到这本书里:它将对整个开源社区的创业者带来很重要的参考价值,同时也有助于宣扬开源精神。通过优先考虑这两方面的作用,我们提升了红帽在整个开源软件世界中的品牌价值,红帽是一个可靠的随时准备着为客户在[数字化颠覆][3]年代指明方向的公司。 + +这一点才是主要的:确切的说是指导红帽工程师解决代码问题的共同精神力量。 Red Hatters 小组一直在催着我赶紧把开放式组织的模式在全公司推广起来,以显示出内外部程序员共同推动整个开源社区发展的强大动力之一:那就是强烈的共享欲望。 + +最后,要把开放式组织的管理模式完全推广起来,还需要大家的共同能力,包括工程师们强大的数据分析能力和营销人员美好的艺术素养。这个项目让我更加坚定自己的想法,工程师和营销人员有更多的相似之处。 + +但是,有些东西我还得强调下:开放模式的实现,要求公司上下没有任何偏见,不能偏袒工程师和市场营销人员任何一方文化。一个更加理想的开放式环境能够促使员工之间和平共处,并在这个组织规定的范围内点燃大家的热情。 + +所以,这绝对不是我听到大家所说的懒散之意。 + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/portrait_jackieyeaney_400x600.jpg?itok=zV4bnrzI) + +Jackie Yeaney —— Ellucian 公司市场总监 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/17/1/engineers-marketers-can-learn + +作者:[Jackie Yeaney][a] +译者:[rusking](https://github.com/rusking) +校对:[校对者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 diff --git a/translated/talk/20170111 How to choose your first programming language.md b/translated/talk/20170111 How to choose your first programming language.md new file mode 100644 index 0000000000..4116461722 --- /dev/null +++ b/translated/talk/20170111 How to choose your first programming language.md @@ -0,0 +1,128 @@ +如何挑选你的第一门编程语言 +============================================================[ + +][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") + + +opensource.com 供图 + +人们有着各种各样的原因想学编程。你也许想要做一个程序,或者你只是想投入其中。所以,在选择你的第一门编程语言之前,问问你自己:你想要程序运行在哪里?你想要程序做什么? + +你选择编程的原因决定第一门编程语言的选择。 + +_在这篇文章里,我会交换着使用“编程”(code , program)、“开发”(develop) 等动词,“代码”(code)、“程序”(program)、“应用”(application/app)等名词。这是考虑到你可能听过的语言用法_ + +### 了解你的设备 + +在你编程语言的选择上,你的程序将运行在何处是个决定性因素。 + +桌面应用是运行在台式机或者笔记本电脑上的传统软件程序。这样你将会编写同一时间内只能在一台电脑上运行的代码。移动应用,也就是熟知的“ APP ”,运行在使用 IOS Android 或者其他操作系统上的移动设备上。网页应用是功能像应用的网页。 + +按网络的 客户-服务器 架构分,网页开发者经常被分为两类: + +* 前端开发,就是编写运行在浏览器自身的代码。这是个面对用户的部分,或者说是程序的前端。有时候被称为客户端编程,因为浏览器是网络的客户-服务器架构的半壁江山。浏览器运行在你本地的电脑或者设备上。 + +* 后台开发,也就是大家所熟知的服务器端开发,编写的代码运行在你不能实际接触的服务器电脑上。 + +### 创造什么 + +编程是一门广泛的学科,能应用在不同的领域。常见的应用有: + +* 数据科学 +* 网页开发 +* 游戏开发 +* 不同类型的工作自动化 + +现在我们已经讨论了为什么你要编程,你要为运行在哪里而编程,让我们看一下两门对于新手来说不错的编程语言吧。 + +### Python + +[Python][2] 是对于第一次编程的人来说是最为流行的编程语言之一,而且这不是巧合。Python 是一门通用的编程语言。这意味着它能应用在广泛的编程任务上。你能用 Python 完成几乎_所有_事情。这一点使得很多新手能实际应用这门编程语言。另外, Python 有两个重要的设计特征,使得其对于新手更友好:清晰、类似于英语的[语法][3]和强调代码的[可读性][4]。 + +从本质上讲,一门编程语言的语法就是你所输入的能让这编程语言生效的内容。这包括单词,特殊字符(例如“ ; ”、“ $ ”、“ % ” 或者 “ {} ”),空格或者以上任意的组合。Python 尽可能地使用英语,不像其他编程语言那样经常使用标点符号或者特殊的字符。所以,Python 阅读起来更自然、更像是人类语言。这一点帮助新的编程人员聚焦于解决问题,而且他们能花费更少的时间挣扎在语言自身的特性上。 + +清晰语法的同时注重于可读性。在编写代码的时候,你将会创造代码的逻辑“块”,就是一些为了相关联目标而共同工作的代码。在许多编程语言里,这些块用特殊字符所标记(或限定)。他们或许被“ {} ”或者其他字符所包住。块分割字符和你写代码的能力,这两者的任意组合都能增加可读性。让我们来看一个例子。 + +这有个被称为 “ fun ”的简短函数。它要求输入一个数字,“ x ”就是它的输入。如果“ x ” 等于 ** 0 **,它将会运行另一个被称为“ no_fun ”的函数(这功能做了些很无趣的事情)。新函数不需要输入。反之,简短函数将会运行一个使用输入 “ x ” 的名为 “ big_fun ”的函数。 + +这个函数用[ C 语言 ][5]将会是这样写的: + +``` +void fun(int x) +{ + if (x == 0) { + no_fun(); + } else { + big_fun(x); + } +} +``` + +或者,像是这样: + +``` +void fun(int x) { if (x == 0) {no_fun(); } else {big_fun(x); }} +``` + +功能上两者等价,而且都能运行。" {} " 和 “ ;” 告诉我们哪里是代码块的不同部分。然而,第一个对于人们来说_明显_更容易阅读。相比之下完成相同功能的 Python 是这样的: + +``` +def fun(x): + if x == 0: + no_fun() + else: + big_fun(x) +``` + +在这里,只有一个选择。如果代码不是这样排列的,它将不能工作。如果你编写了可以工作的代码,你就有了可阅读的代码。同样也留意一下在语法上的差异。不同的是“ def ” ,在 Python 代码中这个词是英语单词,大家都很熟悉这单词的含义(译者注:def 是 definition 的缩写,定义的意思)。在 C 语言的例子中 “ void ” 和 “ int ” 就没有那么直接。 + +Python 也有个优秀的生态系统。这有两层意思,第一,你有一个使用该语言的庞大、活跃的社区,当你需要帮助指导的时候,你能向他们求助。第二,它有大量早已存在的库,库是指完成特定功能的代码集合。从高级数学运算、图形到计算机视觉,甚至是你能想象到的任何事情。 + +Python 成为你第一门编程语言有两个缺点。第一是它有时候安装起来很复杂,特别是在运行着 Windows 的电脑上。(如果你有一台 Mac 或者 Linux 的电脑,Python 已经安装好了。)虽然这问题不是不能克服,而且情况总在改善,但是这对于一些人来说还是个阻碍。第二个缺点是,对于那些明确想要建设网站的人来讲,虽然有很多用 Python 写的项目(例如 [Django][6] 和[Flask][7] ),但是编写运行在浏览器上的 Python 代码却没有多少选择。它主要是后台或者服务器端语言。 + +### JavaScript + +如果你知道你学习编程的主要原因是建设网站的话,[JavaScript][8]或许是你的最佳选择。 JavaScript 是关于网页的编程语言。除了是网页的默认编程语言之外, JavaScript 作为初学的语言有几点优点。 + +第一,无须安装任何东西。你可以打开文本编辑器(例如 Windows 上的记事本,但不是一个文字处理软件例如 Microsoft Word)然后开始输入 JavaScript 。代码将在你的浏览器中运行。最顶尖的浏览器内置了JavaScript 引擎,所以你的代码将会运行在几乎所有的电脑和很多的移动设备上。事实是,能马上在浏览器中运行代码提供了一个非常_快_的反馈,这对于新手来说是很好的。你能尝试一些事情然后很快地看到结果。 + +当 JavaScript 开始作为前端语言时,一个名为[Node.js][9] 的环境能让你编写运行在浏览器或者服务器上的代码。现在 JavaScript 能当作前端或者后台语言使用。这增加了它的使用人数。JavaScript 也有很多能提供除核心功能外的额外功能的包,这使得它能当作一门通用语言来使用。JavaScript 不只是网页开发语言,就像 Python 那样,它也有个充满生气的、活跃的生态系统。 + +尽管有这些优点,但是 JavaScript 对于新手来说并非十全十美。JavaScript 的语法并不像 Python 那样清晰,也不怎么像英语。更像是之前例子里提到的 C 语言。它并不是把可读性当作主要的设计特性。 + +### 做出选择 + +选 Python 或者 JavaScript 作为入门语言都很难出错。关键是你打算做什么。为什么你要学习编程?你的回答很大程度上影响你的决定。如果你是想为开源做贡献,你将会找到_大量_用这两门语言编写的项目。另外,许多原本不是用 JavaScript 写的项目仍能被用作前端部件。当你做决定时,别忘了你本地的社区。你有在使用其中一门语言的朋友或者同事吗?对于一个新手来说,有实时的帮助是非常重要的。 + +祝好运,开心编程。 + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/kojo_headshot_pro_square.jpg?itok=jv1kT8T0) + +Kojo Idrissa - 我是一个新晋的软件开发者(1 年),从会计和大学教学转型而来。自从有开源软件以来,我就是它的一个粉丝。但是在我之前的事业中并不需要做很多的编程工作。技术上,我专注于 Python ,自动化测试和学习 Django 。我希望我能尽快地学更多的 JavaScript 。话题上,我专注于帮助刚开始学习编程或想参与为开源项目做贡献的人们。我也关注在技术领域的包容文化。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/choosing-your-first-programming-language + +作者:[Kojo Idrissa][a] +译者:[ypingcn](https://github.com/ypingcn) +校对:[校对者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#Basics5 diff --git a/translated/talk/20170116 Terrible Ideas in Git.md b/translated/talk/20170116 Terrible Ideas in Git.md new file mode 100644 index 0000000000..f3af553b9e --- /dev/null +++ b/translated/talk/20170116 Terrible Ideas in Git.md @@ -0,0 +1,39 @@ +Git 中糟糕的想法 +============================================================ + + + ![Corey Quinn](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/corey-quinn-lcna.png?itok=IU3oGzfn "Corey Quinn") +在 LinuxCon 北美会议上 FutureAdvisor 的 Corey Quinn 说:“Git 的确让你可以做一些额外的强大的事。在这次谈论中,强大是愚蠢的委婉说法” [Linux 基金会][2] + +在 LinuxCon 北美会议上 FutureAdvisor 的 Corey Quinn 说:“Git 的确让你可以做一些额外的强大的事。在这次谈论中,强大是愚蠢的委婉说法”。在使用 Git 时,谁没有至少经历一个时刻让你感觉像个傻子?当然,Git 是很棒的,每个人都在使用它,你可以用几个基本命令完成你的大部分工作。但它也有强大的力量,让我们觉得我们不知道我们在做什么。 + +但这真的对我们自己不公平。没有人知道一切,每个人知道的都不同。Quinn 提醒我们:“在我许多谈话的 QA 时,人们有时举手说:“嗯,我有一个傻问题。” 你看到人们在那里说:“是啊!这是一个非常愚蠢的问题”。但是当他们得到答案时,这些人正在大量记笔记。 + +![Git](https://www.linux.com/sites/lcom/files/styles/floated_images/public/heffalump-git-corey-quinn_0.png?itok=xh5JlnLW "Git") + +[有权限使用][1] + +Quinn 开始了一些有趣的演示,你可以用 Git 做一些可怕的事情,例如 rebase master 然后进行强制推送搞乱整个项目、输入错误命令并收到 git 提示、提交大型二进制文件等。然后他演示了如何使这些可怕的事情不怎么可怕,如更加明智地管理大型二进制文件。“你可以提交大的二进制文件,你可以在 Git 中提交大文件,如果你需要存储大的二进制文件,这里有两个工具会真的加快加载,一个是 git-annex,这是由 Debian 开发人员 Joey Hess 开发的,而 git-lfs 是由 GitHub 支持的。 + +你有连续输入错误么?例如,当你想要 “git status” 时却输入 “git stitis”?Quinn 有一个方案:“Git 确实对别名有内置支持,所以你可以使用相对较长、复杂的东西,并把它命名为一个短的 Git 命令。” 你还可以使用 shell 别名。 + +Quinn 说:“我们都听说过 rebase master 然后强制推送,这样一个给你所有同事的搞笑恶作剧,它会改变历史,所以突然之前发生的事情并不是人们真正在做的事,而且其他人都被卷入了这个过程。。一群鲸鱼被称为“pod”,一群乌鸦中被称为“谋杀”,一群开发者被称为“合并冲突”。。。更严重的是,如果有人这样做,你有几个选择。包括从备份中恢复 master,还原提交,或者把责任人从屋顶扔下去。或者,采取一定的预防措施并使用一个并不知名的 Git 功能称为分支保护。启用分支保护后,无法删除或强制推送分支,并且在接受前,请求必须至少有一个审核。” + +Quinn 演示了几个更奇妙的有用工具,使 Git 更高效和万无一失,如 mr、vcsh和定制的 shell 提示。你可以在下面看到完整的视频,并享受更多的傻笑话。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/event/LinuxCon-Europe/2016/terrible-ideas-git-0 + +作者:[CARLA SCHRODER][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/cschroder +[1]:https://www.linux.com/licenses/category/used-permission +[2]:https://www.linux.com/licenses/category/linux-foundation +[3]:https://www.linux.com/files/images/heffalump-git-corey-quinnpng-0 +[4]:https://www.linux.com/files/images/corey-quinn-lcnapng +[5]:http://events.linuxfoundation.org/events/linuxcon-north-america diff --git a/translated/talk/20170116 Why every business should consider an open source point of sale system.md b/translated/talk/20170116 Why every business should consider an open source point of sale system.md new file mode 100644 index 0000000000..e2a37f2366 --- /dev/null +++ b/translated/talk/20170116 Why every business should consider an open source point of sale system.md @@ -0,0 +1,79 @@ +Why every business should consider an open source point of sale system +============================================================ +为什么每家企业都应该考虑使用开源的 POS 系统 + + ![Why every business should consider an open source point of sale system](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_lovemoneyglory2.png?itok=WxnzxyWP "Why every business should consider an open source point of sale system") +图片来源 :  + +opensource.com + +销售点终端 (POS) 系统是从很久以前的简单的收银机发展而来的。如今的 POS 系统可以提供一体化解决方案,包括支付流程,库存管理,营销工具等等。零售店也可以使用移动设备来接收现金流和各种成本支出相关的日报表。 + +POS 系统是每家企业重要的生命线,那就意味着你在选择 POS 系统的过程中要非常谨慎。目前可供选择的收银系统也很多,但是如果你想节约成本,适应不断变化的业务需求,跟上技术发展的脚步,你应该很明智地考虑使用开源系统。你可以随意使用一款开源 POS 系统公开的源代码,这比那些严格保密源代码的专有系统要有更大的优势。 + +使用开源的 POS 系统,你可以获得它的一些非常重要的特性。 + +### 无限的灵活性 + +开源系统与其它系统的兼容性非常好。它们与第三方厂家系统进行集成的能力——从帐务和客户关系管理软件到订单管理和库存管理系统——当企业管理者想要扩展专有 POS 系统以外的其它功能时,开源系统有更强大的优势。 + +在 [2014 年科技调查][7] 活动中,很多餐厅管理者声称 POS 系统的功能集成度将会是他们考虑更换新系统的主要因素。这是开源系统最具亮点的一方面。专有系统买来什么样就是什么样,很难与其它厂家的系统进行集成。但是使用开源系统,你就可以进行无限的集成及定制功能。如果你觉得你们公司的商业模式会不断的增长和变化,那么只有考虑使用开源的 POS 系统才能根据需要实时调整系统。 + +### 更快的开发速度 + +开源系统的另外一个优势是它有很多的社区开发者提供技术支持,他们持续不断的提交新功能,并且优化原有的功能。由于这种特性,开源项目的开发周期要比商用产品快得多——修复缺陷的速度更快,更新升级也很快,并且新的功能模块也不断地被开发出来。 + +### 更低的成本 + +也就是说,“更低的成本”意味着“基本免费”。你还需要购买相关硬件产品,只是软件本身是免费使用的。开源 POS 系统不像专有 POS 系统那样在购买时或是后期维护过程中需要支付高昂的费用,其每年的维护费在 3000 至 50000 美元之间,开源系统也不会像专有系统那样需要花钱来购买。 + +在 [2013 年版][8] 的餐饮行业技术服务调查研究过程中,有超过一半的受访餐厅老板表示他们从很多的技术产商购买服务——有些餐厅所面对的技术厂家多达 10 个。而使用纯粹的开源定制化系统不需要支付维护费用,这从节约成本上来说意义非常重大。 + +然而,有一点我还得提醒大家。如果你们公司没有一个技术精湛的员工提供技术支持,你可能还需要聘请外部技术人员来帮助你们安装,调试和升级系统。开源系统允许用户无限制集成和定制化开发,但是你还需要有技术精湛的专家来支持才行,这也会产生额外的费用。尽管如此,开源系统仍然是一个非常具有成本效益的选择。 + +### 更好的安全性 + +如果任何人都可以看到源代码,那是不是也意味着它同样对那些怀有恶意并想入侵你系统的程序员开放呢?那不就是一个安全上的严重隐患吗?事实正好相反。 + +大量的社区开发者在开发新功能的同时也会检查并修复影响系统安全的各种漏洞。有那么多的程序员在分析和维护开源软件的源代码,这可比专有软件开发商对代码的审查要严格得多。因此,开源的 POS 系统实际上更安全。 + +有很多开源的 POS 系统解决方案可供选择,我列出一部分来: + +* [Chromis][1] +* [Drupal POS][2] +* [Floreant][3] +* [Odoo][4] +* [Open Source Point of Sale][5] +* [Unicenta][6] + +### 勇敢地跨出第一步 + +你比其它人更了解你们公司。只有你能决定哪种开源系统最适合你们公司。由于开源 POS 系统比专有 POS 系统有更多亮丽的优点——灵活性、开发快速、低成本、更安全——因此,每个公司都应该考虑使用开源的 POS 系统。 + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/preston-pilgrim-2016_0.jpg?itok=7fzNsTww) + +我是 AcroMedia 公司数字化市场营销项目经理。我们主要使用 Drupal 开源系统来为客户提供定制化商业解决方案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/open-source-point-sale-system + +作者:[Preston Pilgrim][a] +译者:[rusking](https://github.com/rusking) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/preston-pilgrim +[1]:http://chromis.co.uk/ +[2]:https://www.acromediainc.com/drupal-pos +[3]:http://floreant.org/ +[4]:https://www.odoo.com/ +[5]:https://github.com/jekkos/opensourcepos +[6]:https://unicenta.com/ +[7]:http://hospitalitytechnology.edgl.com/news/POS-Integration-Becoming-a--Must-Have-94389 +[8]:https://pos.toasttab.com/restaurant-technology-industry-report/2015 diff --git a/translated/talk/20170118 Do I need to provide access to source code under the AGPLv3 license.md b/translated/talk/20170118 Do I need to provide access to source code under the AGPLv3 license.md new file mode 100644 index 0000000000..2aa3e28983 --- /dev/null +++ b/translated/talk/20170118 Do I need to provide access to source code under the AGPLv3 license.md @@ -0,0 +1,38 @@ +我需要在 AGPLv3 许可证下提供源码么? +============================================================ + ![Do I need to provide access to source code under the AGPLv3 license?](https://opensource.com/sites/default/files/styles/image-full-size/public/images/law/LAW_PatentSpotlight_520x292_cm.png.png?itok=bCn-kMx2 "Do I need to provide access to source code under the AGPLv3 license?") + +图片提供: + +opensource.com + +[GNU Affero 通用公共许可证版本 3][1](A​​GPLv3)是与 GPLv3 几乎相同的公共版权许可证。两个许可证具有相同的公共版权范围,但在一个重要方面有重大差异。 AGPLv3 的第 13 节规定了 GPLv2 或 GPLv3 中不存在的附加条件: + +>你必须给你那些使用计算机网络远程(如果你的版本支持此类交互)与它交互的用户提供一个通过网络服务器利用一些标准或者常规复制手段免费获得相关你的版本的源码的机会。 + +尽管“通过计算机网络远程交互”的范围应该被理解为涵盖超越常规 SaaS 的情况,但是这个条件主要适用于目前被认为是 SaaS 的部署。目标是在用户使用 web 服务提供功能但是不提供功能代码的分发的环境中关闭普通 GPL 中的感知漏洞。因此,第 13 节提供了超出 GPLv2 第 3 节以及 GPLv3 和 AGPLv3 第 6 节中包含的目标代码分发触发要求的额外源码公开要求。 + +常常被误解的是,AGPLv3 第 13 节中的源代码要求仅在 AGPLv3 软件已被“你”(例如,提供网络服务的实体)修改的地方触发。我的解释是,只要“你”不修改 AGPLv3 的代码,许可证不应该被理解为需要按照第 13 节规定的方式访问相应的源码。如我所见,尽管即使公开许可证不必要的源代码也是一个好主意,但在 AGPL 下许多未修改以及标准部署的软件模块根本不会触发第 13 节。 + +如何解释 AGPL 的条款和条件,包括 AGPL 软件是否已被修改,可能需要根据具体情况的事实和细节进行法律分析。 + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/kaufman-picture.jpg?itok=FPIizDR-) + +Jeffrey R. Kaufman 是全球领先的开源软件解决方案提供商 Red Hat 公司的开源 IP 律师。Jeffrey 也是托马斯·杰斐逊法学院的兼职教授。在入职 Red Hat 之前,Jeffrey 曾经担任高通公司的专利顾问,向首席科学家办公室提供开源顾问。Jeffrey在 RFID、条形码、图像处理和打印技术方面拥有多项专利。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/providing-corresponding-source-agplv3-license + +作者:[Jeffrey Robert Kaufman][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jkaufman +[1]:https://www.gnu.org/licenses/agpl-3.0-standalone.html diff --git a/translated/talk/20170118 How to gain confidence to participate in open source.md b/translated/talk/20170118 How to gain confidence to participate in open source.md new file mode 100644 index 0000000000..507cf0872c --- /dev/null +++ b/translated/talk/20170118 How to gain confidence to participate in open source.md @@ -0,0 +1,85 @@ +如何从参与开源项目的过程中获取自信 +=============== + ![如何从参与开源项目的过程中获取自信](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_community_lead.jpg?itok=anXgpnwG "How to gain confidence to participate in open source") + +图片来源:[Gabriel Kamener, Sown Together][1] 原创,经 Jen Wike Huger 修改。 + +随着大脑的发育,你渐渐学会了这世上什么事情可以/应该做,以及什么事情不能/不应该做。你所有的行为都受到周围大众的影响,很多时候,阻碍你参与某事的原因就是你缺乏自信。 + +纵观我们的生活,我们都或多或少的受到了世俗和社会行为的“教条”影响。我们可能从小就被这样教育:演说家说的都是真理、CEO 都是有远见的、警察维护社会秩序,尊重别人代表着静听让人把话说完,如果人家说错了,你要看场合轻柔的指出来 —— 好吧,这有点复杂。 + +当你决心参与到开源项目之中去的时候,自信将扮演重要角色。开源社区有其固有的参与性。参与就相当于开源世界的流通货币,持有该货币的量取决于你的自信。你的参与性越高、技能越高、分享你的想法和简洁次数越多,你就越能通过自己的提交 (commit) 来改善某一个项目。所有这些都需要你有很强的信念 —— 你有值得分享的事情 —— 并且你会常常思考自己要做什么、分享什么。 + +这里不得不说说这样一个事实:我们每一个人都一些值得分享的事情。但是你要找出这个值得分享的事情是什么,以及在哪个位置分享它才能把这个分享推向最积极、最有意义的一面。 + +认真思考一下三点,这将增强你的自信,并能让你在开源社区中更好的取得进步。 + +### 没有人会站在你的角度来看待你 + +你要时刻谨记着:你是完全独立的个人,他人对你做出的评论就像是不存在一样,只有这样才能更好的获得自信。 + +我们都习惯了这样理解,周围的人都是根据我们的行为来做出评判的。这一习惯相当于学习如何更像社会群体一样生活的副产品。而且很可能在我们的童年,父母根据我们的行为设置的奖励机制时,这个习惯就根植我们心底。到了青春期,老师们对我们的表现来评价,给我们划分等级和分数,拿我们和身边的小伙伴对比。这样的动力和奖励机制给我们的大脑建立了一个包括自我反思在内的反馈回路。我们需要预测自己能否得到回报,并要为那些可能发生的事情做好应对。 + +现今的我们都有这样第一个疑惑:身边的人是如何看到我的?可能因此,真相是多数人都不会花太多时间来对你进行正确客观的评价。我们所有人只是关注自己的回报,我们有自己热衷于某件事的的热情、有大量急待解决的问题。也有一些人忙于关心他们自己如何影响身边的人,他们并不会在身上花费时间。他们根本不会注意到你是否出错、大声谈话还是向他们的背景乐一样。所有的那些疑惑都只是在你自己的脑海中而已,而非在其他任何人脑中。 + +我们需要为人们所接受的愿望也是人生意义的一部分,但是这类接受我们所遇之人的一时兴起。这些人可能对我们缺乏全面认识,比如我们叫什么、我们来自哪里、形成我们认知的经历,等等。我们能否为人们所接受是一件不受我们自身控制的事情。但是,我们是可以通过与之交流来改变的。 + +在开源的高密度社区的世界里,记住这一点是非常重要的:人们是不会过多的考虑你的。因为你的同事和导师都在忙于其他项目或则社区成员。 + +一旦你认知了这一点,通过积极地沟通来热情拥抱这个世界吧。寻求帮助、告知他人你的需求、指出你的贡献、让人们知道你和他们在一起努力、你也是这个社区中的活跃分子。当人们向你靠拢 ——而非相反 —— 时,你的开源可信度和自信会得到极大的提高。 + +### 所有人都热衷于分享自己熟知的事情 + +任何成功的开源社区都是一个包含教和学的社区。为沐浴在开源中,你不仅需要用到自身的已有知识,还需要不断的吸收消化其他人提供课程中的知识。幸运的是,人们都普遍热衷于分享他们熟悉的事情。 + +思考一下,当他人问及你的观点时,你是什么感受。得知他人认可了你所说的观点,对你的 ID 和个人精神是多么美好的一件事。 + +在儿童期时,我们的大脑并没有那么发达,无法为我们容纳现实世界中大量的信息量。我们曾一度认为自己是世界的中心。在六岁以前,我们的认知一直在不断成长。在此期间,我们的额父母会因我们哭泣而做出回应,周围的成年人都会满足我们要求。这会在我们心底形成自己在世界上最重要的证据。 + +我们的神经回路在此期间建立完成,我们的性格也在此期间形成。随着我们学会参与社会和城市的生活,我们逐渐的认识到自己并非世界的中心。然而,最初形成并深植我们心底那种意识并不会因此马上就消除掉。正确理解我们在整个社会氛围中的个人意识将有助于你与他人建立连接并融洽相处。 + +在团结协作中慢慢积累学习经验可以很好的磨练自己、发展自己社会关系和提高自身技能。想要进军开源的世界,不断地学习是不可或缺的。 + +那么,这些和自信有些什么关系呢?通过表明你重视他人的知识和付出,你提高的不仅是他们的自信,还有你自己的自信。那时你将会感到更加灵活。有些时候,你不得不承认自己也有不懂的地方。 + +自信自认也许会说“是的,我不知道”,但却不会因此而沮丧。 + +### 一分耕耘,一分收获 (You reap what you sow) + +你一定听过“不懂装懂,永远是饭桶”。这样说吧,自信就像其他很多的心理现象。 +积极地提示自己:我很聪明、有趣、引人关注、极富天赋、健谈、是一个很好的伙伴、独一无二、知识面广、学习能力强、常常自省的思想者,或者是其他你想要具备的特质,久而久之你就会觉得自己就是这样的人。并且,如果这可以在你身上生效,在其他人身上也一样。。 + +我们把这个称为自我肯定。 + +此外,在开源的世界中,你是如何为人考虑、如何待人,那么反过来,他人也会是这样的。如果你想在开源贡献中获得成功,你就要有足够的自信来相信自己坚持的立场和事物,当然了,你要以一种可以让人接受的方式来表现,同时还要包容其他的意见和观点。领导者的标志就是,在生活中塑造他们想要看到的形象,而不管是否有他人模仿。 + +那么,你是否有其他增强自信的方法呢?记得在评论区告诉我们哦。 + +---------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/profilepicsq_0.jpg?itok=CVMJs36A) + +Laura Hilliger - 艺术家、教育事业者、作家、技术专家。她是一个多媒体设计师和开发者、技术联络员、项目经理、一个开放且喜欢协作环境的网络黑客。她主张变革,目前为发展壮大绿色和平组织二辛勤工作。Alum @Mozilla,UC Berkeley,BAVC, Adobe。Twitter @epilepticrabbit 。 + +---------------------------------- + +译者简介: + +![GHLandy](http://GHLandy.com/images/GHLandy.ico) + +[GHLandy](http://GHLandy.com) —— 欲得之,则为之奋斗 (If you want it, work for it.)。 + +----------------------------------- + +via: https://opensource.com/article/17/1/3-ways-improve-your-confidence + +作者:[Laura Hilliger][a] +译者:[GHlandy](https://github.com/GHlandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/laurahilliger +[1]:https://www.flickr.com/photos/42647587@N06/ diff --git a/translated/talk/20170120 5 ways to expand your projects contributor base.md b/translated/talk/20170120 5 ways to expand your projects contributor base.md new file mode 100644 index 0000000000..e96982d1ac --- /dev/null +++ b/translated/talk/20170120 5 ways to expand your projects contributor base.md @@ -0,0 +1,75 @@ +5 个扩展你项目贡献者基础的方法 +============================================================ + ![5 ways to expand your project's contributor base](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_cubestalk.png?itok=MxdS-jA_ "5 ways to expand your project's contributor base") + +图片提供  + +opensource.com + +许多自由和开源软件项目开始解决一个问题时,就人们开始为它们贡献,因为他们也想修复他们遇到的问题。当项目的最终用户发现它对他们的需求有用,项目就开始增长。这种共同的目的和焦点吸引人们到同一个项目社区。 + +像任何事物都是有寿命的,增长即是标志也是项目成功的来源。那么项目领导和维护者如何鼓励贡献者基数的增长?这里有五种方法。 + +### 1. 提供好的文档 + +人们经常低估项目[文档][2]的重要性。它是项目贡献者的主要信息来源,它会激励他们努力。信息必须是正确和最新的。它应该包括如何构建软件、如何提交补丁、编码风格指南等步骤。 + +查看长期科技作家和编辑的 Bob Reselman 的[ 7 个创建世界级文档的规则][3]。 + +开发人员文档的一个很好的例子是[ Python 开发人员指南][4]。它包括清晰简洁的步骤,涵盖 Python 开发的各个方面。 + +### 2. 提供简单入口 + +如果你的项目有[问题或 bug 追踪][5],请确保将初级任务标记为一个“容易 bug ”或“起点”。新的贡献者可以很容易地通过解决这些问题进入项目。追踪器也是标记非编程任务(如平面设计、图稿和文档改进)的地方。有许多项目成员不是每天都编码,但是却通过这种方式成为推动力。 + +Fedora 项目维护一个这样的[轻松修复或入口跟踪][6]。 + +### 3. 为补丁提供常规反馈 + +即使它是一行,也要确认每个补丁,并给作者反馈。提供反馈有助于吸引潜在的候选人,并指导他们熟悉项目。所有项目都应有一个邮件列表和[聊天功能][7]进行通信。问答可在这些媒介中发生。大多数项目不会在一夜之间成功,但那些繁荣的列表和沟通渠道创造一个支持增长的环境。 + +### 4. 推广你的项目 + +开始解决问题的项目实际上可能对其他开发人员也有用。作为项目的主要贡献者,你的责任是写下你的的项目并推广它。写博客文章,并在社交媒体上分享项目的进展。你可以简要描述如何作为项目的贡献者开始使用,并在该描述中提供对主要开发者文档的参考。此外,请务必提供有关路线图和未来版本的信息。 + +获取 Opensource.com 的社区经理 Rikki Endsley 的获得你的听众的[写作提示][8]。 + +### 5. 保持友好 + +友好的对话语调和迅速的回复将加强人们对你的项目的兴趣。最初,问题只是为了寻求帮助,但在未来新的贡献者也可能会提出想法或建议。使他们有信心他们可以成为项目的贡献者。 + +记住你一直再被评判。人们会观察任何项目开发者如何在邮件列表或聊天上的交谈。这些意味着对新贡献者的欢迎和开放。当使用技术时,我们有时忘记人们,但这对于任何项目的生态系统都很重要。考虑一个情况,项目是很好的,但项目维护者不是很受欢迎。该管理员可能会驱使用户远离项目。对于有大量用户基数的项目而言,不被支持的环境可能导致分裂,一组用户可能决定 fork 并启动新项目。在开源世界中有这样的成功例子。 + +另外,对于持续增长以及对项目不断的点子,拥有来自不同背景的人是很重要的。 + +最后,项目主人有责任维持和帮助项目成长。指导新的贡献者是项目的关键,他们将成为项目和社区的未来领导者。 + +阅读:由红帽的内容战略家 Nicole Engard 写的_[ 7 种方式让新的贡献者感到受欢迎][1] _。 + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/pictures/ar1dbnui.jpg?itok=4Xa7f2cM) + +Kushal Das - Kushal Das 是 Python 软件基金会的一名 CPython 核心开发人员和主管。他是一名长期的 FOSS 贡献者和导师,他帮助新人进入贡献世界。他目前在 Red Hat 担任 Fedora 云工程师。他的博客在 https://kushaldas.in。你也可以在 Twitter @kushaldas 上找到他 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/expand-project-contributor-base + +作者:[Kushal Das][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/kushaldas +[1]:https://opensource.com/life/16/5/sumana-harihareswara-maria-naggaga-oscon +[2]:https://opensource.com/tags/documentation +[3]:https://opensource.com/business/16/1/scale-14x-interview-bob-reselman +[4]:https://docs.python.org/devguide/ +[5]:https://opensource.com/tags/bugs-and-issues +[6]:https://fedoraproject.org/easyfix/ +[7]:https://opensource.com/alternatives/slack +[8]:https://opensource.com/business/15/10/what-stephen-king-can-teach-tech-writers diff --git a/translated/talk/The history of Android/31 The (updated) history of Android.md b/translated/talk/The history of Android/31 The (updated) history of Android.md new file mode 100644 index 0000000000..c9c819c4b1 --- /dev/null +++ b/translated/talk/The history of Android/31 The (updated) history of Android.md @@ -0,0 +1,229 @@ +安卓编年史 + +### 安卓 6.0 棉花糖 + +2015 年 10 月,谷歌给世界带来了安卓 6.0 棉花糖。配合这个版本的发布,谷歌委托生产了两部新的 Nexus 设备:[华为 Nexus 6P 和 LG Nexus 5X][39]。除了常规的性能升级,新手机还带有一套关键硬件:为棉花糖的新指纹 API 准备的指纹识别器。棉花糖还引入了一个疯狂的全新搜索特性,被称作“Google Now on Tap”,用户控制的应用权限,一个全新的数据备份系统,以及许多其它的改良。 + +#### 新谷歌应用 + + + +* [ + ![](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] + +棉花糖是[谷歌大标志重新设计][40]后的第一个安卓版本。系统也随之升级,主要是一个新的谷歌应用,给搜索小部件,搜索页面以及应用图标添加了一个多彩的标志。 + +谷歌将应用抽屉从页面导航的横向布局还原回了单页竖直滚动表的形式。早期版本的安卓用的都是竖直滚动表的形式,直到谷歌在蜂巢中改成了横向页面系统。滚动单页面让人更容易从很多应用中找到目标。一项“快速滚动”的特性同样好用,它可以让你拖动滚动条来激活字母索引。新的应用抽屉布局也用到了小部件抽屉上。考虑到旧系统中小部件轻松就超过了 15 页,这是个大改进。 + +棉花糖应用抽屉顶部的“建议应用”栏也让查找应用变得更快。该栏显示的内容一直在变化,试图在你需要的时候为你提供你需要的应用。它使用了算法来统计应用使用,经常一起打开的应用以及每天的打开次数。 + +#### Google Now on Tap——一个没有完美实现的特性 + + + +* [ + ![](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] + +棉花糖的头等新特性之一就是“Google Now on Tap”。有了 Now on Tap,你可以在安卓的任意界面长按 home 键,安卓会将整个屏幕发送给谷歌进行处理。谷歌会试着分析页面上的内容,并从屏幕底部弹出显示一个特殊的搜索结果列表。 + +Now on Tap 产生的结果不是通常的 10 个蓝色链接——即便那必定有一个通往谷歌搜索的链接。Now on Tap 还可以深度连接到其它使用了谷歌的应用索引功能的应用。他们的想法是你可以在 Youtube 音乐视频那里唤出 Now on tap,然后获得一个到谷歌 Play 或亚马逊“购买”页面的链接。在演员新闻文章处唤出 Now on Tap 可以链接到 IMDb 应用中该演员的页面上。 + +谷歌没有让这成为私有特性,而是给安卓创建了一个全新的“Assistant API(助理 API)”。用户可以挑选一个“助理应用”,它可以在长按 home 键的时候获取很多信息。助理应用会获取所有由当前应用加载的数据——不仅是直接从屏幕获取到的——连同所有这些图片还有任何开发者想要包含的元数据。这个 API 驱动了谷歌 Now on Tap,如果愿意的话,它还允许第三方打造 Now on Tap 的竞争对手。 + +谷歌在棉花糖的发布会上炒作了 Now on Tap,但实际上,这项特性不是很实用。谷歌搜索的价值在于你可以问它准确的问题——你输入你想要的内容,它搜索整个互联网寻找答案或网页。Now on Tap 让事情变得无限困难,因为它甚至不知道你要问的是什么。你带着特定意图打开了 Now on Tap,但你发送给谷歌的查询是很不准确的“屏幕上的所有内容”。谷歌需要猜测你查询的内容然后试着基于它给出有用的结果或操作。 + +在这背后,谷歌可能在疯狂处理整个页面文字和图片来强行获得你想要的结果。但往往 Now on Tap 给出的结果像是页面每个合适的名词的搜索结果列表。从结果列表中筛选多个查询就像是陷入必应的“[搜索结果过载][41]”广告里那样的情形。查询目标的缺失让 Now on Tap 感觉像是让谷歌给你读心,而它永远做不到。谷歌最终给文本选中菜单打了补丁,添加了一个“助理”按钮,给 Now on Tap 提供一些它极度需要的搜索目标。 + +不得不说 Now on Tap 是个失败的产物。Now on Tap 的快捷方式——长按 home 键——基本上让它成为了一个隐藏,难以发现的特性,很容易就被遗忘了。我们推测这个特性的使用率非常低。即便用户发现了 Now on Tap,它经常没法读取你的想法,在几次尝试之后,大多数用户可能会选择放弃。 + +随着 2016 年 Google Pixels 的发布,谷歌似乎承认了失败。它把 Now on Tap 改名成了“屏幕搜索”并把它降级成了谷歌助手的支援。谷歌助理——谷歌的新语音命令系统——接管了 Now on Tap 的 home 键手势并将它关联到了语音系统激活后的二次手势。谷歌似乎还从 Now on Tap 差劲的可发现性中学到了教训。谷歌给助理给 home 键添加了一组带动画的彩点,帮助用户发现并记住这个特性。 + +#### 权限 + + +* [ + ![](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] + +安卓 6.0 终于引入了应用权限系统,让用户可以细粒度地控制应用可以访问的数据。 + +应用在安装的时候不再给你一份长长的权限列表。在棉花糖中,应用安装根本不询问任何权限。当应用需要一个权限的时候——比如访问你的位置、摄像头、麦克风,或联系人列表的时候——它们会在需要用到的时候询问。在你使用应用的时候,如果需要新权限时会弹出一个“允许或拒绝”的对话框。一些应用的设置流程这么处理:在启动的时候询问获取一些关键权限,其它的等到需要用到的时候再弹出提示。这样更好地与用户沟通了需要权限是为了做什么——应用需要摄像头权限,因为你刚刚点击了摄像头按钮。 + +除了及时的“允许或拒绝”对话框,棉花糖还添加了一个权限设置界面。这个复选框大列表让数据敏感用户可以浏览应用拥有的权限。他们不仅可以通过应用来查询,也可以通过权限来查询。举个例子,你可以查看所有拥有访问麦克风权限的应用。 + +谷歌试验应用权限已经有一段时间了,这些设置界面基本就是隐藏的“[App Ops][42]”系统的重生,它是在安卓 4.3 中不小心引入并很快被移除的权限管理系统。 + +尽管谷歌在之前版本就试验过了,棉花糖的权限系统最大的不同是它代表了一个向权限系统的有序过渡。安卓 4.3 的 App Ops 从没有计划暴露给用户,所以开发者不了解它。在 4.3 中拒绝一个应用需要的一个权限经常导致奇怪的错误信息或一个彻底的崩溃。棉花糖的系统对开发者是缺省的——新的权限系统只适用于针对棉花糖 SDK 开发的应用,谷歌将它作为开发者已经为权限处理做好准备的信号。权限系统还允许在一项功能由于权限被拒绝无法正常工作时与用户进行沟通。应用会被告知它们的权限请求被拒绝,它们可以指导用户在需要该功能的时候去打开该权限访问。 + +#### 指纹 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] + +在棉花糖出现之前,少数厂商推出了他们自己的指纹解决方案以作为对[苹果的 Touch ID][43] 的回应。但在棉花糖中,谷歌终于带来了生态级别的指纹识别 API。新系统包含了指纹注册界面,指纹验证锁屏以及允许应用将内容保护在一个指纹扫描或锁屏验证之后的 API。 + +Play 商店是最先支持该 API 的应用之一。你可以使用你的指纹来购买应用,而不用输入你的密码。Nexus 5X 和 6P 是最先支持指纹 API 的手机,手机背面带有指纹读取硬件。 + +指纹 API 推出不久后时间,是罕见的安卓生态合作例子之一。所有带有指纹识别的手机都使用谷歌的 API,并且大多数银行和购物应用都很好地支持了它。 + +-------------------------------------------------------------------------------- + +作者简介: + +Ron 是 Ars Technica 的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/31/ + +作者:[RON AMADEO][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者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 diff --git a/translated/talk/The history of Android/32 The (updated) history of Android.md b/translated/talk/The history of Android/32 The (updated) history of Android.md new file mode 100644 index 0000000000..cd2b759d94 --- /dev/null +++ b/translated/talk/The history of Android/32 The (updated) history of Android.md @@ -0,0 +1,171 @@ +# 幕后变化 + +棉花糖对自棒棒糖引入的节电任务调度器 API 进行了扩展。任务调度器将应用后台进程从随意唤醒设备规整成一个有组织的系统。任务调度器基本上就是一个后台进程的交通警察。 + +在棉花糖中,谷歌还添加了一个“Doze(休眠)”模式来在设备闲置的时候节约更多电量。如果设备静止不动,未接入电源,并且屏幕处于关闭状态,它会慢慢进入低功耗离线模式,锁定后台进程。在一段时间之后,网络连接会被禁用。唤醒会被锁定——应用会请求唤醒手机来运行后台进程——而它会被忽略。系统警报(不含用户设置的闹钟)以及[任务调度器][25]也会被关闭。 + +如果你曾经发现把设备设置为飞行模式,并且注意到电池续航延长了许多,Doze 就像是一个自动飞行模式,在你手机不用的时候介入——它真的延长了电池续航。它对于整天或整夜放在桌子上的手机很有效,对于平板就更好了,因为它常常被遗忘在咖啡桌上。 + +唯一能把设备从 Doze 模式唤醒的来自谷歌云消息推送服务的“高优先级消息”。这是为信息服务准备的,所以即使设备处于休眠状态,也能够收取信息。 + + +* [ + ![](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] + +“应用待机”是另一项或多或少有用的节电特性,它在后台静默运行。这背后的逻辑很简单:如果你和应用停止交互一段时间,安卓就认为它是不重要的,并取消它访问网络和后台进程的权力。 + +对于应用待机而言,和一个应用“交互”意味着打开一个应用,开始一项前台服务,或者生成一条通知。任何其中的一条操作就会重置该应用的待机计时器。对于每种其它边界情况,谷歌在设置里添加了一个名字意味模糊的“电池优化”界面。用户可以在这里设置应用白名单让它免疫应用待机。至于开发者,他们在开发者设置中有个“不活跃应用”选项可以手动设置应用到待机状态来测试。 + +应用待机主要是自动禁用你不用的应用,这是个对抗垃圾应用或被遗忘的应用消耗电量的好方法。因为它是完全静默且后台自动执行的,它还能让新手也能拥有一部精心调教过的设备。 + +* [ + ![](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] + +谷歌在过去几年尝试了很多应用备份方案,在棉花糖中它又[换了个方案][26]。棉花糖的暴力应用备份系统的目标是保存整个应用数据文件夹到云端。这是可能的并且在技术上是可行的,但即便是谷歌自己的应用对它的支持都不怎么好。设置好一部新安卓手机依然是个大麻烦,要处理无数的登录和弹出教程。 + +到界面这里,棉花糖的备份系统使用了谷歌 Drive 应用。在谷歌 Drive 的设置中有一个“管理备份”界面,不仅会显示新备份系统的应用数据,还有谷歌过去几年尝试的其它应用备份方案的数据。 + + ![安卓的应用关联设置,基本就是一个应用地址转发系统。 ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/app-linkingf-980x576-980x576.jpg) + + +藏在设置里的还有一个新的“应用关联”功能,它可以将应用“链接”到网站。在应用关联出现之前,在全新安装的机器上打开一个谷歌地图链接通常会弹出一个“使用以下方式打开”的对话框,来获知你是想在浏览器还是在谷歌地图应用中打开这个链接。 + +这是个愚蠢的问题,因为你当然是想用应用而不是网站——这不就是你安装这个应用的原因嘛。应用关联让网站拥有者可以将他们的应用和网页相关联。如果用户安装了应用,安卓会跳过“使用以下方式打开”直接使用应用。要激活应用关联,开发者只需要在网站放一些安卓会识别的 json 代码。 + +应用关联对拥有指定客户端应用的站点来说很棒,比如谷歌地图、Instagram、Facebook。对于有 API 以及多种客户端的站点,比如 Twitter,应用关联界面让用户可以设置任意地址的默认关联应用。不过默认应用关联覆盖了百分之九十的用例,在新手机上大大减少了烦人的弹窗。 + + +* [ + ![](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] + +可选存储是棉花糖的最佳特性之一。它将 SD 卡从一个二级存储池转换成一个完美的合并存储方案。插入 SD 卡,将它格式化,然后你就有了更多的存储空间,而这是你从来没有想过的事情。 + +插入 SD 卡会弹出一条设置通知,用户可以选择将卡格式化成“外置”或“内置”存储。“内置”存储选项就是新的可选存储模式,它会将存储卡格式化为 ext4 文件系统。唯一的缺点?那就是存储卡和数据都被“锁定”到你的手机上了。如果不格式化的话,你没法取出存储卡茶道其它地方使用。谷歌对于内置存储的使用场景判断就是一旦设置就不再更改。 + +如果你强行拔出了 SD 卡,安卓会尽它最大的努力处理好。它会弹出一条消息“建议最好将 SD 卡插回”和一个“忘记”这张卡的选项。当然“忘记”这张卡将会导致各种数据丢失,建议最好不要这么做。 + +不幸的是实际上可以使用可选存储的设备很长时间都没有出现。Nexus 设备不支持存储卡,所以为了测试我们插上了一个 U 盘作为我们的可选存储。OEM 厂商最初抵制这项功能,[LG 和三星][27]都在他们 2016 年初的旗舰机上禁用了它。三星说“我们相信我们的用户需要 microSD 卡是用来在手机和其它设备之间转移数据的”,一旦卡被格式化成 ext4 这就不可能了。 + +谷歌的实现让用户可以在外置和内置存储选项之间选择。但 OEM 厂商完全拿掉了内置存储功能,不给用户选择的机会。高级用户们对此很不高兴,并且安卓定制组们很快就重启启用了可选存储。在 Galaxy S7 上,第三方定制组甚至在官方发布的[的前一天][28]解除了三星的 SD 卡锁定。 + +#### 音量和通知 + + +* [ + ![](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] + +为了更简洁的设计,谷歌将通知优先级控制从音量弹窗中移除了。按下音量键会弹出一个单独的滑动条,对应当前音源控制,还有一个下拉按钮可以展开控制面板,显示所有的三个声音控制条:通知,媒体和闹钟。所有的通知优先级控制还在——它们现在在一个“勿扰模式”的快速设置方块中。 + +通知控制最有用的新功能之一是允许用户控制抬头通知——现在叫“预览”通知。这项功能让通知在屏幕顶部弹出,就像 iOS 那样。谷歌认为最重要的通知应该提升到高于你普通日常通知的地位。 + +但是,在棒棒糖中,这项特性引入的时候,谷歌糟糕地让开发者来决定他们的应用是否“重要”。毫无疑问,所有开发者都认为他的应用是世界上最重要的东西。所以尽管最初这项特性是为你亲密联系人的即时消息设计的,最后变成了被 Facebook 的点赞通知所操控。在棉花糖中,每个应用在通知设置都有一个“设置为优先”复选框,给了用户一把大锤来收拾不守规矩的应用。 + +-------------------------------------------------------------------------------- + +作者简介: + +Ron 是 Ars Technica 的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/32/ + +作者:[RON AMADEO][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者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/ diff --git a/translated/talk/The history of Android/33 The (updated) history of Android.md b/translated/talk/The history of Android/33 The (updated) history of Android.md new file mode 100644 index 0000000000..a0a2c68bf0 --- /dev/null +++ b/translated/talk/The history of Android/33 The (updated) history of Android.md @@ -0,0 +1,185 @@ +# 每月安全更新 + +[ + ![看看新的“安卓安全补丁程序级别”栏。 ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5-980x957.jpg) +][31] + + +在棉花糖发布的几个月前,安卓的“Stagefright”媒体服务器漏洞被披露给了公众,这个漏洞允许在旧版本安卓上远程执行代码。由于这个漏洞影响到了数十亿安卓设备,安卓受到了媒体广泛的批评。 + +谷歌则以开始一项月度安卓安全更新项目作为回应。每个月它都会手机 bug,修复它们,然后推送新代码给 AOSP 和 Nexus 设备。OEM 厂商——它们已经在更新的泥潭中挣扎(也许是因为不关心)——基本上就是被告知“面对现实”然后跟上步伐。每个其它的主流操作系统有经常的安全更新——这就是成为这么大的平台的代价。为了协调 OEM 厂商,谷歌让他们提前一个月可以获取到更新。30 天之后,发布安全公告并将更新推送给谷歌设备。 + +月度更新项目是在棉花糖发布的两个月前开始的,但在这个主要的系统更新中谷歌添加了一栏“安卓安全补丁程序级别”到关于手机界面中。这里没有使用晦涩难懂的版本号,就用了日期来表示。这让任何人都能轻松看懂手机系统过时了多久,是个很好的让动作缓慢的 OEM 厂商羞愧的方式。 + + + +* [ + ![](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] + +文本选择菜单现在是个浮动工具条,会在你选择的时候在文本旁边弹出。这里也不止是常规的“剪切/复制/粘贴”命令。应用可以在工具栏上放置特殊选项,比如谷歌文档里的“添加链接”。 + +在标准的文本命令之后,一个省略号按钮会显示一个二级菜单,应用可以在这里给文本选择菜单添加额外的功能。使用新的“文本处理”API,直接给其它应用传递文本现在变得非常轻松。如果你装了谷歌翻译,在这个菜单上会显示一个“翻译”选项。谷歌搜索也在这个工具栏里为谷歌 Now on Tap 添加了一个“助理”选项。 + +棉花糖添加了一个隐藏的设置,叫做“系统界面调谐器”。这个部分包含了全方位的高级用户特性和试验性项目。要访问这个设置,你需要下拉通知中心,按住“设置”按钮几秒钟。设置齿轮会旋转,然后最终你会看到一条消息显示系统界面调谐器已解锁。一旦它被打开,你就可以在系统设置的底部,开发者选项附近找到它了。 + +在系统界面调谐器的第一部分,用户可以在快速设置面板添加自定义瓷片,这项特性后来被重制成了应用可以使用的 API。此时这项特性还很粗糙,基本就是允许用户在文本框里输入一条自定义命令。系统状态图标可以单独打开或关闭,所以如果你真的很讨厌知道你已经连接到另外无线网络,你可以把这个图标关闭。这里有一项受欢迎的电源显示新增特性,可以将电池电量百分比显示嵌入到电池图标中。还有个用来截屏的“演示”模式,它会将正常的状态栏替换成一个假的,干净的版本。 + +### 安卓 7.0 牛轧糖,Pixel 手机,以及未来 + +[安卓 7.0 牛轧糖][34]和 [Pixel 手机][35]几个月前刚刚发布,你可以读读我们对它们的完整评测。二者都有无数我们还没看到最终效果的特性和影响,所以我们暂且搁置,等它真正成为“历史”之后再进行评说。 + + + +### 延伸阅读 + +[安卓 7.0 牛轧糖评测——在你的大手机上做更多的事][25] + +牛轧糖为了 Daydream VR 对[图形和传感器][36]做出了很大的改动,Daydream VR 是谷歌即将来临的智能手机驱动 VR 体验,[我们已经尝试过了][37]但还没花时间写下点什么。从 Chrome OS 借鉴来了新的“无缝升级”功能,系统拥有两个系统分区,可以在你使用其中一个的时候,对另一个在后台进行静默升级。考虑到 Pixel 是这个功能的唯一首发设备,并且还没有收到更新,我们也不确定这个功能是什么样子的。 + + +* [ + ![](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] + +牛轧糖最有趣的新功能之一是改进的应用框架,它允许改变应用尺寸大小。这让谷歌可以在手机和平板上实现分屏,在安卓 TV 上实现画中画,以及一个神秘的浮动窗口模式。我们已经能够通过一些软件技巧来访问浮动窗口模式,但还没有看到谷歌在实际产品中使用它。难道它的目标是桌面计算? + +安卓和 Chrome OS 则继续走在共同成长的道路上。安卓应用现在已经能够在一些 Chromebook 上[运行了][38],给了这个“仅 Web”的系统 Play 商店以及一系列的应用生态。有传言称 Chrome OS 和安卓未来将会更加紧密结合成“[Andromeda][39]”——一个“Android”和“Chrome”混合而成的词——它可能是一个融合的 Chrome/安卓系统的代号。 + + + +我们还没有看到 Pixel 手机会创造怎样的历史。谷歌最近发布了两部新旗舰机 Pixel 和 Pixel XL,加入了硬件竞争之中。谷歌之前和合作伙伴合作生产联名的 Nexus 手机,但 Pixel 产品线用的是“Google”品牌。谷歌声明这是一个完全的硬件 OEM,HTC 是合同制造商,就类似苹果把富士康作为合同制造商那样。 + + + +### 延伸阅读 + +[Google Pixel 评测:最好的安卓手机,即便是有点贵][26] + +拥有自己的硬件改变了谷歌制造软件的方式。谷歌发布了“谷歌助理”作为未来版的“OK Google”语音命令系统。但助理是 Pixel 的独占特性,谷歌没有把它推送给所有安卓设备。谷歌对界面做了一些改变,一个定制版的“Pixel 启动器”主屏应用和一套新的系统界面,这些都是 Pixel 独占的。我们需要时间来见证未来功能点在“安卓”和“Pixel”之间的平衡。 + + + +### 延伸阅读 + +[和谷歌的 Hiroshi Lockheimer 聊聊 Pixel,安卓 OEM 和其它][27] + +见证这这些改变,我们可能正处在安卓历史上最不确定的点上。但在安卓最近的 2016 年 10 月活动前,安卓、Chrome OS以及谷歌 Play 的 SVP [Hiroshi Lockheimer][40] 说,他相信我们将来都会动情回顾这些最新的安卓更新。Lockheimer 是现在谷歌事实上的软件统治者,他认为最新的更新会是自安卓八年前亮相以来最有意义的事件。尽管在发布会后他没有对这个观点进行详细阐述,但事实表明明年这时候我们_可能_都不会讨论安卓了——它可能已经是一个安卓/Chrome OS 结合体了!正如 2008 年以来那样,安卓历史的下一篇章一定会更加有趣。 + +-------------------------------------------------------------------------------- + +作者简介: + +Ron 是 Ars Technica 的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/ + +作者:[RON AMADEO][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者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/ diff --git a/sources/tech/20151227 Installing Obtaining and Making GTK Themes.md b/translated/tech/20151227 Installing Obtaining and Making GTK Themes.md similarity index 60% rename from sources/tech/20151227 Installing Obtaining and Making GTK Themes.md rename to translated/tech/20151227 Installing Obtaining and Making GTK Themes.md index 554e17602d..8cd312341c 100644 --- a/sources/tech/20151227 Installing Obtaining and Making GTK Themes.md +++ b/translated/tech/20151227 Installing Obtaining and Making GTK Themes.md @@ -1,31 +1,31 @@ -Installing, Obtaining, and Making GTK Themes +获取、安装和制作 GTK 主题 ---------------- -Many Linux desktops supporting themes. A theme is a particular appearance or "****" for the GUI. Users can change the theme to make the desktop look different. Usually, users also change the icons. However, the theme and icon-pack are two separate entities. Numerous people want to make their own theme, so here is an article about making GTK themes as well as various essential information. +非常多的桌面版 Linux 都支持主题。GUI(译者注:图形用户界面)独有的外观或者”风格“叫做主题。用户可以改变主题让桌面看起来与众不同。通常,用户也会更改图标。然而,主题和图标包是两个独立的实体。很多人想制作他们自己的主题,因此这是一篇关于GTK 主题的制作以及各种制作时必需的信息的文章。 -**NOTE:** This article primarily focuses on GTK3, but it will discuss a little about GTK2, Metacity, and others. Cursors and icons will not be discussed in this article. +**注意:** 这篇文章着重讨论 GTK3,但会稍微谈一下 GTK2、Metacity 等。本文不会讨论光标和图标。 -**Basic Concepts** -The GIMP ToolKit (GTK) is a widget-toolkit used to create GUIs on a variety of systems (thus making GTK cross-platform). GTK ([http://www.gtk.org/][17]) is commonly and incorrectly thought to stand for "GNOME ToolKit", but is actually stands for "GIMP ToolKit" because it was first created to design an user interface for GIMP. GTK is an object-oriented toolkit written in C (GTK itself is not a language). GTK is entirely open-source under the LGPL license. GTK is a widely used toolkit for GUIs and many tools are available for GTK. +**基本概念** +GIMP 工具包(简称 GTK)是一个用来创造在多种系统上(如此造就了 GTK 的跨平台)图形用户界面的构件工具包。GTK([http://www.gtk.org/][17])通常被错误地认为代表“GNOME 工具包”,但实际上它代表“GIMP 工具包”,因为最初创造它是为了给 GIMP 设计用户界面。GTK 是一个用 C 语言编写的面向对象工具包(GTK 本身不是一种语言)。GTK 遵循 LGPL协议完全开源。GTK 是一个使用广泛的图形用户界面工具包,它含有很多可用工具。 -Themes made for GTK will not work in Qt-based applications. A Qt-theme is needed to apply a theme to Qt applications. +GTK 主题无法在基于 QT 的应用上使用。QT 主题需要在基于 QT 的应用上使用。 -The themes use Cascading Style-Sheets (CSS) to generate the theme's appearance. This is the same CSS that web-developers use on web-pages. However, instead of HTML tags being referenced, GTK widgets are specified. It is important that theme developers learn CSS. +主题使用层叠样式表(CSS)来生成主题样式。这里的 CSS 和网站开发者在网页上使用的相同。然而它引用的 HTML 标签被 GTK 构件的专用标签代替。学习 CSS 对主题开发者来说很重要。 -**Theme Location** -Themes may be stored in "~/.themes" or "/usr/share/themes". Themes that are in "~/.themes" are only accessible to the owner of that home folder. While themes in "/usr/share/themes" are global-themes that are accessible by all users. When a GTK application executes, it has a list of possible theme files that it checks in a specific order. If the theme file is not found, then it will try the next file on the list. Below is the list in the order that GTK3 applications try to use. -$XDG_CONFIG_HOME/gtk-3.0/gtk.css (typically ~/.config/gtk-3.0/gtk.css) +**主题存放位置** +主题可能会存储在“~/.themes”或者“/usr/share/themes”文件夹中。存放在“~/.themes”文件夹下的主题只有此 home 文件夹的所有者可以使用。而存放在“/usr/share/themes”文件夹下的全局主题可供所有用户使用。当执行 GTK 程序时,它会按照某种确定的顺序检查可用主题文件的列表。如果没有找到主题文件,它会尝试检查列表中的下一个文件。下述文字是 GTK3 程序检查时的顺序列表。 +$XDG_CONFIG_HOME/gtk-3.0/gtk.css (另一写法 ~/.config/gtk-3.0/gtk.css) ~/.themes/NAME/gtk-3.0/gtk.css -$datadir/share/themes/NAME/gtk-3.0/gtk.css (typically /usr/share/themes/name/gtk-3.0/gtk.css) +$datadir/share/themes/NAME/gtk-3.0/gtk.css (另一写法 /usr/share/themes/name/gtk-3.0/gtk.css) -**NOTE:** "NAME" is a placeholder for the name of the current theme. +**注意:** ”NAME“是当前主题名称的占位符。 -If there are two themes with the same name, then the one in the user's home folder (~/.themes) will be used. Developers can take advantage of GTK's theme-seeking algorithm by testing new themes in their local home's theme directory. +如果有两个主题名字相同,那么存放在用户 home 文件夹(~/.themes)里的主题会被使用。开发者测试存放在本地 home 文件夹的主题时可以好好的利用 GTK 的主题查找算法。 -**Theme Engines** -A "Theme engine" is a piece of software that changes the look of the GUI's widgets. The engine reads and uses the theme's files to know how the various widgets should be drawn. Some engines come with themes of their own. Each engine has its advantages and disadvantages, and some engines add special properties and features. +**主题引擎** +主题引擎是软件的一部分,用来改变图形用户界面构件的外观。引擎通过解析主题文件来了解应当绘制多少种构件。有些引擎随着主题被开发出来。每种引擎都有优点和缺点,还有些引擎添加了某些特性和特色。 -Many theme-engines can be obtained from the default repositories. Debian-based Linux distros can execute "apt-get install gtk2-engines-murrine gtk2-engines-pixbuf gtk3-engines-unico" to install three different engines. Many engines are available for both GTK2 and GTK3\. Below is a small list of examples. +从默认软件源中可以获取很多主题引擎。Debian 系的 Linux 发行版可以执行“apt-get install gtk2-engines-murrine gtk2-engines-pixbuf gtk3-engines-unico”命令来安装三种不同的引擎。很多引擎同时支持 GTK2 和 GTK3。以下述短列表为例。 * gtk2-engines-aurora - Aurora GTK2 engine * gtk2-engines-pixbuf - Pixbuf GTK2 engine @@ -33,21 +33,21 @@ Many theme-engines can be obtained from the default repositories. Debian-based L * gtk3-engines-unico - Unico GTK3 engine * gtk3-engines-xfce - GTK3 engine for Xfce -**Creating GTK3 Themes** -To create a GTK3 theme, developers can start with an empty file or they can use a pre-existing theme as a template. It may help beginners to start with a pre-existing theme. For instance, a theme can be copied to the user's home folder and then the developer can start editing the files. +**创作 GTK3 主题** +开发者创作 GTK3 主题时,或者从空文件着手,或者将已有的主题作为模板。从现存主题着手可能会对新手有帮助。比如,开发者可以把主题复制到用户的 home 文件夹,然后编辑这些文件。 -The general format for a GTK3 theme is to create a folder named after the theme. Then, create a sub-directory called "gtk-3.0" and create a file inside of it named "gtk.css". In the "gtk.css" file, use CSS code to control how the theme will look. Move the theme to ~/.themes for testing purposes. Use the newly created theme and make changes as necessary. If desired, developers can add additional components to the theme for GTK2, Openbox, Metacity, Unity, etc. +GTK3 主题的通用格式是新建一个以主题名字命名的文件夹。然后新建一个名为“gtk-3.0”的子目录,在子目录里新建一个名为“gtk.css”的文件。在文件“gtk.css“里,使用 CSS 代码写出主题的外观。为了测试将主题移动到 ~/.theme 里。使用新主题并在必要时进行改进。如果有需求,开发者可以添加额外的组件,使主题支持 GTK2,Openbox,Metacity,Unity等桌面环境。 -To explain how to create themes, we will study the "Ambiance" theme, which is usually found at /usr/share/themes/Ambiance. This directory contains the below listed sub-directories and a file named "index.theme". +为了阐明如何创造主题,我们会学习”Ambiance“主题,通常可以在 /usr/share/themes/Ambiance 找到它。此目录包含下面列出的子目录以及一个名为”index.theme“的文件。 * gtk-2.0 * gtk-3.0 * metacity-1 * unity -"**index.theme**" contains metadata (such as the theme's name) and some important settings (such as the button layout). Below is the "index.theme" file for "Ambiance". +“**index.theme**”含有元数据(比如主题的名字)和一些重要的配置(比如按钮的布局)。下面是”Ambiance“主题的”index.theme“文件内容。 -Code: +代码: ``` [Desktop Entry] Type=X-GNOME-Metatheme @@ -64,9 +64,9 @@ ButtonLayout=close,minimize,maximize: X-Ubuntu-UseOverlayScrollbars=true ``` -The "**gtk-2.0**" directory contains files for GTK2 such as a "gtkrc" file and an "apps" directory that contains application-specific GTK settings. The "gtkrc" file is the main CSS-file for the GTK2 portion of the theme. Below are the contents of /usr/share/themes/Ambiance/gtk-2.0/apps/nautilus.rc +”**gtk-2.0**“目录包括支持 GTK2 的文件,比如文件”gtkrc“和文件夹”apps“。文件夹”apps“包括具体程序的 GTK 配置。文件”gtkrc“是 GTK2 部分的主要 CSS 文件。下面是 /usr/share/themes/Ambiance/gtk-2.0/apps/nautilus.rc 文件的内容。 -Code: +代码: ``` # ============================================================================== # NAUTILUS SPECIFIC SETTINGS @@ -81,9 +81,9 @@ widget_class "*Nautilus*" style "notebook_button" widget_class "*Nautilus**" style "notebook_button" ``` -The "**gtk-3.0**" directory contains files for GTK3\. Instead of "gtkrc", GTK3 uses "gtk.css" as the main theme file. In the Ambiance theme, the file contains one line - '@import url("gtk-main.css");'. The "settings.ini" file contains important theme-wide settings. GTK3 themes use an "apps" directory for the same purpose as GTK2\. The "assets" directory contains images for radio buttons, check-boxes, etc. Below are the contents of /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css +”**gtk-3.0**“目录里是 GTK3 的文件。GTK3 使用”gtk.css“取代了"gtkrc",作为主文件。对于 Ambiance 主题,此文件有一行‘@import url("gtk-main.css");’。”settings.ini“是重要的主题范围配置文件。GTK3 主题的”apps“目录和 GTK2 有同样的作用。”assets“目录里有单选按钮、多选框等的图像文件。下面是 /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css 的内容。 -Code: +代码: ``` /*default color scheme */ @define-color bg_color #f2f1f0; @@ -155,14 +155,14 @@ Code: @import url("public-colors.css"); ``` -The "**metacity-1**" folder contains images that the Metacity window-manager uses for buttons (such as the "close window" button). This directory also contains a file named "metacity-theme-1.xml" that contain's the theme's metadata (like the developer's name) and styling. However, the Metacity portion of the theme uses XML rather than CSS. +”**metacity-1**“文件夹含有 Metacity 窗口管理器按钮(比如”关闭窗口“按钮)的图像文件。此目录还有一个名为”metacity-theme-1.xml“的文件,包括了主题的元数据(像开发者的名字)和主题设计。然而,主题的 Metacity 部分使用 XML 文件而不是 CSS 文件。 -The "**unity**" directory contains SVG files that Unity uses for buttons. Besides the SVG files, there are no other files in this folder. +”**unity**“文件夹含有 Unity 按钮使用的 SVG 文件。除了 SVG 文件,这里没有其他的文件。 -Some themes may contain other directories. For instance, "Clearlooks-Phenix" has a folder named "**openbox-3**" and "**xfwm4**". The "openbox-3" folder only contains a "themerc" file that declares the settings and appearance (a sample is seen below). The "xfwm4" directory contains *.xpm files, *.png images (in the "png" folder), a "README" file, and a "themerc" file which contains settings (as seen below). +一些主题可能也会包含其他的目录。比如,“Clearlooks-Phenix”主题有名为”**openbox-3**”和“**xfwm4**“的文件夹。”openbox-3“文件夹仅有一个”themerc“文件,声明了主题配置和外观(下面有文件示例)。”xfwm4“目录含有几个 xpm 文件,几个 png 图像文件(在”png“文件夹里),一个”README“文件,还有个包含了主题配置的”themerc“文件(就像下面看到的那样)。 /usr/share/themes/Clearlooks-Phenix/xfwm4/themerc -Code: +代码: ``` # Clearlooks XFWM4 by Casey Kirsle @@ -182,7 +182,7 @@ title_vertical_offset_inactive=1 /usr/share/themes/Clearlooks-Phenix/openbox-3/themerc -Code: +代码: ``` !# Clearlooks-Evolving !# Clearlooks as it evolves in gnome-git... @@ -349,16 +349,16 @@ osd.unhilight.bg.color: #BABDB6 osd.unhilight.bg.colorTo: #efefef ``` -**Testing Themes** -When creating themes, it may be helpful to test it and tweak the code to get the desired appearance. Such developers may want to use some type of "theme-previewer". Thankfully, some exist. +**测试主题** +在创作主题时,测试主题并且微调代码对得到想要的样子是很有帮助的。有相当的开发者想要用到”主题预览器“这样的工具呢。幸运的是,已经有了。 -* GTK+ Change Theme - This program can change the GTK theme and allow developers to preview the theme. The program is composed of one window that contains many widgets, thus providing a complete preview for the theme. To install this program, type "apt-get install gtk-chtheme". -* GTK Theme Switch - This program allows users to easily change the user's theme. Be sure to have some applications open to view and test the theme. To install this program, type "apt-get install gtk-theme-switch" and type "gtk-theme-switch2" in a terminal to run it. -* LXappearance - This program can change themes, icons, and fonts. -* PyWF - This is a Python-based alternative to "The Widget Factory". PyWF can be obtained at [http://gtk-apps.org/content/show.php/PyTWF?content=102024][1] -* The Widget Factory - This is an old GTK-previewer. To install this program, type "apt-get install thewidgetfactory" and type "twf" in a terminal to run it. +* GTK+ Change Theme - 这个程序可以更改 GTK 主题,开发者可以用它预览主题。这个程序由一个含有很多构件的窗口组成,因此可以为主题提供一个完整的预览。要安装它,只需输入命令”apt-get install gtk-chtheme“。 +* GTK Theme Switch - 用户可以使用它轻松的更换用户主题。测试主题时确保打开了一些应用,方便预览效果。要安装它,只需输入命令”apt-get install gtk-theme-switch“,然后在终端敲出”gtk-theme-switch2“即可运行。 +* LXappearance - 它可以更换主题,图标以及字体。 +* PyWF - 这是”The Widget Factory“的一个基于 Python 的可选组件。可以在[http://gtk-apps.org/content/show.php/PyTWF?content=102024][1]获取Pywf。 +* The Widget Factory - 这是一个古老的 GTK 预览器。要安装它,只需输入命令”apt-get install thewidgetfactory",然后在终端敲出“twf”即可运行。 -**Theme Downloads** +**主题下载** * Cinnamon - [http://gnome-look.org/index.php?xcontentmode=104][2] * Compiz - [http://gnome-look.org/index.php?xcontentmode=102][3] @@ -370,7 +370,7 @@ When creating themes, it may be helpful to test it and tweak the code to get the * Metacity - [http://gnome-look.org/index.php?xcontentmode=101][9] * Ubuntu Themes - [http://www.ubuntuthemes.org/][10] -**Further Reading** +**延伸阅读** * Graphical User Interface (GUI) Reading Guide - [http://www.linux.org/threads/gui-reading-guide.6471/][11] * GTK - [http://www.linux.org/threads/understanding-gtk.6291/][12] @@ -384,7 +384,7 @@ When creating themes, it may be helpful to test it and tweak the code to get the via: http://www.linux.org/threads/installing-obtaining-and-making-gtk-themes.8463/ 作者:[DevynCJohnson][a] -译者:[译者ID](https://github.com/译者ID) +译者:[fuowang](https://github.com/fuowang) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md b/translated/tech/20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md deleted file mode 100644 index d7865aa590..0000000000 --- a/translated/tech/20160110 3 Ways to Permanently and Securely Delete ‘Files and Directories in Linux.md +++ /dev/null @@ -1,210 +0,0 @@ -3 个在 Linux 中永久并安全删除`文件和目录`的方法 -============================================================ - -在大多数情况下,我们习惯于[从我们的计算机中删除文件][1],例如使用 `Delete` 键、垃圾箱或 `rm` 命令,这不是永久安全地从硬盘中(或任何存储介质)删除文件的方法。 - -该文件只是对用户隐藏,它驻留在硬盘上的某个地方。它可以通过数据窃贼、执法或其他威胁来恢复。 - -假设文件包含密级或机密内容,例如安全系统的用户名和密码,具有必要知识和技能的攻击者可以轻松地[恢复删除文件的副本][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 中安全删除文件 - -Linux wipe 命令可以安全地擦除磁盘中的文件,从而不可能[恢复删除的文件或目录内容] 4]。 - -首先,你需要安装 wipe 工具,运行以下适当的命令: - -``` -$ sudo apt-get install wipe [On Debian and its derivatives] -$ sudo yum install wipe [On RedHat based systems] -``` - -下面的命令会摧毁 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 -``` - -**推荐阅读:** [PhotoRec – 在 Linux 中恢复删除或遗失的文件][11] - -就是这样了!在本文中,我们审查了一系列可以永久安全地删除 Linux 中的文件的工具。像往常一样,通过下面的评论栏发表你对本篇文章的想法或建议。 - --------------------------------------------------------------------------------- - -作者简介: - -![](http://1.gravatar.com/avatar/7badddbc53297b2e8ed7011cf45df0c0?s=128&d=blank&r=g) -我是 Ravi Saive,TecMint 的创建者。 一个计算机 Geek 和 Linux 大师,喜欢在互联网上分享技巧和贴士。我的服务器大多数运行在称为 Linux 的开源平台上。关注我:Twitter、Facebook 和 Google+ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/permanently-and-securely-delete-files-directories-linux/ - -作者:[Ravi Saive][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/admin/ -[1]:http://www.tecmint.com/delete-all-files-in-directory-except-one-few-file-extensions/ -[2]:http://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/ -[3]:http://www.tecmint.com/wp-content/uploads/2017/01/shred-command-example.png -[4]:http://www.tecmint.com/recover-deleted-file-in-linux/ -[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]:http://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/ -[8]:http://www.tecmint.com/wp-content/uploads/2017/01/sswap-Secure-Swap-Wiper.png -[9]:http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/ -[10]:http://www.tecmint.com/smem-linux-memory-usage-per-process-per-user/ -[11]:http://www.tecmint.com/photorec-recover-deleted-lost-files-in-linux/ diff --git a/translated/tech/20160425 What is SRE.md b/translated/tech/20160425 What is SRE.md index 2663122a8d..8aee610856 100644 --- a/translated/tech/20160425 What is SRE.md +++ b/translated/tech/20160425 What is SRE.md @@ -1,13 +1,13 @@ -什么是SRE(网站可靠性工程)? +什么是 SRE(网站可靠性工程Site Reliability Engineering)? ============================================================ 网站可靠性工程师是近来越来越多看到的一个职位。它是什么意思?它来自哪里?让我们从 Google SRE 团队来学习。 ![Bridge](https://d3tdunqjn7n0wj.cloudfront.net/360x240/bridge-1031545-1400-389c9609ff7c64083c93db48dc77eeff.jpg) -这里有一篇由 Niall Richard Murphy、Jennifer Petoff、Chris Jones、Betsy Beyer 编辑一篇来自[网站可靠性工程][9]的摘录。 +本文为 Niall Richard Murphy、Jennifer Petoff、Chris Jones、Betsy Beyer 编辑的 [《网站可靠性工程》Site Reliability Engineering][9] 一书的摘录。 -网站可靠性工程也在[11月7-10日在阿姆斯特丹举办的 O'Reilly Velocity 会议][10]上有提到。 +网站可靠性工程在[ 11 月 7-10 日在阿姆斯特丹举办的 O'Reilly Velocity 会议][10]上也有提到。 ### 介绍 @@ -15,27 +15,37 @@ > > 传统的 SRE 说 -一个公认的事实是系统不会自己。 那么,一个特定系统的复杂大规模系统_应该_怎么运行呢? +一个公认的事实是系统不会自己运行。 那么,一个系统 — 尤其是复杂大规模系统 — _应该_怎么运行呢? ### sysadmin 服务管理方法 -sysadmin服务管理模型有几个优点。对于决定该如何运行和服务的公司而言,这种方法相对容易实现:它作为一个熟悉的行业范例,有很多例子可以从中学习和效仿。相关人才库已经广泛普及。有一系列现有的工具,软件组件(现成的或其他)和集成公司可用于帮助运行这些组装的系统,所以新手sysadmin团队不必重新发明轮子以及从头设计系统。 +以前,公司雇用系统管理员来运行复杂的计算系统。 -因此,传统运营团队及其在产品开发中的同行往往会发生冲突,最突出的是如何将软件发布到生产环境。在他们核心中,开发团队希望推出新功能,并看到它们被用户采纳。在_他们_的核心上,ops 团队希望确保服务在运行中不会中断。因为大多数中断是由某种变化引起的 - 新的配置、新的功能发布或者新的用户流量类型 - 这两个团队的目标基本上处于紧张状态。 +系统管理员(或者称为 sysadmin)这种方式包括整合现有软件组件,互相协作来完成一个服务。系统管理员的任务是运行服务,响应事件,并在事件发生时进行更新。随着系统复杂度的增长和流量的增长,事件和更新也相应增长,导致管理员团队也越来越庞大以完成这些额外工作。由于系统管理员的角色需要的技能与产品开发人员有很大不同,开发和系统管理员被分为不同的团队:“开发”和“运维”。 -两个团队都明白,以最可能的条款(“我们可以没有阻碍地在任何时间发布任何东西”以及“我们不想在系统工作后改变任何东西”)来表达他们的利益是不可接受的。因为他们的词汇和风险假设都不同,两个团体经常采用熟悉斗争形式来提高他们的利益。 ops 团队试图通过发布介绍和提高门槛来保护运行中的系统免受更改的风险。例如,发布审查可能包含对_每个_问题的显式审查,这些问题过去都_曾经_引起过服务中断 - 它可能是一个任意长度的列表,并且不是所有元素都提供相等的值。开发团队很快学会了如何回应。他们有较少的“发布”和更多的“标志翻转”、“增量更新”或“cherrypicks”。他们采取诸如分割产品功能的策略,以便更少的功能受到发布审查。 +sysadmin 服务管理模型有几个优点。对于决定该如何运行和服务的公司而言,这种方法相对容易实现:它作为一个熟悉的行业范例,有很多例子可以从中学习和效仿。相关人才库已经广泛普及。有一系列现有的工具,软件组件(现成的或其他)和集成公司可用于帮助运行这些组装的系统,所以新手 sysadmin 团队不必重新发明轮子以及从头设计系统。 + +此方式将公司开发/运维分离,也有一些缺点和困难。主要有两类:直接代价和间接代价。 + +直接代价很显而易见了。利用依靠手工干预来进行变更管理和事件处理的团队进行服务管理,当服务和/或流量增长时,成本是很昂贵的,因为团队随着系统负载的增长也在相应增长。 + +开发/运维分离的间接代价可能不那么明显,但常常比直接代价还要昂贵。代价来自于两个团队背景,技术,激励都非常不同。他们使用不同的词汇来描述形式;对技术方案的风险和可能性他们持不同的假设;对产品稳定性的目标级别也会有不同的争议。团队的分离很容易导致不只是激励的不同,还有沟通、目标,以及最终,信任和尊重的分离。这是一种恶性循环。 + +因此,传统运营团队及其在产品开发中的同行往往会发生冲突,最突出的是如何将软件发布到生产环境。在开发团队核心中,他们希望推出新功能,并看到它们被用户采纳。在_ops 团队_的核心上, 他们希望确保服务在运行中不会中断。因为大多数中断是由某种变化引起的 - 新的配置、新的功能发布或者新的用户流量类型 - 这两个团队的目标基本上处于紧张状态。 + +两个团队都明白,以最可能的条款(“我们可以没有阻碍地在任何时间发布任何东西”以及“我们不想在系统工作后改变任何东西”)来表达他们的利益是不可接受的。因为他们的词汇和风险假设都不同,两个团体经常采用常见的斗争形式来提高他们的利益。 ops 团队试图通过提高发布和变更门槛来保护运行中的系统免受更改的风险。例如,发布审查可能包含对_每个_问题的显式审查,这些问题过去都_曾经_引起过服务中断 - 它可能是一个任意长度的列表,并且不是所有元素都提供相等的值。开发团队很快学会了如何回应。他们有较少的“发布”和更多的“标志翻转”、“增量更新”或 “cherrypicks”。他们采取诸如分割产品功能的策略,以便更少的功能受到发布审查。 ### Google 服务管理的方法:网站可靠性工程 -冲突不是提供软件服务的必然部分。Google 选择以不同的方式运行我们的系统:我们的网站可靠性工程团队专注于雇佣软件工程师来运行我们的产品,并创建系统来完成那些本来由sysadmins手动完成的工作。 +冲突不是提供软件服务的必然部分。Google 选择以不同的方式运行我们的系统:我们的网站可靠性工程团队专注于雇佣软件工程师来运行我们的产品,并创建系统来完成那些本来由 sysadmins 手动完成的工作。 -什么是网站可靠性工程,是如它在谷歌定义的那样么?我的解释很简单:SRE 是当你要求一位软件工程师设计一个运维团队时会发生的那样。当我在2003年加入 Google 并负责运行一个由 7 名工程师组成的“生产团队”时,那时我工作的全部都是软件工程。所以我设计和管理了一个假如我是一名 SRE ,_我_想要的团队的样子。这个团队已经成为了 Google 的目前的 SRE 团队,它仍然是一名终生软件工程师所想象的那个样子。 +什么是网站可靠性工程,是如它在谷歌定义的那样么?我的解释很简单:SRE 是当你要求一位软件工程师设计一个运维团队时会发生的那样。当我在 2003 年加入 Google 并负责运行一个由 7 名工程师组成的“生产团队”时,那时我工作的全部都是软件工程。所以我假设我是一名 SRE,设计和管理了一个 _我_想要的团队的样子。这个团队已经成为了 Google 的目前的 SRE 团队,它仍如最初一名终生软件工程师所想象的那个样子。 Google 服务管理方法的主要构成部分是由每个 SRE 团队的组成。作为一个整体,SRE可以分为两大类。 -50-60% 的人是 Google 软件工程师,或者更确切地说,是通过 Google 软件工程师的标准程序招聘的人。其他 40-50% 的候选人非常接近 Google 软件工程师资格(即所需技能集的 85-99%),以及一些具有大多数软件工程师没有的一些 SRE 技术技能的人。到目前为止,UNIX 系统内部和网络(第1层到第3层)的专业知识是我们寻求的两种最常见的替代技术技能。 +50-60% 的人是 Google 软件工程师,或者更确切地说,是通过 Google 软件工程师的标准程序招聘的人。其他 40-50% 的候选人非常接近 Google 软件工程师资格(即所需技能集的 85-99%),以及一些具有大多数软件工程师没有的一些 SRE 技术技能的人。到目前为止,UNIX 系统内部和网络(第 1 层到第 3 层)的专业知识是我们寻求的两种最常见的替代技术技能。 所有 SRE 的共同点是对开发软件系统以解决复杂问题的信念和能力。在 SRE 中,我们密切跟踪两个团队的职业发展,并且迄今为止发现在两种工程师之间的表现没有实际差异。事实上,SRE 团队的多样背景经常产生聪明、高质量的系统,这显然是几个技能集合成的产物。 @@ -43,22 +53,22 @@ Google 服务管理方法的主要构成部分是由每个 SRE 团队的组成 按照设计,至关重要的是 SRE 团队专注于工程。没有恒定的工程,运维工作增加,团队将需要更多的人来上工作量。最终,传统的以 ops 为中心的团队与服务规模呈线性关系:如果服务支持的产品成功,运维工作将随着流量而增长。这意味着雇用更多的人一遍又一遍地完成相同的任务。 -为了避免这种命运,负责管理服务的团队需要写代码否则就会被工作淹没。因此,Google _设置了一个 “ops” 工作如 ticket、紧急呼叫、手动任务最多只占 50% SRE 工作的上限_。此上限确保SRE团队在其计划中有足够的时间使服务稳定及可操作。50% 是上限;随着时间的推移,除了自己的设备,SRE 团队应该只有很少的运维工作,他们几乎可以完全从事开发任务,因为服务基本上可以运行和维修自己:我们想要的系统是_自动的_,而不只是_自动化_。在实践中,规模和新功能始终 SRE 要考虑的 +为了避免这种命运,负责管理服务的团队需要写代码,否则就会被工作淹没。因此,Google 为 SRE 们 _设置了一个 “ops” 工作的上限,如 ticket、紧急呼叫、手动任务最多只占 50% 工作量_。此上限确保 SRE 团队在其计划中有足够的时间使服务稳定及可操作。50% 是上限;随着时间的推移,除了自己的设备,SRE 团队应该只有很少的运维工作,他们几乎可以完全从事开发任务,因为服务基本上可以运行和维修自己:我们想要的系统是_自动的_,而不只是_自动化_。在实践中,规模和新功能始终 SRE 要考虑的。 -Google的经验法则是,SRE团队必须花费剩余的 50% 的时间来进行实际开发。那么我们该如何执行这个阈值呢?首先,我们必须测量 SRE 如何花费时间。通过测量,我们确保团队不断花费不到 50% 的时间用于开发改变他们实践的工作上。通常这意味着会将一些运维负担转移回开发团队,或者给团队添加新的员工,而不指派该团队额外的运维责任。意识到在运维和开发工作之间保持这种平衡使我们能保证 SRE 具有参与创造性的自主工程的空间,同时仍然保留从运维那学来的智慧。 +Google 的经验法则是,SRE 团队必须花费剩余的 50% 的时间来进行实际开发。那么我们该如何执行这个阈值呢?首先,我们必须测量 SRE 如何花费时间。通过测量,我们确保团队不断花费不到 50% 的时间用于开发改变他们实践的工作上。通常这意味着会将一些运维负担转移回开发团队,或者给团队添加新的员工,而不指派该团队额外的运维责任。意识到在运维和开发工作之间保持这种平衡使我们能保证 SRE 具有参与创造性的自主工程的空间,同时仍然保留从运维那学来的智慧。 -我们发现Google SRE 的运行大规模系统的方法有很多优点。由于 SRE 是直接修改代码以使Google的系统运行自己,SRE团队的特点是快速创新以及大量接受变革。这样的团队能相对价廉地支持相同的服务,面向运维的团队需要大量的人。相反,运行、维护和改进系统所需的 SRE 的数量随系统的大小而线性地缩放。最后,SRE 不仅规避了开发/运维分裂的障碍,而且这种结构也改善了我们的产品开发团队:产品开发和 SRE 团队之间的轻松转移交叉培训整个团队,并且提高了那些在学习构建百万级别分布式系统上有困难的开发人员的技能。 +我们发现 Google SRE 的运行大规模系统的方法有很多优点。由于 SRE 是直接修改代码以使 Googl e的系统运行自己,SRE 团队的特点是快速创新以及大量接受变革。这样的团队能相对价廉地支持相同的服务,面向运维的团队需要大量的人。相反,运行、维护和改进系统所需的 SRE 的数量随系统的大小而线性地缩放。最后,SRE 不仅规避了开发/运维分裂的障碍,而且这种结构也改善了我们的产品开发团队:产品开发和 SRE 团队之间的轻松转移交叉培训整个团队,并且提高了那些在学习构建百万级别分布式系统上有困难的开发人员的技能。 -尽管有这些好处,SRE 模型的特点是其自身独特的挑战。 Google 面临的一个持续挑战是招聘 SRE:SRE 不仅与产品开发招聘流程竞争相同的候选人,而且我们将招聘人员的编码和系统工程技能都设置得如此之高,这意味着我们的招聘池必然很小。由于我们的学科相对新颖独特,在如何建立和管理 SRE 团队方面没有太多的行业信息(尽管希望这本书能朝着这个方向迈进!)。一旦 SRE 团队到位,他们潜在的非正统的服务管理方法需要强有力的管理支持。例如,一旦错误预估耗尽,除非是管理层的强制要求, 否则在季度剩余的时间里决定停止发布可能不会被产品开发团队所接受。 +尽管有这些好处,SRE 模型的特点是其自身独特的挑战。 Google 面临的一个持续挑战是招聘 SRE:SRE 不仅与产品开发招聘流程竞争相同的候选人,而且我们将招聘人员的编码和系统工程技能都设置得如此之高,这意味着我们的招聘池必然很小。由于我们的学科相对新颖独特,在如何建立和管理 SRE 团队方面没有太多的行业信息(不过希望这本书能朝着这个方向迈进!)。一旦 SRE 团队到位,他们潜在的非正统的服务管理方法需要强有力的管理支持。例如,一旦错误预估耗尽,除非是管理层的强制要求, 否则在季度剩余的时间里决定停止发布可能不会被产品开发团队所接受。 ###### DevOps 或者 SRE? -“DevOps” 这个术语在 2008 年末出现,并在写这篇文章时(2016 年早期)仍在发生变动。 其核心原则:IT部门在系统设计和开发的每个阶段的参与、对自动化与人力投入的严重依赖、工程实践和工具在操作任务中的应用,与许多 SRE 的原则和实践一致。 人们可以将 DevOps 视为向更广泛的组织,管理结构和人员的几种核心SRE原则。 可以等价地将 SRE 视为具有某些特殊扩展的 DevOps 的特定实现。 +“DevOps” 这个术语在 2008 年末出现,并在写这篇文章时(2016 年早期)仍在发生变动。 其核心原则:IT 部门在系统设计和开发的每个阶段的参与、对自动化与人力投入的严重依赖、工程实践和工具在操作任务中的应用,与许多 SRE 的原则和实践一致。 人们可以将 DevOps 视为向更广泛的组织,管理结构和人员的几种核心 SRE原则。 可以等价地将 SRE 视为具有某些特殊扩展的 DevOps 的特定实现。 ------------------------ -作者简介:Benjamin Treynor Sloss 创造了“网站可靠性工程”一词,他自2003年以来一直负责 Google 的全球运营、网络和生产工程。截至2016年,他管理着全球范围内一个大约4000名软硬件和网络工程师团队。 +作者简介:Benjamin Treynor Sloss 创造了“网站可靠性工程”一词,他自 2003 年以来一直负责 Google 的全球运营、网络和生产工程。截至 2016 年,他管理着全球范围内一个大约 4000 名软硬件和网络工程师团队。 -------------------------------------------------------------------------------- @@ -66,7 +76,7 @@ via: https://www.oreilly.com/ideas/what-is-sre-site-reliability-engineering 作者:[Benjamin Treynor][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20160610 Setting Up Real-Time Monitoring with Ganglia.md b/translated/tech/20160610 Setting Up Real-Time Monitoring with Ganglia.md deleted file mode 100755 index 999338d476..0000000000 --- a/translated/tech/20160610 Setting Up Real-Time Monitoring with Ganglia.md +++ /dev/null @@ -1,226 +0,0 @@ -使用Ganglia来监控linux类型的网格和集群服务器 -=========== -自从SA接手服务和主机管理以后,监控类的工具就成了他们的好帮手。其中比较有名的有[Nagios][11], [Zabbix][10], [Icinga][9], 和 Centreon.以上这些重量级的监控工具,让一个新手SA来设置,并使用其中的高级特性是非常困难的。 -本文将向你介绍Ganglia,它是一个容易扩展配置的监控系统。它可以查看服务器中的各项性能指标,也可以实时图形化的展示集群配置。 -[![Install Gangila Monitoring in Linux](http://www.tecmint.com/wp-content/uploads/2016/06/Install-Gangila-Monitoring-in-Linux.png)][8] - -在Linux上安装Ganglia -Ganglia能够让集群和网格服务器更加容易管理。 -我们可以远程创建一个包含所有主机的网格配置,其中的成员主机可以使用模板设置。 - -此外Ganglia对移动设备进行过页面优化,排版非常人性化。当然你还可以导出`csv`和 `.json`格式的数据。 - -我们的测试环境包括一个安装Ganglia的主节点服务器CentOS7(IP 地址 192.168.0.29)和一个作为被监控端的Ubuntu 14.04主机 (192.168.0.32)。我们将通过Ganglia Web的页面来监控这台Ubuntu主机。 - -下面的例子可以给大家提供参考,CentOS7作为主节点,Ubuntu作为被监控对象。 - -### 安装和配置 Ganglia - -请遵循以下步骤在主节点服务器安装监控工具。 - -#### 1. 1. 使用yum源 [EPEL repository][7] ,然后安装 Ganglia和相关工具: -命令如下 - -``` -# yum update && yum install epel-release -# yum install ganglia rrdtool ganglia-gmetad ganglia-gmond ganglia-web -``` - -Ganglia将附加安装一些应用,它们的功能如下: - - 1. `rrdtool`, 轮询数据库,它是一个储存以及用图形化显示变化数据的工具 - 2. `ganglia-gmetad` 一个守护进程,用来收集被监控主机的数据。被监控主机与主节点主机都要安装Ganglia-gmond(监控守护进程自己) - 3. `ganglia-web` 提供Web前端用于显示监控系统的历史数据 - -#### 2. 使用Apache为Ganglia配置Web身份认证 - - 如果你想了解更多的高级认证机制,请参阅[Authorization and Authentication][6]选择Apache部分。 - - 为完成这部分的任务,我们需要用Apache来创建一个用户名和对应的密码,下面的例子我们先来创建一个叫`adminganglia`的用户名,然后给他分配一个密码,它将被储存在 /etc/httpd/auth.basic(如果随便选择根目录或其他Apache没有权限读取的目录,这项配置最终将会以失败告终。)  - -``` -# htpasswd -c /etc/httpd/auth.basic adminganglia - -``` - -给adminganglia添加密码,需要经过2次确认 - -#### 3. 修改配置文件 /etc/httpd/conf.d/ganglia.conf  - -``` -Alias /ganglia /usr/share/ganglia - -AuthType basic -AuthName "Ganglia web UI" -AuthBasicProvider file -AuthUserFile "/etc/httpd/auth.basic" -Require user adminganglia - - -``` - -#### 4. 编辑 /etc/ganglia/gmetad.conf: - - 首先, 使用gridname命令来设置集群的名称。 - -``` -gridname "Home office" - -``` - - 然后, 使用data_source命令根据集群的名称来设置主节点主机和被监控节点的轮询时间 - -``` -data_source "Labs" 60 192.168.0.29:8649 # Master node -data_source "Labs" 60 192.168.0.32 # Monitored node - -``` - -#### 5. 编辑 /etc/ganglia/gmond.conf. - - a)确保集群的配置和下面的一样。 - -``` -cluster { -name = "Labs" # The name in the data_source directive in gmetad.conf -owner = "unspecified" -latlong = "unspecified" -url = "unspecified" -} - -``` - - b) 在udp_send_chanel 中,注释掉 mcast_join directive: - -``` -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脚本能够连接: - -``` -# 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`  - - [![Gangila Web Interface](http://www.tecmint.com/wp-content/uploads/2016/06/Gangila-Web-Interface.png)][5] - - Gangila Web Interface - -#### 8. 在Ubuntu上安装Ganglia-monitor: - -``` -$ sudo aptitude update && aptitude install ganglia-monitor - -``` - -#### 9. 编辑被监控主机的配置文件/etc/ganglia/gmond.conf,在主节点主机上也是相同的文件,注释掉网格里面不在线的主机。需要编辑udp_send_channel和udp_recv_channelshould这两项 - -``` -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 -} - -``` - -Then, restart the service: -之后重启服务 - -``` -$ sudo service ganglia-monitor restart - -``` - -#### 10. 刷新页面你将看到各种状态以及图形化的展示集群或网格的配置情况(用下拉菜单选择我们想查看的集群或网格): - -[![Ganglia Home Office Grid Report](http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Home-Office-Grid-Report.png)][4] - -Ganglia中网格的报告 - -使用菜单按钮你可以选择组里面的节点主机,这将非常容易的获取到你感兴趣的信息。可以使用对比选项来查看集群中所有主机的信息。 - -当然你也可以使用正则表达式来快速对比一组主机 - -[![Ganglia Host Server Information](http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Server-Information.png)][3] - -Ganglia Host Server Information - -One of the features I personally find most appealing is the mobile-friendly summary, which you can access using the Mobile tab. Choose the cluster you’re interested in and then the individual host: -能够使用移动设备管理,对于移动端有友好界面,这是一个非常吸引人的特点。在集群中选中一个主机,点击它。 - -[![Ganglia Mobile Friendly Summary View](http://www.tecmint.com/wp-content/uploads/2016/06/Ganglia-Mobile-View.png)][2] - -Ganglia 移动端截图 -### 总结 - -本篇文章向大家介绍了Ganglia,他是一个功能强大扩展性很好的监控工具,主要用来监控集群和网格。它可以随意安装,便捷的组合各种功能(你甚至可以尝试一下官方提供的demo网站[official website][1])。 -此时你可能会发现许多知名的it企业或许并不使用Ganglia来监控作为监控工具。他们有自己更好的工具去实现,除了那些工具以外,我们这篇文章里面提到的Ganglia可能是最方便的图形化(在图示主机上显示对应的名字)工具。 -但是请不要拘泥于本篇文章,尝试一下自己去做,不必犹豫不敢尝试。如果你有任何问题也欢迎给我留言。 --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-configure-ganglia-monitoring-centos-linux/ - -作者:[Gabriel Cánepa][a] - -译者:[ivo-wang](https://github.com/ivo-wang) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://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]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[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/ diff --git a/translated/tech/20161004 Keeping Linux containers safe and secure.md b/translated/tech/20161004 Keeping Linux containers safe and secure.md deleted file mode 100644 index 706a916c96..0000000000 --- a/translated/tech/20161004 Keeping Linux containers safe and secure.md +++ /dev/null @@ -1,67 +0,0 @@ -# 保持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 的目标是提供一个允许开发人员、运营团队、安全团队通过开发生命周期的容器,保持完整的“托管链”的可见性,同时提供生产部署所需的可见性、可预测性和控制性。Anchore的引擎通过插件可以进行分析(通过提取图像数据和元数据)、查询(允许对容器进行报告)、以及策略评估(这里的正常指可以被指定的管理的图像)。 - -虽然市场上有很多扫描工具,但是大部分不开源。我们认为安全合规的产品应该是开源的,否则你怎么才能信任他们。 - -Anchore 除了开源以外,还有两大优势,使他可以区别于市场中的商业产品。 - -首先,我们看的不止是操作系统的镜像。如今的扫描工具专注于操作系统的软件包,比如“你的RPM或DEB包中有CVE(安全漏洞)么?”.这虽然是很重要的,你不希望你的镜像中有不安全的包,但是操作系统包只是镜像的基础。其他的层次都需要进行验证,包括配置文件、语言模块、中间件等等。你可以拥有所有的最新的软件包,但是可能一个配置文件配置出现错误或者是不安全的配置。第二个不同就是允许用户添加自己的数据库拓展、查询或策略。 - -### 什么推动了容器的校验和分析工具?这个工具可以解决运营面临的什么问题呢? - -企业使用Docker首要关注的就是安全,特别是他们正在部署的容器的分配和合规性。在生产环境中,从公共镜像库拉取一个镜像,运行它,并在几秒钟部署,是非常简单的,甚至不知道下面可能发生什么。 - -容器是不透明的,包含应用程序的他们是可以部署的“黑盒”。虽然非常容易把这些镜像看作“打包的应用程序”,但是他们包括了系统的镜像和多达数百个包和成千上万个文件。 - -要对您的容器部署有信心,你需要知道底层是什么和基于容器镜像的内容来做出决定。 - -### 如今容器的创新基本上都是开源的,你认为那是什么呢?是什么驱动了他们开源呢? - -在过去的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 角色,我们看到系统管理员/运营团队在转换角色时,更多的了解开发。我们也看到了具有混合能力的团队。我们设计了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) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker diff --git a/translated/tech/20161128 Mir is not only about Unity8.md b/translated/tech/20161128 Mir is not only about Unity8.md deleted file mode 100644 index 6b5f2b03dc..0000000000 --- a/translated/tech/20161128 Mir is not only about Unity8.md +++ /dev/null @@ -1,85 +0,0 @@ -Mir 并不只关于Unity8 -============================================================ - - ![mir](https://insights.ubuntu.com/wp-content/uploads/2cf2/MIR.png) - -_这是一篇来自 Canonical 的软件工程师 Alan Griffiths 的一篇游客文章。如果你也想投稿,请联系 ubuntu-devices@canonical.com_ - -Mir 是管理程序显示的项目。它可以与当前 Ubuntu 桌面(及很多其他)上使用的我们更熟悉的X-Windows进行比较。我下面会讨论使用 Mir 的一些动机,但本篇的目的是澄清 Mir 和 Unity8 之间的关系。 - -大多数时候你听说 Mir 时都会提到 Unity8。这并不奇怪,因为 Unity8 是 Canonical 的用户shell,用户会一直与它交互。 Mir “只”使这成为可能。Unity8 目前用于手机和平板电脑,也可作为 Ubuntu 16.10 桌面上的“预览”。 - -在这里我想解释一下使用 Mir 是可以使用Unity8 的。或者作为替代 shell,或者作为嵌入式环境的更简单的接口:信息窗口,电子标牌等。Mir “抽象层”证明了这一点,它提供了三个重要的元素: - -1\. libmiral.so - Mir 的稳定接口,提供基本的窗口管理; -2\. miral-shell - 一个提供“传统”和“平铺”窗口管理的示例shell; -3\. miral-kiosk - 一个仅提供基本窗口管理的示例“kiosk”。 - -miral-shell 和 miral-kiosk 示例服务器可从 zesty 的归档文件中获得,Kevin Gunn已经在[记录][1]关于在“Voices”上提供基于 miral-kiosk 的“kiosk”。我将在下面给出更多关于使用这些例子的细节,但在[我的“voices”博客][2]上有更多(包括“如何”开发自己的替代Mir服务器)。 - -**使用 MIR** - -Mir 是一套编程库,而不是独立的程序。这意味着这需要程序去调用它实现相应的功能。有两种方式去使用Mir库:编写程序的时候作为“客户端”,或者在实现shell的实现“服务端”。客户端(和X11一起)典型是使用工具库,而不是直接使用 Mir(或者 X11)。 - -Mir支持GTK、Qt 和 SDL2 中有支持。当在那些工具集中支持它时(默认在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 安装后你可以在 Unity7 中运行一个 Mir 服务端作为一个窗口,然后运行一个客户端(比如 gedit): - -``` -$ miral-shell& -$ miral-run gedit -``` - -这会给你(非常基础)“传统” 的桌面窗口管理。另外你可以试下“tiling” 窗口管理器: - -``` -$ miral-shell --window-manager tiling& -$ miral-run qterminal -``` - -或者(甚至更基础的)kiosk: - -``` -$ miral-kiosk& -$ miral-run 7kaa -``` - -这些 Mir 服务端都不会提供带有“启动器”、通知等的完整“桌面”。但是它们演示了不使用 Unity8 使用 Mir 的可能。 - -**MIR 解决的问题** - -X-Windows 系统已经并且仍然非常成功地提供了与计算机的交互方式。它提供了广泛的硬件和驱动程序一致的抽象。它支持许多桌面环境和图形用户界面工具包,并允许他们在大量计算机上一起工作。 - -但它来自一个与当前电脑使用方式不同的时代,现在有一些问题是很难满足的,因为它需要支持老旧的系统。 -在 1980 年,大多数计算机是由专家管理的大型事物,将它们连接在一起“是非常困难的”。在那个时代,开发软件的成本是这样的,一个程序“监听”另一个程序获得的好处是可以忽略不计的:此时几乎没有计算机,同时它们是独立的,它们所有的工作不对金融开放。 - -X-Windows 在这种环境下开发,通过一系列扩展,已经适应了许多变化。但它本质上是不安全的:任何应用程序可以找出在显示器上显示了什么(并影响它)。你可以编写像 Xeyes(用“眼睛”跟踪光标)或“Tickeys”(通过键盘来生成打字机噪声)等应用程序。现实是,任何和所有应用程序可以跟踪和操纵几乎所有的事情。这就是基于X的桌面如 Unity7、Gnome、KDE和其余工作。 - -X-Windows 中的窗口管理的开放性质不适合用于具有数百万计算机连接到因特网的世界,它们用于信用卡交易和网上银行,且由非专家管理,并自愿安装来自陌生人的程序。人们越来越意识到让 X-Windows 适应新的安全性和图形性能的要求是不可行的。 - -现在至少有两个开源项目旨在提供替代它:Mir 和 Wayland。虽然有些人认为两者是竞争关系,但在很多领域,它们有共同的利益:它们都需要那些假设使用 X11 的软件交互,并且许多支持工作对两者都有益。 - -Canonical 对 X-Windows 的替换品 Mir,它只将信息暴露给它需要的应用程序(因此没有按键监听或光标跟踪)。它可以满足当前时代的需求,并可以利用现代硬件,如图形处理器。 - --------------------------------------------------------------------------------- - -via: https://insights.ubuntu.com/2016/11/28/mir-is-not-only-about-unity8/ - -作者:[ Guest][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [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/ diff --git a/translated/tech/20161220 How Linux got to be Linux Test driving 1993-2003 distros.md b/translated/tech/20161220 How Linux got to be Linux Test driving 1993-2003 distros.md deleted file mode 100644 index 0b395c4c37..0000000000 --- a/translated/tech/20161220 How Linux got to be Linux Test driving 1993-2003 distros.md +++ /dev/null @@ -1,246 +0,0 @@ -How Linux got to be Linux: Test driving 1993-2003 distros -============================================================ -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 版本系统来开始这段旅程,该系统差不多 20 年以前就在 **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 文件系统到分区,到显示图形菜单操作界面要经过 7 个步骤,之后开始复制 'basedsk' 镜像文件。这里使用的是以最小化方式来安装 Debian 系统,跟大家在安装自己的 Linux 系统过程中的很多步骤都非常相似。 - -Debian 系统因其自身的包管理器而出名,但是在早期的版本中只是多一些提示功能而已。有 ‘dpkg' 命令,但它是一个基于交互式菜单的系统——一种看似很笨拙的‘雕虫小技’,有多个层次的可选菜单,并且自然地附带了几个可用软件包。 - -尽管如此,你也可以感受到其简便的设计理念。你只需下载三个软盘镜像文件,最后合成一个可启动的系统,然后就可以使用一个简单的文本菜单来安装更多的东西。我由衷的明白了为什么 Debain 系统如此受欢迎的原因。 - -### 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` 界面颜色的过程中却不小心把 `Xorg.conf` 这个配置文件给覆盖了,最后我完全放弃了。 - -在 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 年在 Maryland 一家软件商店里买的 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` 这个文件管理器组合包跟 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 ,但是这个窗口管理器只是一个早期的 [雏形][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 系统 - -新 Fedora Core 版本系统于 2003 年发布。 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) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [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/ -[^]: \ No newline at end of file diff --git a/translated/tech/20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md b/translated/tech/20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md deleted file mode 100644 index 3e0c65781b..0000000000 --- a/translated/tech/20161223 Best 4 Command Line Download Managers-Accelerators for Linux.md +++ /dev/null @@ -1,109 +0,0 @@ -Linux 下 4 个最好的命令行下载管理器/加速器 -============================================================ - -我们经常由于不同需求使用下载管理器从互联网下载文件,这是对我和其他人的主要贡献者之一。我们都想要一个超级快速的下载管理器来完成下载尽可能多的任务,以便我们可以节省时间来进一步地工作。这里有很多可以加速下载的下载管理器和加速器可用(GUI和CLI)。 - -所有的下载工具做着同样的任务,但它们的处理和功能是不同的,单线程和多线程、交互和非交互。 在这里,我们将列出四个最好的我们日常工作使用的命令行下载加速器,。 - -#### #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 支持(主动、被动模式) -* FTP 通过 HTTP 代理(GET 命令或隧道) -* 分段下载 -* Cookie 支持 -* 它可以作为守护进程运行。 -* BitTorrent 协议支持与快速扩展。 -* 在含有多个文件的 torrent 中的选择性下载 -* Metalink 版本 3.0 支持(HTTP/FTP/BitTorrent)。 -* 限制下载/上传速度 - -有关 Aria2 的进一步用法,请参阅以下文章。 - -[如何在Linux中安装和使用 Aria2][2] - -#### #2 Axel - -[Axel][3] 是一个轻量级下载程序,它如其他加速器那样做着同样的事情。它为一个文件打开多个连接,每个连接下载单独的文件片段以更快地完成下载。 - -Axel 支持 HTTP、HTTPS、FTP和 FTPS 协议。它也可以使用多个镜像下载单个文件。 所以,Axel 可以加速下载高达40%(大约,我个人认为)。 它非常轻量级,因为没有依赖和使用非常少的CPU和RAM。 - -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和TFTP)传输数据到服务器上或传输到本地的工具。 - -该命令旨在无需用户交互即可工作。此外,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) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.2daygeek.com/author/magesh/ -[1]:https://aria2.github.io/ -[2]:http://www.2daygeek.com/aria2-command-line-download-utility-tool/ -[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]:http://www.2daygeek.com/wget-command-line-download-utility-tool/ -[7]:https://curl.haxx.se/ -[8]:http://www.2daygeek.com/curl-command-line-download-manager/ diff --git a/translated/tech/20161230 Hot programming trends in 2016.md b/translated/tech/20161230 Hot programming trends in 2016.md deleted file mode 100644 index 7d58a90134..0000000000 --- a/translated/tech/20161230 Hot programming trends in 2016.md +++ /dev/null @@ -1,82 +0,0 @@ -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 的项目和工作岗位,到新公司成立背后的原因,以及清除我们杂乱的台面上的空间(嘿,Alexa!)。是的,即使像 OSCON 这样的会议都处处提及 AI。虽然计算能力的可用性已经铺平了道路,所有关于 AI 的开源已经引起了行业广泛开放的创新和竞争。谷歌的 [TensorFlow][8]、[OpenAI][9] 和 [Apache Spark][10]领导的强大框架,但也有较小的球员,如 [Nervana][11] 的 [Neon][12] 和 [Theano][13]。 - -AI 的兴起如何影响软件开发者的前景?好了,现在是了解 Python 的好时机 - 它的敏捷性和流行性与数据工程师和科学家使它成为最流行的AI编程语言,其次是R、Java和Scala。 - -### 容器和 Go 的结合就像花生、黄油和果冻 - -[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 Media,Inc.的战略内容总监,领导了一个编辑团队,其涵盖各种各样的编程主题,从全栈 web 开发到企业中的开源到新兴的编程语言。她是 OSCON,O'Reilly软件架构会议和 Fluent 的编程主席。 她从事技术出版工作超过10年,获得许多领域的内容,包括移动编程、UX、计算机安全。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/16/12/yearbook-top-programming-trends-2016 - -作者:[Rachel Roumeliotis][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [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 diff --git a/translated/tech/20170103 4 hot skills for Linux pros in 2017.md b/translated/tech/20170103 4 hot skills for Linux pros in 2017.md deleted file mode 100644 index 9ffca45289..0000000000 --- a/translated/tech/20170103 4 hot skills for Linux pros in 2017.md +++ /dev/null @@ -1,62 +0,0 @@ -2017 年 4 个 Linux 热门技能 -============================================================ - -### 你在新的一年里需要刷哪些技能? - - ![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 diff --git a/translated/tech/20170104 50 ways to avoid getting hacked in 2017 copy.md b/translated/tech/20170104 50 ways to avoid getting hacked in 2017 copy.md deleted file mode 100644 index f0dcdd6251..0000000000 --- a/translated/tech/20170104 50 ways to avoid getting hacked in 2017 copy.md +++ /dev/null @@ -1,194 +0,0 @@ -2017年系统免遭黑客侵袭的50种方法 -============================================================ - -### 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 - -当我还是小孩子,耳畔萦绕着流行歌[与爱人分手的50法][3](Paul Simon)。当我渐渐地长大,突然受歌的启发,收集了50种方法,免得你——门内汉和门外汉——遭受黑客侵袭啊: -### "你刚刚从后头溜出去了,杰克" - -1\. 备份你的数据。如果你不幸被勒索软件光顾,那么你就不用付出任何代价,因为你做了备份。 - -2\. 当你需要在公共场所为你的手机充电,那就使用[sysncstop][4]吧,或者你也可以用你的备份电池。 - -3\. 利用好你的审计子系统,里头有好多很酷的工具可以帮助你监控系统。如果你确实遭到了入侵,那么审计系统也许就可以告诉你发生了什么,以及攻击者做了些什么。 - -4\. 说到日志,把日志分流到集中式服务器上总是一个不错的想法,因为如果某个黑客侵入你的系统里,他首先要攻击的就是日志系统以便隐藏他的踪迹。构建一个好的入侵检测系统来监控日志,这对于防范黑客也很有帮助。 - -### "做份新的计划吧,斯坦" - -5\. 以强制模式运行 SELinux(见 [stopdisablingselinux.com][5])。没想到它会花费我这么长时间来达到那个目的? SELinux 可以防止 0 day 漏洞的升级。当 [Shell Shock][6] 漏洞出现的时候,SELinux是曾唯一的防护手段。 - -6\. 如果可能,在 [SELinux 沙盒][7]中运行应用程序吧——在容器冷却前,它还是个容器。同时,请遵循 [Flatpack][8] 开发,这个工具很快会开发沙盒功能。 - -7\. 不要安装或者使用 Flash。Firefox 不再支持它了,同时也希望大多数 web 服务器正在远离它。 - -8\. 使用 [定义的 SELinux 用户][9]来控制它们在系统中所做的事。如果你正运行着一台共享登陆的系统,设置用户为 **guest_t**。 - -### "你不必害羞,罗伊" - -9\. 利用 [systemd 工具][10]来帮助你提升系统安全。大多数系统攻击是通过监听网络上的服务来实现的,而 Systemd 提供了一些很棒的方法来锁定服务。例如,使用 **[PrivateTmp=yes][1]** 。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\. 我用我手机做的一件很酷的事情,就是设置让我的信用卡公司每次在我的信用卡记账时给我发送文本信息。那样的话,如果账号被盗,我会更快地知道。 - ->我不会在我的手机上进行网上银行操作——我只在我的 Linux 计算机上做这事儿。 - -20\. 当你需要安全地通讯,请使用[信号安全信息应用][12]. - -### "搭个便车,格斯" - -21\. 在你的计算机系统上运行 Linux。当我第一次用一台计算机系统连上我父亲的计算机时,我就在他的系统受病毒感染前直接回家了。我回去,给他的系统安了个 Linux,而他从那以后就一直运行着它。我相信 Linux 大体上说是一个更加安全的系统,因为它的设计方式。而且我也相信这个桌面被黑的可能性也相对较小,因为用它的人相对较少。有些人或许要持反对意见了,他们会说 Windows 在过去几年中已经有了很大的改进了,但对于我而言,我仍然坚持己见。 - -22\. 只运行那些有[安全反应团队][13]进行安全监管的发行版。企业软件及其重要。 - -23\. 运行一个企业级内核。在容器中,单点故障往往是内核。如果你想要保证它安全,那么就使用一个企业级内核,即便它不是一个最新的版本,但这也意味着包含了最新的安全补丁。记住,最新的内核虽然带来了最新的安全补丁,但是它也带来了大量的新代码,这些代码可能存在漏洞。 - -### "你不要说太多" - -24\. 大多数非法入侵都是通过社会工程学实施的——例如,电子邮件链接,web 浏览器攻击,以及电话。对于此,最好的选择是接受相关教育,并且对一切留个心眼儿。没有哪个来自尼日利亚的家伙会给你钱。美国国税局也不会打电话到你家问你要钱。如果你电子邮件收到了来自你银行的电子邮件,里面包含有到某个网站的链接,那么不要直接去点击那个链接,在 web 浏览器中输入那个地址来打开。 - -25\. 总是把你的系统打上最新的安全补丁。已知有安全漏洞以及过时的系统的数量十分可怕,脚本小子们依赖于你**不**更新系统。 - ->总是把你的系统打上最新的安全补丁。 - -26\. 当连接到网络上的服务时,请始终使用 HTTPS。Chrome 和 Firefox 现在已经开启了强制模式。到 2016 年为止,那些还不支持安全通讯的网站可能就不值得你们访问。 - -27\. 在你的容器中使用 [seccomp][14],这会限制针对内核表面的攻击,这只是单点故障。限制什么进程可以会话。 - -### "就把那钥匙丢下吧,李" - -28\. 使用 [YubiKey][15] 来存储私钥。 - -29\. 加密你系统上的数据。至少对于笔记本而言,应该把**家目录**以及你的其它数据目录加密。几年前,我正乘坐在伦敦的地铁上,我的笔记本就成了某些人的目标——我下了车,车门关上了,而我发现我的笔记本不见了。此时,地铁已经驶出了站台。幸运的是,我把磁盘加密了。 - -30\. 给你的所有网站用上 [Let's Encrypt][16] 吧,没有任何理由不再运行 HTTPS 了。 - -31\. 绝不要在不同 web 服务器上使用相同的密码。虽然这个很难不落入陷阱,但是像 Let's Encrypt 这样的工具会有很大帮助。如果你使用 ssh 密钥来登陆进系统,这会更好。 - -32\. 使用双因素认证(2FA)。密码变得无关紧要,使用 Yubieys 以及诸如此类的工具可以使得双因素认证很方便,我们都有手机。在手机中生成一个密钥,并把秘密藏在你的大脑中,总是比一个密码来得更好。 - -33\. 网站总要我设置帐号,没有比这更激怒我的事情了——我们就不能做得更好点?对于网站密码,始终都要使用密码生成工具来生成。我是个保守派:我使用 [Password Safe][17] 来生成密码,然后剪切粘贴到 web 浏览器中。我听说,其他人使用 [LastPass][18],或者其它整合在手机和 web 服务中的工具也用着不错。 - -34\. 配置像 [FreeIPA][19] 之类的服务,用于身份认证。使用像 [Kerberos][20] 之类的工具来认证和授权,会使得跟踪雇员和他们对系统的访问更为简便(而且它也有很酷的加密服务)。使用活动目录也很不错,或许我有点偏颇。 - ->如果你经常输入密码,那就使用一个容易记忆的句子,而不是一个单词。 - -35\. 如果你经常输入密码,那就使用一个容易记忆的句子,而不是一个单词。我所偏好的用于记忆密码的方式,就是使用几个单词长度并且易于输入的词组。 - -### "让自己自由" - -36\. 使用 [USBGuard][21] 来保护你的系统免遭流氓 USB 设备破坏。 - -37\. 在过去几年中,我一直工作在容器中,让我们来说说容器的安全吧。首先,让它们在开启强制模式的 SELinux 的系统中运行。如果你的系统不支持 SELinux,那就换个支持它的版本吧。SELinux 是使用文件系统来保护容器免遭破坏的最佳工具。 - -38\. 如果可能,在容器中跑你的服务吧。我相信,使用 [OCI Image Format][22] 和 Linux 容器技术是应用的未来。用 [runC][23],OCID,RKT,Systemd-nspawn 等等应用来启动这些容器。虽然我常常说“容器并不包容“,但是这些服务确实在容器外运行时要比容器内好。 - -39\. 在虚拟机中运行容器。虚拟机提供比容器更好的隔离机制,在虚拟机中跑像容器之类的东西,更加灵活有弹性,并且互相隔离。 - -40\. 在不同的虚拟中,按不同的安全需求跑容器应用。你可以在 DMZ 中的虚拟机上跑 web 服务容器,而在 DMZ 外的虚拟机上跑数据容器。 - -41\. 同时,记得在不同的物理机上跑需要最高安全性的虚拟机,并且抛在在容器内的不同虚拟机上(这也叫深度防护)。 - -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] 这样的工具来扫描你系统的漏洞。糟糕的是,新的漏洞总是层出不穷,所以你得时刻更新你的扫描器。(也可以看看 [atomic scan][30],用于扫描你的容器。) - -49\. OpenScap 也具有扫描[安全配置][31]的功能,如 STIG(安全技术部署指南)。 - -50\. 为你孩子收到的所有那些圣诞物联网设备设置一个特别的客户网络。我钟爱我的 Amazon Echo,还有自动化灯以及电源开关(“亚力克沙,打开圣诞灯“),但是所有这些都是由可能存在安全问题的 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) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [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/ diff --git a/translated/tech/20170107 Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi.md b/translated/tech/20170107 Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi.md new file mode 100644 index 0000000000..5a5545cf10 --- /dev/null +++ b/translated/tech/20170107 Block Ads on All Your Devices at Home with Pi-hole and an Orange Pi.md @@ -0,0 +1,81 @@ +用 Pi-hole 和 Orange Pi 在你所有的设备上阻止广告 +============================================================ + + +你是否发现在你的浏览器、智能手机和平板上设置广告拦截器很恼火? 至少我是这样的。我家里有一些“智能”设备,然而它们似乎没有任何类型的广告拦截软件。 好了,我了解到 [Pi-hole][2] 是一个 pi 上的广告拦截软件,它能在到达你的设备之前阻止所有的广告。它能让你列出任何域的黑名单或白名单,并且它有一个很好的面板,让你深入了解你的家庭网络最常访问的域/网站、最活跃的设备和最常见的广告商。 + +Pi-hole 的确是针对树莓派上运行的,但我想知道它能否在我运行 Armbian Linux 的廉价 Orange Pi 上运行。 好吧,它绝对可以!下面是我让 Pi-hole 能快速运行的方法。 + + +### 安装 Pi-hole + +安装 Pi-hole 是使用终端完成的,所以打开你的 Orange Pi 桌面上的终端或 ssh 到 pi。 + +你将下载软件,并进入到你选择的目录,确保你有写入权限。像这样: + + +``` +cd / +``` + +我偏离了 Pi-hole 主页上的“一键”安装。 我的意思是,他们说在命令下面说“管道到 bash 可能是危险的”,本地安装是“更安全”。所以,这里是我的本地安装步骤: + +``` +git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole +cd Pi-hole/automated\ install/ +./basic-install.sh +``` + +如果你没有以 root 用户身份登录,那么基本安装脚本将提示你输入密码,然后再继续。 如果需要,脚本将下载并安装一些必备的 Linux 软件包。接着它会显示一个红蓝界面,提示你回答有关如何配置 Pi-hole 的几个问题。以我的经验,直接接受默认值就可以了,我后来发现 Pi-hole 的 web 程序可以更改设置,如DNS提供商。 + +该脚本将告诉你在图形界面和终端中 Pi-hole 的密码。 请记住该密码! + +脚本还会告诉你 Pi-hole 的网址,应该像这样: + +``` +http:///admin +``` + +或者类似这样 + +``` +http://orangepipc/admin +``` + +你需要输入 Pi-hole 密码,接着你会看到像下面这样的漂亮面板: + + ![Ph-hole](https://i1.wp.com/piboards.com/wp-content/uploads/2017/01/ph-hole.png?resize=640%2C532) + +请记住更改家庭网络路由器上的 DNS 设置并使用你 pi 的地址。 否则,广告不会被过滤! + +上面的说明与 Pi-hole 网站提供的替代“安全”方法大致相同,尽管 Armbian 没有被列为官方支持的操作系统。我相信这些说明应该在 Raspberry Pi 或其他运行某种形式的基于 Debian 的 Linux 操作系统的 pi 上工作。但是,我并没有测试,我有兴趣听到你的经验(请给我留下简短的评论)。 + + +### 思考和观察 + +运行 Pi-hole 一段时间后,在 Pi-hole 面板上出现一些学习信息,我发现有比我所知道的更多的网络活动,它们并不是所有我批准的活动。例如,有一些我不知道的关于游戏程序的“有趣”连接从我的孩子的设备上发出,加上社交网络程序显然一直在给我发送骚扰数据。总之,无论是否是良性流量,我很高兴减少了流量负载,即使有点少。。。我的意思是,为什么我应该允许我不想要的或者不关心的应用程序和广告吃掉我的网络流量?好吧,现在他们被封锁了。 + +像这样为 Orange Pi 设置广告屏蔽很便宜、容易,并有助于在限制一些不必要的流量从我的家庭网络中来回(特别是关于孩子们的)中放松我的大脑。如果你有兴趣,你可以看到我上一篇文章关于如何[轻松设置一个 Orange Pi][3],并使用下面的链接来查看 Orange Pi 是多么便宜。我相信这是一个值得投资东西。 + +Amazon 上的 Orange Pi (附属链接):  [Orange Pi PC Single Board Computer Quad Core ARM Cortex-A7 1GB DDR3 4K Decode][4] + +[AliExpress 上的Orange Pi 商店][5] (附属连接). + +编辑:这篇文章讽刺的是,如果你成功设置了 Pi-hole,这个站点上的链接 (s.click.aliexpress.com) 将被屏蔽,是否加入到白名单取决于你。 + +-------------------------------------------------------------------------------- + +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] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者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 diff --git a/translated/tech/20170107 Min Browser Muffles the Web Noise.md b/translated/tech/20170107 Min Browser Muffles the Web Noise.md new file mode 100644 index 0000000000..843c3e9f10 --- /dev/null +++ b/translated/tech/20170107 Min Browser Muffles the Web Noise.md @@ -0,0 +1,123 @@ +使用 Min 浏览器消除 web 噪音 +============================================================ + ![Min Browser Muffles the Web's Noise](http://www.linuxinsider.com/ai/637666/browser-tabs.jpg) + +[Min][1] 是一款具有最小设计的 web 浏览器,可以通过简单的功能提供快速操作。 + +当涉及到软件设计时,“最小”并不意味着潜在的低级功能或未开发。如果你喜欢文本编辑器和笔记程序中的最小防干扰工具,那么你会在 Min 浏览器中有同样舒适的感觉。 + +我大多在我的台式机和笔记本电脑上使用 Google Chrome、Chromium和 Firefox。我研究了很多它们的附加功能,所以我可以在我的长期研究和工作中可以访问所有的专业服务。 + +然而,我有时喜欢一个快速、整洁的替代品来上网。随着多个项目的进行,我可以很快打开一大批选项卡甚至是独立窗口的强大浏览器。 + +我试过其他浏览器选项但很少成功。替代品通常有自己的一套分散注意力的附件和功能,它们会让我开小差。 + +Min 浏览器不这样做。它是一个易于使用并在 GitHub 开源的 web浏览器,它不会使我分心。 + + ![Min browser ](http://www.linuxinsider.com/article_images/2017/84212_620x514.jpg) +Min 浏览器是最小化浏览器,提供了简单的功能以及迅速的操作。只是不要指望马上上手 + +### 它做些什么 + +Min 浏览器提供了 Debian Linux 版本、Windows 和 Mac 机器的版本。它不能与主流跨平台 web 浏览器中的可用功能竞争。 + +它不必竞争,但是它的声誉非常好,它可能是补充而不是取代它们。 + +其中一个主要原因是其内置的广告拦截功能。开箱即用的 Min 浏览器不需要配置或寻找兼容的第三方应用程序来拦截广告。 + +在 Edit/Preferences 中,关于内容阻止你有三个选项可以点击/取消点击。它很容易修改屏蔽策略来适应你的喜好。阻止跟踪器和广告选项使用 EasyList 和 EasyPrivacy。 如果没有其他原因,请保持此选项选中。 + +你还可以阻止脚本和图像。这样做可以最大限度地提高网站加载速度,并真正提高你对恶意代码的防御。 + +### 按你的方式搜索 + +如果你花费大量时间在搜索上,你会喜欢 Min 处理搜索的方式。这是一个顶级的功能。 + +可以直接在浏览器的网址栏中访问搜索功能。Min 使用搜索引擎有 DuckDuckGo 和维基百科。你可以直接在 web 地址栏中输入搜索查询。 + +这种方法很节省时间,因为你不必先进入搜索引擎窗口。 一个额外的好处是可以搜索你的书签。 + +在 Edit/Preferences 菜单中,选择默认的搜索引擎。该列表包括 DuckDuckGo、Google、Bing、Yahoo、Baidu、Wikipedia 和 Yandex。 + +尝试将 DuckDuckGo 作为默认搜索引擎。 Min 默认使用这个选项,但它不会强加给你。 + + ![Min browser search function ](http://www.linuxinsider.com/article_images/2017/84212_620x466.jpg) +Min 浏览器的搜索功能是 URL 栏的一部分。Min 使用 DuckDuckGo 和维基百科作为搜索引擎。你可以直接在 web 地址栏中输入搜索查询。 + +搜索栏会非常快速地显示你问题的答案。它会使用 DuckDuckGo 的信息,包括维基百科条目、计算器以及更多。 + +它能提供快速片段、答案和网络建议。它是在基于 Google 环境的一个替代。 + +### 导航辅助 + +Min 允许你使用模糊搜索快速跳转到任何网站。它几乎能立即向你抛出建议。 + +我喜欢在当前标签旁边打开标签的方式。你不必设置此选项。它在默认情况下没有其他选择,但它是有道理的。 + +[ + ![Min browser Tasks](http://www.linuxinsider.com/article_images/2017/84212_620x388-small.jpg) +][2] +Min 的一个很酷的操作是将标签整理到任务中,这样你可以随时搜索。(点击图片放大) + +你不用一直点击标签。这使你可以专注于当前的任务,而不会分心。 + +Min 不需要附加工具来控制多个标签。浏览器会显示标签列表,并允许你将它们分组。 + +### 保持专注 + +Min 在“视图”菜单中隐藏了一个可选的“聚焦模式”。启用后,除了你打开的选项卡外,它会隐藏所有选项卡。 你必须返回到菜单以关闭“聚焦模式”,然后才能打开新选项卡。 + +任务功能还可以帮助你保持专注。你可以从“文件”菜单或使用 Ctrl+Shift+N 创建任务。如果要打开新选项卡,可以在“文件”菜单中选择该选项,或使用 Control+T。 + +调用符合你的风格的新任务。我喜欢能够组织与显示与工作项目或与我的研究的特定部分相关联的所有标签。我可以在任何时间召回整个列表,以轻松快速的方式找到我的浏览记录。 + +另一个整洁的功能是在 tab 区域可以找到段落对齐按钮。单击它启用阅读模式。此模式会保存文章以供将来参考,并删除页面上的一切,以便你可以专注于阅读任务。 + +### 并不完美 + +Min 浏览器并不是强大的,功能丰富的完美替代品。它有一些明显的弱点,开发人员花了太长时间而不能改正。 + +例如,它缺乏一个支持论坛和详细用户指南的开发人员网站。可能部分原因是它的官网在 GitHub,而不是一个独立的开发人员网站。尽管如此,对新用户而言这是一个弱点。 + +没有网站支持,用户被迫在 GitHub 上寻找自述文件和各种目录列表。你也可以在 Min 浏览器的帮助菜单中访问它们 - 但这没有太多帮助。 + +一个例子是当你启动浏览器时,屏幕会显示欢迎界面。它会显示两个按钮,一个人是 “Start Browsing”,另一个是 “Take a Tour.”。但是没有一个按钮可以使用 + +但是,你可以通过单击 Min 窗口顶部的菜单栏开始浏览。但是,缺少导览还没有解决办法。 + +### 底线 + +Min 并不是一个有完整功能的 web 浏览器。它不是为通常在成熟的 web 浏览器中有的插件和其他许多功能而设计的。然而,Min 通过提供速度和免打扰来达到它重要的目的。 + +我越使用 Min 浏览器,它对我来说越有效率 - 但是当你第一次使用它时要小心。 + +Min 并不复杂或让人困惑 - 它只是有点古怪。你必须要玩弄一下才能明白它如何使用。 + +### 想要提建议么? + +有没有一个你想提议 Linux 程序或发行版?有没有你爱的或者想要了解的? + +请[在电子邮件中给我发送你的想法][3],我会考虑将来在 Linux Picks and Pans 专栏上登出。 + +并使用下面的读者评论功能提出你的想法! + +-------------------------------------------------------------------------------- + +作者简介: + +Jack M. Germain 从苹果 II 和 PC 的早期起就一直在写关于计算机技术。他仍然有他原来的 IBM PC-Jr 和一些其他遗留的 DOS 和 Windows 盒子。他为 Linux 桌面的开源世界留下过共享软件。他运行几个版本的 Windows 和 Linux 操作系统,还通常不能决定是否用他的平板电脑、上网本或 Android 智能手机,而不是用他的台式机或笔记本电脑。你可以在 Google+ 上与他联系。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxinsider.com/story/84212.html?rss=1 + +作者:[Jack M. Germain][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者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 diff --git a/translated/tech/20170111 Explore climate data with open source tools.md b/translated/tech/20170111 Explore climate data with open source tools.md new file mode 100644 index 0000000000..f2338a4e2f --- /dev/null +++ b/translated/tech/20170111 Explore climate data with open source tools.md @@ -0,0 +1,72 @@ +使用开源工具探索气候数据的奥秘 +============================================================[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") +图片源自:  + +[Flickr user: theaucitron][2] (CC BY-SA 2.0) + +如果这些天地球天气变化的不明显,你几乎无法察觉其中变化的格局。每个月,事实和数据都在向我们诠释一点——全球变暖。 + +气候学家如是告诫我们——如今的不作为,对于我们的将来可能是致命的。五角大楼高层[最近警告][3]当选总统的川普。申明如果不对气候变化有所动作,可能会造成威胁国家安全的灾难。愈趋减少的的水供应和微薄的降雨量会导致作物歉收,这将迫使大量的移民逃往世界各地,到那些可以维持他们生计的地方去。 + +遍览 NASA,美国国防部,以及其他机构针对气候的研究成果,我的心中有个疑惑。那就是是否有开源的工具,使对此感兴趣的人们能够自行去探索气候数据的奥秘,并总结出我们自己的结论。我在网上快速的检索了一下,然后找到了[Open Climate Workbench (开源气候工作台)][4],[Apache 软件基金会][5]旗下的一个工程。 + +Open Climate Workbench (缩写 OCW) 开发用于对来自[Earth System Grid Federation (地球系统网格联盟,缩写 ESGF)][6],[Coordinated Regional Climate Downscaling Experiment (协调区域气候降尺度实验,缩写 CORDEX)][7],美国全球变化研究计划的 [National Climate Assessment (国家气候研究)][8],[North American Regional Climate Assessment Program (北美区域气候评估计划)][9],和 NASA,NOAA,以及其他组织或机构的数据进行气候模型评价。 + +你可下载 OCW 的 [tar ball (压缩包)][10] 并将它安装到满足以下[条件][11]的 Linux 电脑上。也可以将它安装到 Vagrant 或者 VirtualBox 虚拟机中,详见 OCW 的[虚拟机指南][12]。   + +个人觉得想要了解 OCW 是如何工作的,最便捷的方式就是到 Regional Climate Model Evaluation System (区域气候模式评价系统,缩写 RCMES)下载一个[虚拟机镜像][13]。 + +从 RCMES 的网站上看,他们旨在通过为一系列广泛而全面的观测(例如,卫星观测,重新分析,现场观测)和建模资源(例如,[ESGF][16] 上的 [CMIP][14] 和 [CORDEX][15])提供标准化的访问,以及常规分析和可视化任务的工具(例如,OCW),来促进气候和地球系统模型的区域规模评估。 + +你需要在宿主机上安装 VirtualBox 和 Vagrant。通过它们,你就能看到一个超赞的 OCW 作业示例。RCMES 为下载,导入,运行虚拟机提供了[详细的说明][17]。当你的虚拟机开始工作时,你可以用以下身份登陆。 + +** 用户名:vagrant,密码: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 数据样图 + +RCMES 网页上的[教程][18]能帮助你迅速上手该软件。他们的[社区][19]十分活跃,而且看上去需要更多的[开发者][20]。 你也可以订阅他们[邮件列表][21]。 + +工程的[源代码][22]部署在 GitHub 上,遵寻 Apache License, Version 2.0。 + +-------------------------------------------------------------------------------- + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/donw2-crop.jpg?itok=OqOYd3A8) + +Don Watkins(唐 沃特金斯) - 教育家,教育技术专家,企业家,开源支持者。心理学硕士,教育学硕士,Linux 系统管理员,CCNA,通过使用 Virtual Box 和 VMware 完成虚拟化。twitter 关注 @Don_Watkins。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/apache-open-climate-workbench + +作者:[Don Watkins][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/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 diff --git a/translated/tech/20170111 How to Keep Hackers out of Your Linux Machine Part 1 Top Two Security Tips.md b/translated/tech/20170111 How to Keep Hackers out of Your Linux Machine Part 1 Top Two Security Tips.md new file mode 100644 index 0000000000..983b1621b5 --- /dev/null +++ b/translated/tech/20170111 How to Keep Hackers out of Your Linux Machine Part 1 Top Two Security Tips.md @@ -0,0 +1,56 @@ +如何让你的 Linux 远离黑客 第一部分:两个安全建议 +============================================================ + + + ![Keep hackers out](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/security-webinar.jpg?itok=af6QqiAm "Keep hackers out") +在本系列中,我们将介绍防止黑客入侵的五种最简单的方法。观看免费网络研讨会以了解更多信息。 [Creative Commons Zero] [1] Pixabay + +在互联网上没有什么比好的 Linux 机器让黑客更喜欢的了。在最近的 Linux 基金会网络研讨会中,我分享了黑客用来侵入你空间的战术、工具和方法。 + +在这个博客系列中,我们将介绍五个最简单的方法来防范黑客,并知道他们是否已经侵入。想要了解更多信息?请观看[][3][免费的网络研讨会点播][4]。 + +### 简单的 Linux 安全提示 #1 + +**如果你没有在使用安全 shell,你应该取使用它。** + +这是一个有非常非常长时间的提示了。Telnet 是不安全的。 rLogin 是不安全的。仍然有服务需要这些,但它们不应该暴露在互联网。如果你没有 SSH ,你只要关闭互联网连接。我们总是说:使用 SSH 密钥。 + +SSH 规则 1:不要使用密码认证。SSH 第二条规则:不要使用密码身份验证。这真的真的很重要。 + +如果任何时间你有一台 Linux 机器在互联网上,你会被暴力破解。这会发生。暴力破解用的是脚本。扫描器会看到对互联网开放的端口 22,它们就会攻击它。 + +你可以做的另一件事是修改 SSH 的标准端口,我们许多人这么做。这可以防止少量的暴力攻击,但一般来说,不使用密码认证,你会更安全。 + +SSH 的第三条规则:所有密钥都有密码。无密码密钥不是真正的密钥。我知道如果你试图自动登录或试图自动化一些事情,这会使服务难以处理,但所有的密钥应该有密码。 + +我最喜欢做的是入侵一台主机,并找到主目录与私钥。一旦我拥有了私钥,那它的游戏结束了。我可以访问使用公钥的服务。 + +如果你有口令短语或者只是密码,它不一定是你的密钥上的长密码,那么它会使我的行为更加更加困难。 + +### 简单的 Linux 安全提示 #2 + +**安装 Fail2ban.** + +我说的那些暴力攻击?fail2ban 将大大有助于它。它将自动激活 iptables 规则以阻止重复尝试 SSH 到你的机器。你一定要配置它,使它不会锁定你或者占用太多的资源。要使用它、爱它、监视它。 + +它有自己的日志,所以一定要查看它们,并检查它是否在实际运行。这是一件非常重要的事情。 + +在[本系列的第2部分][5],我会给你三个更容易的安全提示,以防止黑客远离你的 Linux 机器。你也可以[现在观看完整的免费网络研讨会][6]。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/webinar/2017/how-keep-hackers-out-your-linux-machine-part-1-top-two-security-tips + +作者:[Mike Guthrie][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/anch +[1]:https://www.linux.com/licenses/category/creative-commons-zero +[2]:https://www.linux.com/files/images/security-webinarjpg +[3]:http://bit.ly/2j89ISJ +[4]:http://bit.ly/2j89ISJ +[5]:https://www.linux.com/news/webinar/2017/how-keep-hackers-out-your-linux-machine-part-2-three-more-easy-security-tips +[6]:http://bit.ly/2j89ISJ diff --git a/translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md b/translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md index c5bf081f63..6bdbbc5992 100644 --- a/translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md +++ b/translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md @@ -1,44 +1,42 @@ -Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5 +将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模式 ——(五) ============================================================ -将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模式——(五) -这篇文章将讲解如何使用 Ubuntu 16.04 服务器版系统来创建第二台 Samba4 域控制器,并将其加入到已创建好的 Samba AD DC 林环境中,以便为一些关键的 AD DC 服务提供负载均衡及故障切换功能,尤其是为那些重要的服务,比如 DNS 服务和使用 SAM 数据库的 AD DC LDAP 模式提供这种功能。 +这篇文章将讲解如何使用 **Ubuntu 16.04** 服务器版系统来创建第二台 **Samba4** 域控制器,并将其加入到已创建好的 **Samba AD DC** 林环境中,以便为一些关键的 AD DC 服务提供负载均衡及故障切换功能,尤其是为那些重要的服务,比如 DNS 服务和使用 SAM 数据库的 AD DC LDAP 模式。 #### 需求 -1、 [在 Ubuntu16.04 系统上使用 Samba4 软件来创建活动目录架构(一)][1] - -这篇文章是 Samba4 AD DC 序列文章中的第五篇,前边几篇如下: +1、 这篇文章是 **Samba4 AD DC** 系列的第**五**篇,前边几篇如下: +[在 Ubuntu16.04 系统上使用 Samba4 软件来创建活动目录架构(一)][1] [在 Linux 命令行下管理 Samba4 AD 架构(二)][2] [使用 Windows 10 系统的 RSAT 工具来管理 Samba4 活动目录架构 (三)][3] [在 Windows 系统下管理 Samba4 AD 域管制器 DNS 和组策略(四)][4] ### 第一步:为设置 Samba4 进行初始化配置 -1、在开始把第二个 DC 服务器加入到 Samba4 AD DC 域环境之前,你需要注意一些初始化设置信息,首先,确保这个新系统的主机名符合命名规范要求。 +1、在开始把第二个 DC 服务器加入到 **Samba4 AD DC** 域环境之前,你需要注意一些初始化设置信息,首先,确保这个新系统的**主机名**包含描述性名称。 -假设第一个域服务器的主机名叫做 ’adc1‘ ,你可以把第二个域服务器命名为 'adc2',以保持域控制器名称的一致性。 +假设第一个域服务器的主机名叫做 `adc1` ,你可以把第二个域服务器命名为 `adc2`,以保持域控制器名称的一致性。 -执行下面的命令来修改系统主机名: +执行下面的命令来修改系统**主机名**: ``` # hostnamectl set-hostname adc2 ``` -或者你也可以手动编辑 /etc/hostname 文件,在新的一行输入你想设置的主机名。 +或者你也可以手动编辑 **/etc/hostname** 文件,在新的一行输入你想设置的主机名。 ``` # nano /etc/hostname ``` -设置主机名。 +这里添加主机名。 ``` adc2 ``` -2、下一步,打开本地系统解析文件并添加一个条目,包含主域控制器的 IP 地址, FQDN 名称和简写名称。如下图所示: +2、下一步,打开本地系统解析文件并添加一个条目,包含主域控制器的 IP 地址和 FQDN 名称。如下图所示: 在这篇教程中,主域控服务器的主机名为 `adc1.tecmint.lan` ,其对应的 IP 地址为 192.168.1.254 。 @@ -55,13 +53,13 @@ IP_of_main_DC FQDN_of_main_DC short_name_of_main_DC ![Set Hostname for Samba4 AD DC](http://www.tecmint.com/wp-content/uploads/2017/01/Set-Hostname-for-Samba4-AD-DC.jpg) ][5] -为 Samba4 AD DC 服务器设置主机名 +*为 Samba4 AD DC 服务器设置主机名* -3、下一步,打开 /etc/network/interfaces 配置文件并设置一个静态 IP 地址,如下图所示: +3、下一步,打开 **/etc/network/interfaces** 配置文件并设置一个静态 IP 地址,如下图所示: -注意 dns-nameservers 和 dns-search 这两个参数的值。为了能够正常解析 DNS ,需要把这两个值都设置成主 Samba4 AD DC 服务器的 IP 地址和域名。 +注意 **dns-nameservers** 和 **dns-search** 这两个参数的值。为了使 DNS 解析正常工作,需要把这两个值设置成主 Samba4 AD DC 服务器的 IP 地址和域名。 -重启网卡服务以让修改的配置生效。检查 /etc/resolv.conf 文件确保该网卡上配置的这两个 DNS 的值已更新到这个文件。 +重启网卡服务以让修改的配置生效。检查 **/etc/resolv.conf** 文件,确保该网卡上配置的这两个 DNS 的值已更新到这个文件。 ``` # nano /etc/network/interfaces @@ -80,7 +78,7 @@ dns-nameservers 192.168.1.254 dns-search tecmint.lan ``` -重启网卡服务并确认生效 +重启网卡服务并确认生效。 ``` # systemctl restart networking.service @@ -90,27 +88,27 @@ dns-search tecmint.lan ![Configure DNS for Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-DNS-for-Samba4-AD.jpg) ][6] -配置 Samba4 AD 服务器的 DNS +*配置 Samba4 AD 服务器的 DNS* -当你通过简写名称(来自 FQDN 名)查询主机名时, dns-search 值将会自动把域名添加上。 +当你通过简写名称(用于构建 FQDN 名)查询主机名时, **dns-search** 值将会自动把域名添加上。 -4、为了测试 DNS 解析是否正常,使用 ping 命令加上简写名, FQDN 名和域名进行测试,如下图所示: +4、为了测试 DNS 解析是否正常,使用一系列 ping 命令测试,命令后分别为简写名, FQDN 名和域名,如下图所示: -在所有 ping 命令的测试过程中,Samba4 AD DC DNS 服务器都应该返回主域控服务器的 IP地址。 +在所有测试用例中,**Samba4 AD DC DNS** 服务器都应该返回主域控服务器的 IP 地址。 [ ![Verify DNS Resolution for Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-DNS-Resolution-for-Samba4-AD.png) ][7] -验证 Samba4 AD 环境 DNS 解析是否正常 +*验证 Samba4 AD 环境 DNS 解析是否正常* -5、最后你需要注意的是确保这个主机跟域控服务器时间同步。你可以通过下面的命令在系统上安装 NTP 客户端工具来实现时间同步功能: +5、最后你需要注意的是确保这个主机跟域控服务器时间同步。你可以通过下面的命令在系统上安装 **NTP** 客户端工具来实现时间同步功能: ``` # apt-get install ntpdate ``` -6、假设你想手动强制本地服务器与 samba4 AD DC 服务器时间同步,使用 ntpdate 命令加上主域控服务器的主机名,如下所示: +6、假设你想手动强制本地服务器与 **samba4 AD DC** 服务器时间同步,使用 **ntpdate** 命令加上主域控服务器的主机名,如下所示: ``` # ntpdate adc1 @@ -119,11 +117,11 @@ dns-search tecmint.lan ![Time Synchronize with Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Time-Synchronize-with-Samba4-AD.png) ][8] -与 Samba4 AD 服务器进行时间同步 +*与 Samba4 AD 服务器进行时间同步* ### 第 2 步:安装 Samba4 必须的依赖包 -7、为了让 Ubuntu 16.04 系统加入到你的域中,你需要通过下面的命令从 Ubuntu 官方软件库中安装 Samba4 套件, Kerberos 客户端和其它一些重要的软件包以便将来使用: +7、为了让 **Ubuntu 16.04** 系统加入到你的域中,你需要通过下面的命令从 Ubuntu 官方软件库中安装 **Samba4 套件, Kerberos** 客户端和其它一些重要的软件包以便将来使用: ``` # apt-get install samba krb5-user krb5-config winbind libpam-winbind libnss-winbind @@ -132,7 +130,7 @@ dns-search tecmint.lan ![Install Samba4 in Ubuntu](http://www.tecmint.com/wp-content/uploads/2017/01/Install-Samba4-in-Ubuntu.png) ][9] -在 Ubuntu 系统中安装 Samba4 +*在 Ubuntu 系统中安装 Samba4* 8、在安装的过程中,你需要提供 Kerberos 域名。输入大写的域名然后按 [Enter] 键完成安装过程。 @@ -140,9 +138,9 @@ dns-search tecmint.lan ![Configure Kerberos Authentication for Samba4](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos-Authentication-for-Samba4.png) ][10] -为 Samba4 配置 Kerberos 认证 +*为 Samba4 配置 Kerberos 认证* -9、所有依赖包安装完成后,通过使用 kinit 命令请求一个 Kerberos 票据以验证设置是否正确。使用 klist 命令来列出已授权的 kerberos 票据信息。 +9、所有依赖包安装完成后,通过使用 kinit 命令为域管理员请求一个 Kerberos 票据以验证设置是否正确。使用 klist 命令来列出已授权的 kerberos 票据信息。 ``` # kinit domain-admin-user@YOUR_DOMAIN.TLD @@ -152,18 +150,18 @@ dns-search tecmint.lan ![Verify Kerberos on Samba4 Domain](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Kerberos-on-Samba4-Domain.png) ][11] -在 Samba4 域环境中验证 Kerberos +*在 Samba4 域环境中验证 Kerberos* ### 第 3 步:以域控制器的身份加入到 Samba4 AD DC -10、在把你的机器集成到 Samba4 DC 环境之前,先把系统中所有运行着的 Samba4 服务停止,并且重命名默认的 Samba 配置文件。在域控制器配置的过程中, Samba 将会创建一个新的配置文件。 +10、在把你的机器集成到 **Samba4 DC** 环境之前,先把系统中所有运行着的 Samba4 服务停止,并且重命名默认的 Samba 配置文件以便从头开始。在域控制器配置的过程中, Samba 将会创建一个新的配置文件。 ``` # systemctl stop samba-ad-dc smbd nmbd winbind # mv /etc/samba/smb.conf /etc/samba/smb.conf.initial ``` -11、在准备加入域前,先启动 samba-ad-dc 服务,之后使用域管理员账号运行 samba-tool 命令将服务器加入到域。 +11、在准备加入域前,先启动 **samba-ad-dc** 服务,之后使用域管理员账号运行 **samba-tool** 命令将服务器加入到域。 ``` # samba-tool domain join your_domain -U "your_domain_admin" @@ -175,7 +173,7 @@ dns-search tecmint.lan # samba-tool domain join tecmint.lan DC -U"tecmint_user" ``` -##### Sample Output +##### 输出示例 ``` Finding a writeable DC for domain 'tecmint.lan' @@ -231,11 +229,12 @@ Setting isSynchronized and dsServiceName Setting up secrets database Joined domain TECMINT (SID S-1-5-21-715537322-3397311598-55032968) as a DC ``` + [ ![Join Domain to Samba4 AD DC](http://www.tecmint.com/wp-content/uploads/2017/01/Join-Domain-to-Samba4-AD-DC.png) ][12] -把域加入到 Samba4 AD DC +*把域加入到 Samba4 AD DC* 12、在已安装了 Samba4 套件的 Ubuntu 系统加入域之后,打开 Samba 主配置文件添加如下行: @@ -256,7 +255,7 @@ winbind enum users = yes winbind enum groups = yes ``` -使用你自己的 DNS 转发器 IP 地址替换掉上面的 dns forwarder ip 地址。 Samba 将会把域认证区之外的所有 DNS 解析查询转发到这个 IP 地址。 +使用你自己的 **DNS forwarder IP** 地址替换掉上面地址。 Samba 将会把域权威区之外的所有 DNS 解析查询转发到这个 IP 地址。 13、最后,重启 samba 服务以使修改的配置生效,然后执行如下命令来检查活动目录复制功能是否正常。 @@ -264,15 +263,16 @@ winbind enum groups = yes # systemctl restart samba-ad-dc # samba-tool drs showrepl ``` + [ ![Configure Samba4 DNS](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Samba4-DNS.png) ][13] -配置 Samba4 DNS +*配置 Samba4 DNS* -14、另外,还需要重命名原来的 kerberos 配置文件,并使用在加入域的过程中 Samba 生成的新配置文件 krb5.conf 替换 /etc 目录下的那个文件。 +14、另外,还需要重命名原来的 /etc 下的 kerberos 配置文件,并使用在加入域的过程中 Samba 生成的新配置文件 krb5.conf 替换它。 -Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linux 的符号链接命令对该文件创建一个软链接指向 /etc 目录。 +Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linux 的符号链接将该文件链接到 /etc 目录。 ``` # mv /etc/krb6.conf /etc/krb5.conf.initial @@ -283,9 +283,9 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Configure Kerberos](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos.jpg) ][14] -配置 Kerberos +*配置 Kerberos* -15、同样,使用 samba 的 krb5.conf 配置文件验证 Kerberos 认证是否正常。通过以下命令来请求一个管理员账号的票据并且列出已缓存的票据信息。 +15、同样,使用 samba 的 **krb5.conf** 配置文件验证 Kerberos 认证是否正常。通过以下命令来请求一个管理员账号的票据并且列出已缓存的票据信息。 ``` # kinit administrator @@ -295,11 +295,11 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Verify Kerberos Authentication with Samba](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Kerberos-Authentication-with-Samba.jpg) ][15] -使用 Samba 验证 Kerberos 认证是否正常 +*使用 Samba 验证 Kerberos 认证是否正常* ### 第 4 步:验证其它域服务 -16、你首先要做的一个测试就是验证 Samba4 DC DNS 解析服务是否正常。要验证域环境中的 DNS 解析情况,使用 host 命令查询域名,或者加上其它一些重要的 AD DNS 记录进行查询,如下图所示: +16、你首先要做的一个测试就是验证 **Samba4 DC DNS** 解析服务是否正常。要验证域 DNS 解析情况,使用 host 命令,加上一些重要的 AD DNS 记录,进行域名查询,如下图所示: 每一次查询,DNS 服务器都应该返回两个 IP 地址。 @@ -312,7 +312,7 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Verify Samba4 DC DNS](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-DC-DNS.png) ][16] -验证 Samba4 DC DNS +*验证 Samba4 DC DNS * 17、这些 DNS 记录也可以从注册过的[已安装了 RSAT 工具的 Windows 机器][17]上查询到。打开 DNS 管理器,展开到你的域 tcp 记录,如下图所示: @@ -320,9 +320,9 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Verify DNS Records on Windows RSAT Tool](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-DNS-Records-on-Windows-RSAT-Tool.png) ][18] -通过 Windows RSAT 工具来验证 DNS 记录 +*通过 Windows RSAT 工具来验证 DNS 记录* -18、下一个验证是检查域 LDAP 同步是否正常。使用 samba-tool 工具,在第二个域控制器上创建一个主账号,然后检查该账号是否自动同步到第一个 Samba4 AD DC 服务器上。 +18、下一个验证是检查域 LDAP 复制同步是否正常。使用 **samba-tool** 工具,在第二个域控制器上创建一个账号,然后检查该账号是否自动同步到第一个 Samba4 AD DC 服务器上。 ##### On adc2: @@ -339,41 +339,41 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Create User Account on Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Create-User-Account-on-Samba4-AD.jpg) ][19] -在 Samba4 AD 服务器上创建主账号 +*在 Samba4 AD 服务器上创建账号* [ ![Verify Replication on Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Replication-on-Samba4-AD.jpg) ][20] -在 Samba4 AD 服务器上验证同步功能 +*在 Samba4 AD 服务器上验证同步功能* -19、你也可以从 Microsoft AD DC 控制台创建一个账号,然后验证该账号是否都出现在两个域控服务器上。 +19、你也可以从 **Microsoft AD DC** 控制台创建一个账号,然后验证该账号是否都出现在两个域控服务器上。 -默认情况下,这个账号都应该在两个 samba 域控制器上自动创建完成。在 'adc1' 服务器上使用 wbinfo 命令查询该账号的名字。 +默认情况下,这个账号都应该在两个 samba 域控制器上自动创建完成。在 `adc1` 服务器上使用 **wbinfo** 命令查询该账号名。 [ ![Create Account from Microsoft AD UC](http://www.tecmint.com/wp-content/uploads/2017/01/Create-Account-from-Microsoft-AD-UC.png) ][21] -从 Microsoft AD UC 创建账号 +*从 Microsoft AD UC 创建账号* [ ![Verify Account Replication On Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Account-Replication-On-Samba4-AD.png) ][22] -在 Samba4 AD 服务器上验证账号同步功能 +*在 Samba4 AD 服务器上验证账号同步功能* -20、实际上,打开 Windows 机器上的 AD DC 控制台,展开到域控制器,你应该看到两个已注册的 DC 服务器。 +20、实际上,打开 Windows 机器上的 **AD DC** 控制台,展开到域控制器,你应该看到两个已注册的 DC 服务器。 [ ![Verify Samba4 Domain Controllers](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-Domain-Controllers.png) ][23] -验证 Samba4 域控制器 +*验证 Samba4 域控制器* ### 第 5 步:启用 Samba4 AD DC 服务 -21、要启用 Samba4 AD DC 的服务 system-wide ,首先你得禁用原来的不需要的 Samba 服务,然后执行如下命令启用 samba-ad-dc 服务: +21、要在整个系统启用 Samba4 AD DC 的服务,首先你得禁用原来的不需要的 Samba 服务,然后执行如下命令仅启用 samba-ad-dc 服务: ``` # systemctl disable smbd nmbd winbind @@ -383,9 +383,9 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Enable Samba4 AD DC Services](http://www.tecmint.com/wp-content/uploads/2017/01/Enable-Samba4-AD-DC-Services.png) ][24] -启用 Samba4 AD DC 服务 +*启用 Samba4 AD DC 服务* -22、如果你从 Microsoft 客户端远程管理 Samba4 域控制器,或者有其它 Linux 或 Windows 机器集成到当前域中,请确保把其它机器网卡的 DNS 地址设置成 'adc2' 服务器的 IP 地址,以实现某种程序上的冗余。 +22、如果你从 Microsoft 客户端远程管理 Samba4 域控制器,或者有其它 Linux 或 Windows 客户机集成到当前域中,请确保在它们的网卡 DNS 服务器地址设置中提及 `adc2` 服务器的 IP 地址,以实现某种程序上的冗余。 下图显示 Windows 和 Debian/Ubuntu 客户机的网卡配置要求。 @@ -393,17 +393,17 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![Configure Client to Administer Samba4 DC](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Client-to-Administer-Samba4-DC.png) ][25] -配置 Windows 客户端来管理 Samba4 DC +*配置 Windows 客户端来管理 Samba4 DC* [ ![Configure Linux Client to Administer Samba4 DC](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Linux-Client-to-Administer-Samba4-DC.png) ][26] -配置 Linux 客户端来管理 Samba4 DC +*配置 Linux 客户端来管理 Samba4 DC* -假设第一台 DC 服务器 192.168.1.254 网络不通,则调整配置文件中 DNS 服务器 IP 地址的顺序,以防止优先查询这台不可用的 DNS 服务器。 +如果第一台 DC 服务器 192.168.1.254 网络不通,则调整配置文件中 DNS 服务器 IP 地址的顺序,以免先查询这台不可用的 DNS 服务器。 -最后,如果你想在 Linux 系统上使用 Samba4 活动目录账号来进行本地认证,或者为 AD LDAP 账号授予 root 权限,请查看[在 Linux 命令行下管理 Samba4 AD 架构][27] 这篇教程的 第 2 节和第 3 节。 +最后,如果你想在 Linux 系统上使用 Samba4 活动目录账号来进行本地认证,或者为 AD LDAP 账号授予 root 权限,请查看[在 Linux 命令行下管理 Samba4 AD 架构][27] 这篇教程的 第 2 步和第 3 步。 -------------------------------------------------------------------------------- @@ -412,13 +412,14 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ![](http://1.gravatar.com/avatar/7badddbc53297b2e8ed7011cf45df0c0?s=128&d=blank&r=g) 我叫 Ravi Saive,TecMint 网站博主。一个喜欢在网上分享技术知识及经验的电脑极客和 Linux 系统专家。我的大多数的服务器都运行在 Linux 开源平台上。关注我:Twitter ,Facebook 和 Google+ 。 + -------------------------------------------------------------------------------- via: http://www.tecmint.com/join-additional-ubuntu-dc-to-samba4-ad-dc-failover-replication/ 作者:[Ravi Saive][a] 译者:[rusking](https://github.com/rusking) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20170113 How to Encrypt Your Hard Disk in Ubuntu.md b/translated/tech/20170113 How to Encrypt Your Hard Disk in Ubuntu.md new file mode 100644 index 0000000000..57250281df --- /dev/null +++ b/translated/tech/20170113 How to Encrypt Your Hard Disk in Ubuntu.md @@ -0,0 +1,112 @@ +如何在 Ubuntu 中加密硬盘 +========================= + ![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/hdd-encryption-ubuntu.jpg "How to Encrypt Your Hard Disk in Ubuntus") + +隐私保护、安全和加密是不可分开的,用户可以通过加密来提高安全和保护操作系统的隐私信息。本文将会介绍在 Ubuntu Linux 中对硬盘全盘加密的优缺点。此外,我们也介绍如何在系统级别上进行加密设置,并对一些目录进行加密。加密是非常有用的,而且也没有你想象中那么复杂。综上所述,让我开始进行加密吧。 + +### 加密的优缺点 + +尽管进行全盘加密听起来非常棒,但是否要这么做还是有些争议的。我们先来看看这个做法有哪些优缺点。 + +#### 加密的优点 + +* 提高私密程度 +* 只有个拥有密钥的人才能访问操作系统及其中文件 +* 确保州政府或者黑客无法侦测你的系统和侵犯你的隐私 + +#### 加密的缺点 + +* 在其他的 Linux 操作系统上访问和挂载文件系统将变得困难 +* 无法从哪些加密分区中恢复数据 +* 如果用户丢失了加密密钥,那就彻底悲剧了 + +### 安装前的准备 + +在 Ubuntu 中加密最好就是在安装进程开始之前以系统级来进行。在 Ubuntu 安装进程开始之后是无法加密的,所以先备份你的重要数据到 [Dropbox][10], [Google Drive][11] (或者其他硬盘),然后后准备重新安装 Ubuntu。 + + ![ubuntu 下载](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-ubuntu-alternative-downloads.jpg "ubuntu-encrypt-ubuntu-alternative-downloads") + +从 [此处][12] 开始下载最新版本的 Ubuntu,并制作好可启动的 U 盘 (需要至少 2 GB 可用空间)。 + +制作启动 U 盘需要一个烧录程序,可以到 [etcher.io][13] 去下载。下载好之后解压 zip 文件,右击 (或者使用鼠标选定之后按下回车) 解压出来的文件以运行。 + + ![烧录程序](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-etcher.jpg "ubuntu-encrypt-etcher") + +**注意**:烧录程序会询问是否创建 icon 文件,选择“yes”。 + +在烧录程序中点击“选择镜像 (Select Image)”按钮,选择之前下载好的额 Ubuntu ISO 镜像。然后插入你的 U 盘。烧录程序会自动检测并为你选择。最后,点击“开始烧录 (“Flash)”按钮来开始创建进程。 + +完成之后,重启电脑至 BIOS,设置为 U 盘启动。 + +**注意**: 如果你的电脑不支持从 U 盘启动,下载 32 位的 Ubuntu,并使用你电脑中的烧录软件将其烧录到 DVD 中。 + +### 对你的硬盘进行全盘加密 + +加载好 Live Ubuntu 之后,安装进程就可以开始了。当 Ubuntu 安装进程开始之后,会出现下面这样一个界面。注意每个安装进程都可能不同的,并且可能指的是其另外的东西。 + + ![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-installation-type1.jpg "ubuntu-encrypt-installation-type") + +选择“檫除磁盘并安装Ubuntu (Erase disk and install Ubuntu)”,并选择“**加密新装的 Ubuntu 以提高安全程度(Encrypt the new Ubuntu installation for Security)**”来开始加密安装进程。这样会自动选择 LVM。两个选框都必须选中。选好加密选项之后,点击“现在安装 (Install Now)”。 + +**注意**:如果是双系统启动的话,你需要安装安装到空余磁盘空间,而非檫除磁盘。选择好之后,像上边一样选择加密选项。 + +选择加密选项并开始安装之后,会出现一个加密配置页面。这个页面用户需要为安装进程设置自己的加密密钥。 + + ![设置安全密码](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-choose-security-key.jpg "ubuntu-encrypt-choose-security-key") + +输入安全密钥。该安全密钥设置窗口会自动为你世输入的密钥进行密码强度评级,使用这个功能看着后边的显示,直到显示为“高强度密码 (strong password)”为止。输入完成后,在下方在此输入来确认密码,最后用一张把密码写下下来妥善保管。 + +此外,选定“覆些磁盘空余空间 (Overwrite empty disk space)”,当然这是一个可选步骤。一切准备就绪之后点击现在安装即可。 + + ![选择时区](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-timezone-select.jpg "ubuntu-encrypt-timezone-select") + +在设置完加密密钥之后,就是传统的 Ubuntu 安装配置了。选择时区、创建用户以及对应的安全密码。 + + ![加密家目录](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-home-folder-e1483900399596.jpg "ubuntu-encrypt-home-folder") + +与创建和加密 Ubuntu 磁盘对应,在创建用户的时记得候选择“需要密码登录系统 (require my password to log in)”和“加密我的家目录 (encrypt my home folder)”。这样可以为你的数据在增加一层保护。 + +等到用户名、加密设置以及其他所有事情都完成之后,Ubuntu 安装进程就可以开始了。随后,安装进程会告知你安装已完成,移除安装介质后重启即可享受 Ubuntu 之旅。 + +### 结论 + +进行磁盘加密之后,如果没有加密密钥则无法开启 Ubuntu。尽管无趣,但这种级别的加密使用最容易的,并且还充分利用了操作系统提供的特性。用户不需要过多的知识,或者使用其他第三方程序就可以很快完成加密要求。 + + ![加密电脑](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/ubuntu-encrypt-decrypt-computer.jpg "ubuntu-encrypt-decrypt-computer") + +加密之后的 Ubuntu,使用起来和没有加密的并没有什么区别。没有额外的跳转,也不需要学习什么复杂的解密方法。对于那些非常在意隐私但又不想太过麻烦的人来说,这个提高安全等级的方法是必须学会的 (PS. 当然,这很容易不是吗)。 + +你是否会使用 Ubuntu 对硬盘进行加密呢?在下方评论告诉我们。 + +--------------------------------- + +译者简介: + +![GHLandy](http://GHLandy.com/images/GHLandy.ico) + +[GHLandy](http://GHLandy.com) —— 欲得之,则为之奋斗 (If you want it, work for it.)。 + +----------------------------------- + +via: https://www.maketecheasier.com/encrypt-hard-disk-in-ubuntu/ + +作者:[Derrik Diener][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/derrikdiener/ +[1]:https://www.maketecheasier.com/author/derrikdiener/ +[2]:https://www.maketecheasier.com/encrypt-hard-disk-in-ubuntu/#comments +[3]:https://www.maketecheasier.com/category/linux-tips/ +[4]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fencrypt-hard-disk-in-ubuntu%2F +[5]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fencrypt-hard-disk-in-ubuntu%2F&text=How+to+Encrypt+Your+Hard+Disk+in+Ubuntu +[6]:mailto:?subject=How%20to%20Encrypt%20Your%20Hard%20Disk%20in%20Ubuntu&body=https%3A%2F%2Fwww.maketecheasier.com%2Fencrypt-hard-disk-in-ubuntu%2F +[7]:https://www.maketecheasier.com/why-is-iphone-overheating/ +[8]:https://www.maketecheasier.com/it-security-ethical-hacking-training/ +[9]:https://support.google.com/adsense/troubleshooter/1631343 +[10]:http://www.maketecheasier.com/tag/dropbox +[11]:http://www.maketecheasier.com/tag/google-drive +[12]:https://www.ubuntu.com/download/alternative-downloads +[13]:https://etcher.io/ diff --git a/translated/tech/20170113 How to Speed up Odoo copy.md b/translated/tech/20170113 How to Speed up Odoo copy.md new file mode 100644 index 0000000000..99c599ba39 --- /dev/null +++ b/translated/tech/20170113 How to Speed up Odoo copy.md @@ -0,0 +1,126 @@ +Odoo提速指南 +============================================================ + + ![speed up odoo](https://www.rosehosting.com/blog/wp-content/uploads/2016/12/speed-up-odoo.jpg) + +Odoo 是最流行的 ERP(企业资源计划)软件,它由 Python 编写,使用 PostgreSQL 作为后端数据库。Odoo 社区版是免费的开源软件,它囊括了项目管理,生产、财务、记账和销售管理,仓储管理,人力资源管理,甚至还有更多项目。里面包含了 30 个核心模块,以及超过 3000 个社区模块。Odoo 部署了大量的模块,数据库里也包含了庞大的数据等等,这些都使得这个软件比较复杂,可能会导致效率低下。Odoo 的两个主要瓶颈在于磁盘访问,以及数据库查询时间。 + +为了提升 Odoo 实例的性能,你可以: + +* 使用一个快速磁盘驱动器来存储(最好是 SSD)。 +* 使用[内存充足的 Linux VPS][1]。 +* 在 Odoo 中激活多重处理模式。 +* 正确配置并优化 PostgreSQL 服务。 + +### 获得一台有着更多内存的 SSD VPS + +正如我们先前提到的,随机磁盘访问速度时 Odoo 的主要瓶颈之一。因此,要确保 Odoo 部署在一台[基于 SSD 的 VPS][2] 上。由于 Odoo 是一个对资源十分敏感的应用,因此始终要把它安装在一台有着更多 RAM 的 VPS 上,如果可能,将整个 Odoo 实例及其数据库加载到 RAM 中。固态磁盘驱动器尤其以随机存取见长,而且由于 SSD 没有任何活动部件,它们能够取得数百倍于传统机械硬盘驱动器的随机存取 IOPS。如果服务器没有采用 SSD 来驱动或提速,那么不管你对 Odoo 做多少优化和配置都无济于事,它仍然会很慢。所以,获得正确的主机来部署 Odoo 是提升其性能的最重要因素。 + +跟大家提过 Odoo 是一个资源饥渴的应用有没有?貌似说过吧。但是不要担心,RoseHosting 将为你们提供一个终极解决方案——一台为性能而量身定做的 [Odoo SSD VPS][3],为匹配你的最大需求而优化。来,从我们这搞一台 SSD VPS 吧,你会发现什么才真的叫 Odoo 破纪录的速度。 + +其它 Odoo 优化包括: +### 在 Odoo 配置中启用多重处理选项 + +要实现此功能,请定位到 openerp 服务器二进制文件: +``` +#updatedb +#locate openerp-server + +/usr/bin/openerp-server +``` + +执行以下命令: + +``` +#/usr/bin/openerp-server --help +``` + +该命令的输出结果如下: + +``` +Usage: openerp-server [options] + +Options: + --version show program's version number and exit + + (...) + + Multiprocessing options: + --workers=WORKERS Specify the number of workers, 0 disable prefork mode. + --limit-memory-soft=LIMIT_MEMORY_SOFT + Maximum allowed virtual memory per worker, when + reached the worker be reset after the current request + (default 671088640 aka 640MB). + --limit-memory-hard=LIMIT_MEMORY_HARD + Maximum allowed virtual memory per worker, when + reached, any memory allocation will fail (default + 805306368 aka 768MB). + --limit-time-cpu=LIMIT_TIME_CPU + Maximum allowed CPU time per request (default 60). + --limit-time-real=LIMIT_TIME_REAL + Maximum allowed Real time per request (default 120). + --limit-request=LIMIT_REQUEST + Maximum number of request to be processed per worker + (default 8192). +``` + +工作进程的数量应该和分配到 VPS 的 CPU 核心数一样,或者,如果你想为 PostgreSQL 数据库,cron 任务,或者其它和 Odoo 实例安装在同一台 VPS 上的其它应用预留出一些 CPU 核心,那么你可以将工作进程数设置为一个比 VPS 上可用 CPU 核心更低的值,以避免资源耗尽。 + +limit-memory-soft 和 limit-memory-hard 参数不言自明,你可以使用默认值,也可以根据 VPS 上的实际可用 RAM 来进行修改。 + +例如,如果你的 VPS 有 8 个 CPU 核心,以及 16 GB 内存,那么你可以将工作进程数设置为 17(CPU 核心数 x 2 + 1),limit-memory-soft 总值设置为 be 640 x 17 = 10880 MB,而 limit-memory-hard 总数设置为 68MB x 17 = 13056 MB,这样,Odoo 就会有总计达 12.75 GB 的 RAM。 + +例如,在一台拥有 16 GB RAM 和 8 个 CPU 核心的 VPS 上,编辑 Odoo 配置文件(如 /etc/odoo-server.conf),并添加以下行: +``` +vi /etc/odoo-server.conf +``` + +``` +workers = 17 + +limit_memory_hard = 805306368 + +limit_memory_soft = 671088640 + +limit_request = 8192 + +limit_time_cpu = 60 + +limit_time_real = 120 + +max_cron_threads = 2 +``` +别忘了重启 Odoo 让修改生效。 + +### 正确配置并优化 PostgreSQL + +对于 PostgreSQL 优化,时刻将它更新到最新版本是一个不错的主意。在 PostgreSQL 配置文件(pg_hba.conf)中,有两个设置需要修改:shared_buffers 和 effective_cache_size。将 shared_buffers 设置为可用内存的 20%,effective_cache_size 设置为可用内存的 50%。 + +例如,如果 Odoo 安装到了一台 16 GB RAM 的 SSD VPS 上,那么在 pg_hba.conf 中使用如下设置: +``` +vi /var/lib/postgresql/data/pg_hba.conf +``` + +``` +shared_buffers = 3072MB +effective_cache_size = 8192MB +``` +重启 PostgreSQL 服务来让修改生效。 + +同时,也别忘了周期性手动执行‘[VACUUM][4]‘ 。‘Vacuuming’会将陈旧或临时数据清理干净,但请牢记,它会大量占用 CPU 和磁盘使用。 + +-------------------------------------------------------------------------------- + +via: https://www.rosehosting.com/blog/how-to-speed-up-odoo/ + +作者:[rosehosting.com][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.rosehosting.com/ +[1]:https://www.rosehosting.com/linux-vps-hosting.html +[2]:https://www.rosehosting.com/linux-vps-hosting.html +[3]:https://www.rosehosting.com/odoo-hosting.html +[4]:https://wiki.postgresql.org/wiki/Introduction_to_VACUUM,_ANALYZE,_EXPLAIN,_and_COUNT diff --git a/translated/tech/20170113 How to install a Ceph Storage Cluster on Ubuntu 16.04.md b/translated/tech/20170113 How to install a Ceph Storage Cluster on Ubuntu 16.04.md new file mode 100644 index 0000000000..6ca66be13a --- /dev/null +++ b/translated/tech/20170113 How to install a Ceph Storage Cluster on Ubuntu 16.04.md @@ -0,0 +1,555 @@ +如何在Ubuntu 16.04中安装 Ceph 存储集群 +============================================================ + +### 在此页 + +1. [第1步 - 配置所有节点][1] +2. [第2步 - 配置 SSH 服务器][2] +3. [第3步 - 配置 Ubuntu 防火墙][3] +4. [第4步 - 配置 Ceph OSD 节点][4] +5. [第5步 - 建立 Ceph 集群][5] +6. [第6步 - 测试 Ceph][6] +7. [参考][7] + +Ceph 是一个高性能,可靠行和可扩展性的开源存储平台。他是一个自由的分部署存储系统,提供了一个对象,块,文件级存储接口和缺少一个节点依然可以运行的特性。 + +在这个教程中,我将指导你在 Ubuntu 16.04 服务器上安装建立一个 Ceph 集群。Ceph 集群包括这些组件: + +* **Ceph OSDs (ceph-osd)** - 控制数据存储,数据复制和恢复。Ceph 集群需要至少两个 Ceph OSD 服务器。这次安装我们将使用三个 Ubuntu 16.04 服务器。 +* **Ceph Monitor (ceph-mon)** - 监控集群状态和运行的 OSD 映射 和 CRUSH 映射。这里我们使用一个服务器。 +* **Ceph Meta Data Server (ceph-mds)** - 如果你想把 Ceph 作为文件系统使用,就需要这个。 + +### **前提条件** + +* 6个安装了 Ubuntu 16.04 的服务器节点 +* 所有节点上的 root 权限 + +我将使用下面这些 hostname /IP 安装: + +``` +hostname IP address +ceph-admin 10.0.15.10 +mon1 10.0.15.11 +osd1 10.0.15.21 +osd2 10.0.15.22 +osd3 10.0.15.23 +client 10.0.15.15 +``` + +### 第1步 - 配置所有节点 + +这次安装,我将配置所有的6个节点来准备安装 Ceph 集群软件。所以你必须在所有节点运行下面的命令。然后确保所有节点都安装了 ssh-server。 + +**创建 Ceph 用户** + +在所有节点创建一个名为'**cephuser**'的新用户 + +``` +useradd -m -s /bin/bash cephuser +passwd cephuser +``` + +创建完新用户后,我们需要配置 **cephuser** 无密码 sudo 权限。这意味着 ‘cephuser’ 首次可以不输入密码执行和获取 sudo 权限。 + +运行下面的命令来完成配置。 + +``` +echo "cephuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephuser +chmod 0440 /etc/sudoers.d/cephuser +sed -i s'/Defaults requiretty/#Defaults requiretty'/g /etc/sudoers +``` + +**安装和配置 NTP** + +安装 NTP 来同步所有节点的日期和时间。运行 ntpdate 命令通过 NTP 设置日期。我们将使用 US 池 NTP 服务器。然后开启并使 NTP 服务在开机时启动。 + +``` +sudo apt-get install -y ntp ntpdate ntp-doc +ntpdate 0.us.pool.ntp.org +hwclock --systohc +systemctl enable ntp +systemctl start ntp +``` + +**安装 Open-vm-tools** + +如果你正在VMware里运行所有节点,你需要安装这个虚拟化工具。 + +``` +sudo apt-get install -y open-vm-tools +``` + +**安装 Python 和 parted** + +在这个教程,我们需要 python 包来建立 ceph 集群。安装 python 和 python-pip。 + +``` +sudo apt-get install -y python python-pip parted +``` + +**配置 Hosts 文件** + +用 vim 编辑器编辑所有节点的 hosts 文件。 + +``` +vim /etc/hosts +``` + +Paste the configuration below: + +``` +10.0.15.10 ceph-admin +10.0.15.11 mon1 +10.0.15.21 ceph-osd1 +10.0.15.22 ceph-osd2 +10.0.15.23 ceph-osd3 +10.0.15.15 ceph-client +``` + +保存 hosts 文件,然后退出 vim 编辑器。 + +现在你可以试着在两个服务器间 ping 主机名来测试网络连通性。 + +``` +ping -c 5 mon1 +``` + +[ + ![Ceph cluster Installation on Ubuntu 16.04](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/1.png) +][8] + +### 第2步 - 配置 SSH 服务器 + +这一步,我们将配置 **ceph-admin 节点**。管理节点是用来配置监控节点和 osd 节点的。登录到 ceph-admin 节点然后使用 '**cephuser**'。 + +``` +ssh root@ceph-admin +su - cephuser +``` + +管理节点用来安装配置所有集群节点,所以 ceph-admin 用户必须有不使用密码连接到所有节点的权限。我们需要为 'ceph-admin' 节点的 'cephuser' 用户配置无密码登录权限。 + +生成 '**cephuser**' 的 ssh 密钥。 + +``` +ssh-keygen +``` + +让密码为空 + +下面,为 ssh 创建一个配置文件 + +``` +vim ~/.ssh/config +``` + +Paste the configuration below: + +``` +Host ceph-admin + Hostname ceph-admin + User cephuser + +Host mon1 + Hostname mon1 + User cephuser + +Host ceph-osd1 + Hostname ceph-osd1 + User cephuser + +Host ceph-osd2 + Hostname ceph-osd2 + User cephuser + +Host ceph-osd3 + Hostname ceph-osd3 + User cephuser + +Host ceph-client + Hostname ceph-client + User cephuser +``` + +保存文件并退出 vim。 + +[ + ![Ceph-admin configuration](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/2.png) +][9] + +改变配置文件权限为644。 + +``` +chmod 644 ~/.ssh/config +``` + +现在使用 ssh-copy-id 命令增加密钥到所有节点。 + +``` +ssh-keyscan ceph-osd1 ceph-osd2 ceph-osd3 ceph-client mon1 >> ~/.ssh/known_hosts +ssh-copy-id ceph-osd1 +ssh-copy-id ceph-osd2 +ssh-copy-id ceph-osd3 +ssh-copy-id mon1 +``` + +当请求输入密码时输入你的 cephuser 密码。 + +[ + ![Ceph-admin deploy ssh key to all cluster nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/3.png) +][10] + +现在尝试从 ceph-admin 节点登录 osd1 服务器,测试无密登录是否正常。 + +``` +ssh ceph-osd1 +``` + +[ + ![SSH Less password from ceph-admin to all nodes cluster](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/4.png) +][11] + +### 第3步 - 配置 Ubuntu 防火墙 + +出于安全原因,我们需要在服务器打开防火墙。我们更愿使用 Ufw(不复杂的防火墙),Ubuntu 默认的防火墙,来保护系统。在这一步,我们在所有节点开启 ufw,然后打开 ceph-admin,ceph-mon 和 ceph-osd 需要使用的端口。 + +登录到 ceph-admin 节点,然后安装 ufw 包。 + +``` +ssh root@ceph-admin +sudo apt-get install -y ufw +``` + +打开 80,2003 和 4505-4506 端口,然后重载防火墙。 + +``` +sudo ufw allow 22/tcp +sudo ufw allow 80/tcp +sudo ufw allow 2003/tcp +sudo ufw allow 4505:4506/tcp +``` + +开启 ufw 并设置开机启动。 + +``` +sudo ufw enable +``` + +[ + ![UFW Firewall with Ceph service](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/5.png) +][12] + +从 ceph-admin 节点,登录到监控节点 'mon1' 然后安装 ufw。 + +``` +ssh mon1 +sudo apt-get install -y ufw +``` + +打开 ceph 监控节点的端口然后开启 ufw。 + +``` +sudo ufw allow 22/tcp +sudo ufw allow 6789/tcp +sudo ufw enable +``` + +最后,在每个 osd 节点:ceph-osd1,ceph-osd2 和 ceph-osd3 打开这些端口 6800-7300。 + +从 ceph-admin 登录到每个 ceph-osd 节点安装 ufw。 + +``` +ssh ceph-osd1 +sudo apt-get install -y ufw +``` + +在 osd 节点打开端口并重载防火墙。 + +``` +sudo ufw allow 22/tcp +sudo ufw allow 6800:7300/tcp +sudo ufw enable +``` + +ufw 防火墙配置完成。 + +### 第4步 - 配置 Ceph OSD 节点 + +这个教程里,我们有 3 个 OSD 节点,每个节点有两块硬盘分区。 + +1. **/dev/sda** for root partition +2. **/dev/sdb** is empty partition - 20GB + +我们要使用 **/dev/sdb** 作为 ceph 磁盘。从 ceph-admin 节点,登录到所有 OSD 节点,然后格式化 /dev/sdb 分区为 **XFS** 文件系统。 + +``` +ssh ceph-osd1 +ssh ceph-osd2 +ssh ceph-osd3 +``` + +使用 fdisk 命令检查分区表。 + +``` +sudo fdisk -l /dev/sdb +``` + +格式化 /dev/sdb 分区为 XFS 文件系统,使用 parted 命令创建一个 GPT 分区表。 + +``` +sudo parted -s /dev/sdb mklabel gpt mkpart primary xfs 0% 100% +``` + +下面,使用 mkfs 命令格式化分区为 XFS 格式。 + +``` +sudo mkfs.xfs -f /dev/sdb +``` + +现在检查分区,然后你会看见 XFS /dev/sdb 分区。 + +``` +sudo fdisk -s /dev/sdb +sudo blkid -o value -s TYPE /dev/sdb +``` + +[ + ![Format partition ceph OSD nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/6.png) +][13] + +### 第5步 - 创建 Ceph 集群 + +在这步,我们将从 ceph-admin 安装 Ceph 到所有节点。马上开始,登录到 ceph-admin 节点。 + +``` +ssh root@ceph-admin +su - cephuser +``` + +**在 ceph-admin 节点上安装 ceph-deploy** + +首先我们已经在系统上安装了 python 和 python-pip。现在我们需要从 pypi python 仓库安装 Ceph 部署工具 '**ceph-deploy**'。 + +Install ceph-deploy on the ceph-admin node with the pip command. +用 pip 命令在 ceph-admin 节点安装 ceph-deploy 。 + +``` +sudo pip install ceph-deploy +``` + +注意: 确保所有节点都已经更新. + +ceph-deploy 工具已经安装完毕后,为 Ceph 集群配置创建一个新目录。 + +**创建一个新集群** + +创建一个新集群目录。 + +``` +mkdir cluster +cd cluster/ +``` + +下一步,用 '**ceph-deploy**' 命令通过定义监控节点 '**mon1**' 创建一个新集群。 + +``` +ceph-deploy new mon1 +``` + +命令将在集群目录生成 Ceph 集群配置文件 'ceph.conf'。 + +[ + ![Generate new ceph cluster configuration](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/7.png) +][14] + +用 vim 编辑 ceph.conf。 + +``` +vim ceph.conf +``` + +在 [global] 块下,粘贴下面的配置。 + +``` +# Your network address +public network = 10.0.15.0/24 +osd pool default size = 2 +``` + +保存文件并推出编辑器。 + +**安装 Ceph 到所有节点** + +现在用一个命令从 ceph-admin 节点安装 Ceph 到所有节点。 + +``` +ceph-deploy install ceph-admin ceph-osd1 ceph-osd2 ceph-osd3 mon1 +``` + +命令将自动安装 Ceph 到所有节点:mon1,osd1-3 和 ceph-admin - 安装将花一些时间。 + +现在到 mon1 节点部署监控节点。 + +``` +ceph-deploy mon create-initial +``` + +命令将创建一个监控密钥,用 ceph 命令检查密钥。 + +``` +ceph-deploy gatherkeys mon1 +``` + +[ + ![Deploy key ceph](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/8.png) +][15] + +**增加 OSDS 到集群** + +在所有节点上安装了 Ceph 之后,现在我们可以增加 OSD 守护进程到集群。OSD 守护进程将在磁盘 /dev/sdb 分区上创建数据和日志 。 + +检查所有 osd 节点的 /dev/sdb 磁盘可用性。 + +``` +ceph-deploy disk list ceph-osd1 ceph-osd2 ceph-osd3 +``` + +[ + ![disk list of osd nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/9.png) +][16] + +你将看见我们之前创建 XFS 格式的 /dev/sdb。 + +下面,在所有节点用 zap 选项删除分区表。 + +``` +ceph-deploy disk zap ceph-osd1:/dev/sdb ceph-osd2:/dev/sdb ceph-osd3:/dev/sdb +``` + +这个命令将删除所有 Ceph OSD 节点的 /dev/sdb 上的数据。 + +现在准备所有 OSD 节点并确保结果没有报错。 + +``` +ceph-deploy osd prepare ceph-osd1:/dev/sdb ceph-osd2:/dev/sdb ceph-osd3:/dev/sdb +``` + +当你看到 ceph-osd1-3 结果已经准备好 OSD 使用,然后命令已经成功。 + +[ + ![Prepare the ceph-osd nodes](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/10.png) +][17] + +用下面的命令激活 OSD: + +``` +ceph-deploy osd activate ceph-osd1:/dev/sdb ceph-osd2:/dev/sdb ceph-osd3:/dev/sdb +``` + +现在你可以再一次检查 OSDS 节点的 sdb 磁盘。 + +``` +ceph-deploy disk list ceph-osd1 ceph-osd2 ceph-osd3 +``` + +[ + ![Ceph osds activated](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/11.png) +][18] + +结果是 /dev/sdb 现在已经分为两个区: + +1. **/dev/sdb1** - Ceph Data +2. **/dev/sdb2** - Ceph Journal + +或者你直接在 OSD 节点山检查。 + +``` +ssh ceph-osd1 +sudo fdisk -l /dev/sdb +``` + +[ + ![Ceph OSD nodes were created](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/12.png) +][19] + +接下来,部署管理密钥到所有关联节点。 + +``` +ceph-deploy admin ceph-admin mon1 ceph-osd1 ceph-osd2 ceph-osd3 +``` + +在所有节点运行下面的命令,改变密钥文件权限。 + +``` +sudo chmod 644 /etc/ceph/ceph.client.admin.keyring +``` + +Ceph 集群在 Ubuntu 16.04 已经创建完成。 + +### 第6步 - 测试 Ceph + +在第4步,我们已经安装并创建了一个新 Ceph 集群,然后添加了 OSDS 节点到集群。现在我们应该测试集群确保它如期工作。 + +从 ceph-admin 节点,登录到 Ceph 监控服务器 '**mon1**'。 + +``` +ssh mon1 +``` + +运行下面命令来检查集群健康。 + +``` +sudo ceph health +``` + +现在检查集群状态。 + +``` +sudo ceph -s +``` + +你可以看到下面返回结果: + +[ + ![Ceph Cluster Status](https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/13.png) +][20] + +确保 Ceph 健康是 **OK** 并且有一个监控节点 '**mon1**' IP 地址为 '**10.0.15.11**'。有 **3 OSD** 服务器都是 **up** 状态并且正在运行,可用磁盘空间为 **45GB** - 3x15GB Ceph 数据 OSD 分区。 + +我们在 Ubuntu 16.04 建立一个新 Ceph 集群成功。 + +### 参考 + + * http://docs.ceph.com/docs/jewel/ + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/ + +作者:[Muhammad Arul][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/ +[1]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-all-nodes +[2]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-the-ssh-server +[3]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-the-ubuntu-firewall +[4]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-configure-the-ceph-osd-nodes +[5]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-build-the-ceph-cluster +[6]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#step-testing-ceph +[7]:https://www.howtoforge.com/tutorial/how-to-install-a-ceph-cluster-on-ubuntu-16-04/#reference +[8]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/1.png +[9]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/2.png +[10]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/3.png +[11]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/4.png +[12]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/5.png +[13]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/6.png +[14]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/7.png +[15]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/8.png +[16]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/9.png +[17]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/10.png +[18]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/11.png +[19]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/12.png +[20]:https://www.howtoforge.com/images/how-to-install-a-ceph-cluster-on-ubuntu-16-04/big/13.png diff --git a/translated/tech/20170114 Build your own wiki on Ubuntu with DokuWiki.md b/translated/tech/20170114 Build your own wiki on Ubuntu with DokuWiki.md new file mode 100644 index 0000000000..94f5bd64f2 --- /dev/null +++ b/translated/tech/20170114 Build your own wiki on Ubuntu with DokuWiki.md @@ -0,0 +1,129 @@ +在 Ubuntu 上使用 DokuWiki 构建你自己的 wiki +============================================================ + + +我们在使用[DokuWiki][2],它是一个真棒的工具。我们团队有一个内部知识库,我们使用 DokuWiki 存储我们的所有评论,教程等。它很简单,并且易于安装和使用。在这篇文章中,我们将展示如何在 Ubuntu 16.04 服务器上安装 DokuWiki。 + +### 需求 + +DokuWiki 不需要太多,因为它不需要数据库。这里是 DokuWiki 的要求: + +* PHP 5.3.4 或更高版本(建议使用 PHP 7+) +* 一台 web 服务器(Apache/Nginx/任何其他) +* 一台 VPS。[买一台便宜的托管VPS][1],那么你就不必这样做了。你只需与支持团队联系,他们将会为您安装。 + +### 指导 + +在你开始之前,你应该升级你的系统。运行下面的命令: + +``` +sudo apt-get update && sudo apt-get upgrade +``` + +### 安装 Apache + +我们需要一台用于我们 wiki 的 web 服务器。我们在本教程中使用 Apache,但你也可以使用 Nginx 或任何其他 web 服务器。用下面的命令安装apache: + +``` +apt-get install apache2 +``` + +### 安装 PHP7 和模块 + +接下来,如果你还没有安装 PHP,你应该先安装 PHP。在本教程中,我们使用PHP7。所以请使用下面的命令安装 PHP7 和一些其他 PHP 模块: + +``` +apt-get install php7.0-fpm php7.0-cli php-apcu php7.0-gd php7.0-xml php7.0-curl php7.0-json php7.0-mcrypt php7.0-cgi php7.0 libapache2-mod-php7.0 +``` + +### 下载安装 DokuWiki + +下面就来到主要部分了 - 实际安装 DokuWiki。 + +首先,为你的 DokuWiki 创建一个目录: + +``` +mkdir -p /var/www/thrwiki +``` + +进入你刚才创建的目录: + +``` +cd /var/www/thrwiki +``` + +运行下面的命令来下载最新(稳定)的 DokuWiki: + +``` +wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz +``` + +解压 .tgz 文件: + +``` +tar xvf dokuwiki-stable.tgz +``` + +更改文件/文件夹权限: + +``` +www-data:www-data -R /var/www/thrwiki +chmod -R 707 /var/www/thrwiki +``` + +### 为 DokuWiki 配置 Apache + +为你的 DokuWiki 创建一个 .conf 文件(我们把它命名为 thrwiki.conf,但是你可以把它命名成任何你想要的),并用你喜欢的文本编辑器打开。我们使用 nano: + +``` +touch /etc/apache2/sites-available/thrwiki.conf +ln -s /etc/apache2/sites-available/thrwiki.conf /etc/apache2/sites-enabled/thrwiki.conf +nano /etc/apache2/sites-available/thrwiki.conf +``` + +下面是 thrwiki.conf 中的内容: + +``` + +ServerAdmin wikiadmin@thishosting.rocks +DocumentRoot /var/www/thrwiki/ +ServerName wiki.thishosting.rocks +ServerAlias www.wiki.thishosting.rocks + +Options FollowSymLinks +AllowOverride All +Order allow,deny +allow from all + +ErrorLog /var/log/apache2/wiki.thishosting.rocks-error_log +CustomLog /var/log/apache2/wiki.thishosting.rocks-access_log common + +``` + +编辑与你服务器相关的行。将 wikiadmin@thishosting.rocks、wiki.thishosting.rocks 替换成你自己的数据,重启 apache 使更改生效: + +``` +systemctl restart apache2.service +``` + +就是这样了。现在已经配置完成了。现在你可以继续通过前端页面 http://wiki.thishosting.rocks/install.php 安装配置 DokuWiki 了。安装完成后,你可以用下面的命令删除 install.php: + +``` +rm -f /var/www/html/thrwiki/install.php +``` + +如果你需要任何帮助,请随意留下评论。 + +-------------------------------------------------------------------------------- + +via: https://thishosting.rocks/build-your-own-wiki-on-ubuntu-with-dokuwiki/ + +作者:[thishostrocks.com][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://twitter.com/thishostrocks +[1]:https://thishosting.rocks/best-cheap-managed-vps/ +[2]:https://github.com/splitbrain/dokuwiki diff --git a/translated/tech/20170116 5 Essential Tips for Securing Your WordPress Sites.md b/translated/tech/20170116 5 Essential Tips for Securing Your WordPress Sites.md new file mode 100644 index 0000000000..6c27ef17cb --- /dev/null +++ b/translated/tech/20170116 5 Essential Tips for Securing Your WordPress Sites.md @@ -0,0 +1,60 @@ +5 个让你的 WordPress 站点安全的贴士 +============================================================ + + ![](https://www.rosehosting.com/blog/wp-content/uploads/2017/01/tips-for-securing-wp.jpg) + +WordPress 是迄今为止最流行的博客平台。 + +由于它的流行,它有它自己的优势和弱点。事实上,几乎每个人都使用它,使它更容易出现漏洞。因为新的缺陷被发现,WordPress 的开发人员正在不停地发布修复和补丁,但这并不意味着你可以简单地安装和忘记安装。 + +在这篇文章中,我们将提供一些最常见的保护和强化 WordPress 网站的方法。 + +### 在登录后台时总是使用 SSL + +不用说的是如果你并不只打算做一个随意的博客,你应该总是使用SSL。不使用加密连接登录到你的网站会暴露你的用户名和密码。目前任何人嗅探流量都可能会发现你的密码。如果你使用 WiFi 冲浪或者连接到一个公共热点,那么你会被黑客的机会更高,这是特别真实的。你可以从[这里][1]获取受信任的 SSL 证书。 + +### 对任何额外的插件挑剔 + +由第三方开发人员开发,每个插件的质量和安全性总是值得怀疑,并且它仅取决于其开发人员的经验。当安装任何额外的插件时,你应该仔细选择,并考虑其受欢迎程度以及插件的维护频率。应该避免维护不良的插件,因为它们更容易出现易于被利用的错误和漏洞。 + +此主题也是上一个关于 SSL 主题的补充,因为许多插件包含请求不安全(HTTP)连接的脚本。只要你的网站通过 HTTP 访问,一切似乎很好。但是,一旦你决定使用加密并强制使用 SSL 访问,则会立即导致网站损坏,因为当你使用 HTTPS 访问其他网站时,这些插件上的脚本将继续通过 HTTP 提供请求。 + +### 安装 Wordfence + +Wordfence 是由 Feedjit Inc. 开发的,Wordfence 是目前最流行的 WordPress 安全插件,并且是每个严肃的 WordPress 网站必备的,特别是那些使用[WooCommerce][2]或另一个 WordPress 电子商务平台的网站。 Wordfence 不只是一个插件,因为它提供了一系列的安全功能,它将加强您的网站。它具有 web 程序防火墙、恶意软件扫描程序、实时流量分析器和各种其他工具,它们可以提高你网站的安全性。防火墙将默认阻止恶意登录尝试,甚至可以配置为按照 IP 地址范围阻止整个国家/地区的访问。我们真正喜欢 Wordfence 的原因是,即使你的网站因为某些原因被危害,例如恶意脚本,Wordfence 可以在安装以后扫描和清理你的网站从被感染的文件。 + +公司提供插件的免费和付费订阅计划,但即使是免费计划,你的网站仍将获得令人满意的水平。 + +### 用额外的密码锁住 /wp-admin 和 /wp-login.php + +保护你的 WordPress 后端的另一个步骤是使用额外的密码保护任何除了你以外不打算让任何人使用的目录(读取URL)。 /wp-admin 目录已经在此关键目录列表中。 如果你不允许普通用户登录 WordPress,你应该使用其他密码限制 wp.login.php 文件。无论是使用 [Apache][3] 还是 [Nginx][4],你都可以访问这两篇文章,了解如何额外保护 WordPress 安装。 + +### 禁用/停止用户枚举 + +这是攻击者发现你网站上的有效用户名的一种相当简单的方法(阅读找出管理员用户名)。那么它是如何工作的?这很简单。在任何 WordPress 站点上的主要 URL 后面跟上 /?author=1 。 例如:wordpressexample.com/?author=1 + +要保护您的网站免受此影响,只需安装[停止用户枚举][5]插件。 + +### 禁用 XML-RPC + +RPC 代表远程过程调用,它可以用来从位于网络上另一台计算机上的程序请求服务的协议。在 WordPress 方面,XML-RPC 允许你使用流行的网络日志客户端(如Windows Live Writer)在你的 WordPress 博客上发布文章,但如果你使用 WordPress 移动应用程序那么也需要它。 XML-RPC 在早期版本中被禁用,但是从 WordPress 3.5 时它被默认启用,这让你的网站有更大的攻击面。虽然各种安全研究人员建议这不是一个大问题,如果你不打算使用网络博客客户端或 WP 移动应用程序,你应该禁用XML-RPC服务。 + +有多种方法可以做到这一点,最简单的是安装[禁用 XML-RPC][6]插件。 + +-------------------------------------------------------------------------------- + +via: https://www.rosehosting.com/blog/5-tips-for-securing-your-wordpress-sites/ + +作者:[rosehosting.com][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:rosehosting.com +[1]:https://www.rosehosting.com/ssl-certificates.html +[2]:https://www.rosehosting.com/woocommerce-hosting.html +[3]:https://www.rosehosting.com/blog/password-protect-a-directory-using-htaccess/ +[4]:https://www.rosehosting.com/blog/password-protecting-directories-with-nginx/ +[5]:https://wordpress.org/plugins/stop-user-enumeration/ +[6]:https://wordpress.org/plugins/disable-xml-rpc/ diff --git a/translated/tech/20170116 How to debug C programs in Linux using gdb.md b/translated/tech/20170116 How to debug C programs in Linux using gdb.md new file mode 100644 index 0000000000..1764998779 --- /dev/null +++ b/translated/tech/20170116 How to debug C programs in Linux using gdb.md @@ -0,0 +1,199 @@ +在 Linux 中如何使用 gdb 调试 C 程序 +============================================================ + +### 内容介绍 + +1. [GDB 调试器基础][1] +2. [GDB 调试器用例][2] +3. [总结][3] + +无论多么有经验的程序员,开发的任何软件都不可能完全没有 bug。因此,排查及修复 bug 成为软件开发周期中最重要的任务之一。有许多办法可以排查 bug(测试、代码自审等等),但是还有一些专用软件(称为调试器)可以帮助准确定位问题的所在,以便进行修复。 + +如果你是 C/C++ 程序员,或者使用 Fortran 和 Modula-2 编程语言开发软件,那么你将会很乐意知道有这么一款优秀的调试器 -[GDB][4]- 可以帮你更轻松地调试代码 bug 以及其它问题。在这篇文章中,我们将讨论一下 GDB 调试器的基础知识,包括它提供的一些有用的功能/选项。 + +在我们开始之前,值得一提的是,文章中的所有说明和示例都已经在 Ubuntu 14.04LTS 中测试过。教程中的示例代码都是 C 语言写的;使用的 shell 为 bash(4.3.11);GDB 版本为 7.7.1。 + +### GDB 调试器基础 + +通俗的讲,GDB 可以让你看到程序在执行过程时的内部流程,并帮你明确问题的所在。我们将在下一节通过一个有效的示例来讨论 GDB 调试器的用法,但在此之前,我们先来探讨一些之后对你有帮助的基本要点。 + +首先,为了能够顺利使用类似 GDB 这样的调试器,你必须以指定的方式编译程序,让编译器产生调试器所需的调试信息。例如,在使用 gcc 编译器(我们将在本教程之后的章节用它来编译 C 程序示例)编译代码的时候,你需要使用 -g 命令行选项。 + +想要了解 gcc 编译器手册页中关于 -g 命令行选项相关的内容,请看[这里][5]。 + +下一步,确保在你的系统中已经安装 GDB 调试器。如果没有安装,而且你使用的是基于 Debian 的系统(如 Ubuntu),那么你就可以使用以下命令轻松安装该工具: + +``` +sudo apt-get install gdb +``` + +在其他发行版上的安装方法,请看[这里][6]。 + +现在,当你按照上述的方式编译完程序(gcc -g 命令行选项),同时也已经安装好 GDB 调试器,那么你就可以使用以下命令让程序在调试模式中运行: + +``` +gdb [prog-executable-name] +``` + +这样做会初始化 GDB 调试器,但你的可执行程序此时还不会被启动。在这个时候你就可以定义调试相关的设置。例如,你可以在特定行或函数中设置一个断点让 GDB 暂停程序的执行。 + +接着,为了启动你的程序,你必须执行以下 gdb 命令: + +``` +run +``` + +在这里,值得一提的是,如果你的程序需要一些命令行参数,那么你可以在这里指定这些参数。例如: + +``` +run [arguments] +``` + +GDB 提供了很多有用的命令,在调试的时候总是能派的上用场。我们将在下一节讨论其中一部分命令。 + +### GDB 调试器用例 + +现在我们对 GDB 及其用法有了基本的概念。因此,让我们举例来应用所学的知识。这是一段示例代码: + +``` +#include + +int main() +{ + int out = 0, tot = 0, cnt = 0; + int val[] = {5, 54, 76, 91, 35, 27, 45, 15, 99, 0}; + + while(cnt < 10) + { + out = val[cnt]; + tot = tot + 0xffffffff/out; + cnt++; + } + + printf("\n Total = [%d]\n", tot); + return 0; +} +``` + +简单说明一下这段代码要做什么事。获取 `val` 数组中每一个值,将其赋值给 `out` 变量,然后将 tot 之前的值与 `0xffffffff/out` 的结果值累加,赋值给 `tot` 变量。 + +这里遇到的问题是,当执行这段代码编译后的可执行程序时,产生以下错误: + +``` +$ ./gdb-test  +Floating point exception (core dumped) +``` + +因此,要调试这段代码,第一步是使用 -g 选项编译程序。命令如下: + +``` +gcc -g -Wall gdb-test.c -o gdb-test +``` + +接着,让我们运行 GDB 调试器并指定要调试的可执行程序。命令如下: + +``` +gdb ./gdb-test  +``` + +现在,我刚才得到的错误是 `Floating point exception`,大部分人可能已经知道,这是因为 n % x,当 x 为 0 时导致的错误。所以,考虑到这一点,我在 11 行代码除法运算的位置处添加了一个断点。如下: + +``` +(gdb) **break 11** +``` + +注意 `(gdb)` 是调试器的提示信息,我只输入了 `break 11` 命令。 + +现在,让 GDB 开始运行程序: + +``` +run +``` + +当断点第一次被命中时,GDB 显示如下输出: + +``` +Breakpoint 1, main () at gdb-test.c:11 +11 tot = tot + 0xffffffff/out; +(gdb) +``` + +正如你所看到的那样,调试器会显示断点所在的行代码。现在,让我们打印出此时 `out` 的值。如下: + +``` +(gdb)** print out** +**$1 = 5** +(gdb) +``` + +如上所示,值 `5` 被打印出来了。这个时候一切都还是正常的。让调试器继续执行程序直到命中下一个断点,可以通过使用 `c` 命令来完成: + +``` +c   +``` + +重复上述操作,直到 `out` 值变为 0 时。 + +``` +... +... +... +Breakpoint 1, main () at gdb-test.c:11 +11 tot = tot + 0xffffffff/out; +(gdb) print out +$2 = 99 +(gdb) c +Continuing. + +Breakpoint 1, main () at gdb-test.c:11 +11 tot = tot + 0xffffffff/out; +(gdb) print out +$3 = 0 +(gdb) +``` + +现在,为了进一步确认问题,我使用 GDB 的 `s`(或 `step`) 命令代替 `c` 命令。因为,我只想让当前程序在第 11 行之后暂停,再一步步执行,看看这个时候是否会发生崩溃。 + +以下是执行之后输出信息: + +``` +(gdb) s + +Program received signal SIGFPE, Arithmetic exception. +0x080484aa in main () at gdb-test.c:11 +11 tot = tot + 0xffffffff/out; +``` + +是的,如上高亮输出的内容所示,这就是抛出异常的地方。当我再次尝试运行 `s` 命令时,问题最终也得到了确认: + +``` +(gdb) s + +Program terminated with signal SIGFPE, Arithmetic exception. +The program no longer exists. +``` + +通过这种方式,你就可以使用 GDB 调试你的程序。 + +### 总结 + +GDB 提供了很多功能供用户研究和使用,在这里,我们仅仅只介绍了很少一部分内容。通过 GDB 的手册页进一步了解这个工具,当你在调试代码的时候,尝试使用一下它。GDB 调试器有一定的学习难度,但是它很值得你下功夫学习。 + + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-debug-c-programs-in-linux-using-gdb/ + +作者:[Ansh][a] +译者:[zhb127](https://github.com/zhb127) +校对:[jasminepeng](https://github.com/jasminepeng) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/how-to-debug-c-programs-in-linux-using-gdb/ +[1]:https://www.howtoforge.com/tutorial/how-to-debug-c-programs-in-linux-using-gdb/#gdb-debugger-basics +[2]:https://www.howtoforge.com/tutorial/how-to-debug-c-programs-in-linux-using-gdb/#gdb-usage-example +[3]:https://www.howtoforge.com/tutorial/how-to-debug-c-programs-in-linux-using-gdb/#conclusion +[4]:https://www.sourceware.org/gdb/ +[5]:https://linux.die.net/man/1/gcc +[6]:https://www.sourceware.org/gdb/download/ diff --git a/translated/tech/20170116 Use Docker remotely on Atomic Host.md b/translated/tech/20170116 Use Docker remotely on Atomic Host.md new file mode 100644 index 0000000000..114aa07bd9 --- /dev/null +++ b/translated/tech/20170116 Use Docker remotely on Atomic Host.md @@ -0,0 +1,170 @@ +[远程在 Atomic 主机上使用 Docker][1] +--------------------- + + ![remote-atomic-docker](https://cdn.fedoramagazine.org/wp-content/uploads/2017/01/remote-atomic-docker-945x400.jpg) + +来自 [Atomic 项目][2] 的 Atomic 主机是一个基于轻量级容器的操作系统,它可以运行 Linux 容器。它已被优化为用作云环境的容器运行时系统。例如,它可以托管 Docker 守护进程和容器。有时,你可能需要在该主机上运行 docker 命令,并从其他地方管理服务器。本文介绍如何远程访问 Fedora Atomic 主机上的[Docker][3]守护进程,[你可以在这里下载到它][4]。整个过程由[Ansible][5]自动完成 - 在涉及到自动化的一切上,这是一个伟大的工具。 + +### 一份安全笔记 + +由于我们通过网络连接,所以我们使用[TLS][6]保护 Docker 守护进程。此过程需要客户端证书和服务器证书。OpenSSL 包用于创建用于建立 TLS 连接的证书密钥。这里,Atomic 主机运行守护程序,我们的本地的 [Fedora Workstation][7] 充当客户端。 + +在你按照这些步骤进行之前,请注意,_任何_在客户端上可以访问 TLS 证书的进程在服务器上具有**完全根访问权限。** 因此,客户端可以在服务器上做任何它想做的事情。因此,我们需要仅向可信任的特定客户端主机授予证书访问权限。你应该将客户端证书仅复制到完全由你控制的客户端主机。即使在这种情况下,客户端机器的安全也至关重要。 + +但是,此方法只是远程访问守护程序的一种方法。编排工具通常提供更安全的控制。下面的简单方法适用于个人实验,但可能不适合开放式网络。 + +### 获取 Ansible role + +[Chris Houseknecht][8] 写了一个 Ansible role,它会创造所需的所有证书。这样,你不需要手动运行 _openssl_ 命令了。 这些在[ Ansible role 仓库][9]中提供。将它克隆到你当前的工作主机。 + +``` +$ mkdir docker-remote-access +$ cd docker-remote-access +$ git clone https://github.com/ansible/role-secure-docker-daemon.git +``` + +### 创建配置文件 + +接下来,你必须创建 Ansible 配置文件、inventory 和 playbook 文件以设置客户端和守护进程。以下说明在 Atomic 主机上创建客户端和服务器证书。然后,获取客户端证书到本地。最后,它们会配置守护进程以及客户端,使它们能彼此交互。 + +这里是你需要的目录结构。如下所示,创建下面的每个文件。 + +``` +$ tree docker-remote-access/ +docker-remote-access/ +├── ansible.cfg +├── inventory +├── remote-access.yml +└── role-secure-docker-daemon +``` + +### _ansible.cfg_ + +``` + $ vim ansible.cfg +[defaults] +inventory=inventory +``` + +### _inventory_ + +``` + $ vim inventory +[daemonhost] +'IP_OF_ATOMIC_HOST' ansible_ssh_private_key_file='PRIVATE_KEY_FILE' +``` + +将 inventory 中的 _IP_OF_ATOMIC_HOST_ 替换为 Atomic 主机的 IP。将 _PRIVATE_KEY_FILE_ 替换为本地系统上的 SSH 私钥文件的位置。 + +### _remote-access.yml_ + +``` +$ vim remote-access.yml +--- +- name: Docker Client Set up + hosts: daemonhost + gather_facts: no + tasks: + - name: Make ~/.docker directory for docker certs + local_action: file path='~/.docker' state='directory' + + - name: Add Environment variables to ~/.bashrc + local_action: lineinfile dest='~/.bashrc' line='export DOCKER_TLS_VERIFY=1\nexport DOCKER_CERT_PATH=~/.docker/\nexport DOCKER_HOST=tcp://{{ inventory_hostname }}:2376\n' state='present' + + - name: Source ~/.bashrc file + local_action: shell source ~/.bashrc + +- name: Docker Daemon Set up + hosts: daemonhost + gather_facts: no + remote_user: fedora + become: yes + become_method: sudo + become_user: root + roles: + - role: role-secure-docker-daemon + dds_host: "{{ inventory_hostname }}" + dds_server_cert_path: /etc/docker + dds_restart_docker: no + tasks: + - name: fetch ca.pem from daemon host + fetch: + src: /root/.docker/ca.pem + dest: ~/.docker/ + fail_on_missing: yes + flat: yes + - name: fetch cert.pem from daemon host + fetch: + src: /root/.docker/cert.pem + dest: ~/.docker/ + fail_on_missing: yes + flat: yes + - name: fetch key.pem from daemon host + fetch: + src: /root/.docker/key.pem + dest: ~/.docker/ + fail_on_missing: yes + flat: yes + - name: Remove Environment variable OPTIONS from /etc/sysconfig/docker + lineinfile: + dest: /etc/sysconfig/docker + regexp: '^OPTIONS' + state: absent + + - name: Modify Environment variable OPTIONS in /etc/sysconfig/docker + lineinfile: + dest: /etc/sysconfig/docker + line: "OPTIONS='--selinux-enabled --log-driver=journald --tlsverify --tlscacert=/etc/docker/ca.pem --tlscert=/etc/docker/server-cert.pem --tlskey=/etc/docker/server-key.pem -H=0.0.0.0:2376 -H=unix:///var/run/docker.sock'" + state: present + + - name: Remove client certs from daemon host + file: + path: /root/.docker + state: absent + + - name: Reload Docker daemon + command: systemctl daemon-reload + - name: Restart Docker daemon + command: systemctl restart docker.service +``` + +### 访问 Atomic 主机 + +现在运行 Ansible playbook: + +``` +$ ansible-playbook remote-access.yml +``` + +确保 tcp 端口 2376 在你的 Atomic 主机上打开了。如果你在使用 Openstack,请在安全规则中添加 TCP 端口 2376。 如果你使用 AWS,请将其添加到你的安全组。 + +现在,在你的工作站上作为普通用户运行的 _docker_ 命令与 Atomic 主机的守护进程通信了,并在那里执行命令。你不需要手动 _ssh_ 或在 Atomic 主机上发出命令。这允许你远程、轻松、安全地启动容器化应用程序。 + +如果你想克隆 playbook 和配置文件,这里有[一个可用的 git 仓库][10]。 + +[ + ![docker-daemon](https://cdn.fedoramagazine.org/wp-content/uploads/2017/01/docker-daemon.jpg) +][11] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-docker-remotely-atomic-host/ + +作者:[Trishna Guha][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://trishnag.id.fedoraproject.org/ +[1]:https://fedoramagazine.org/use-docker-remotely-atomic-host/ +[2]:http://www.projectatomic.io/ +[3]:https://www.docker.com/ +[4]:https://getfedora.org/atomic/ +[5]:https://www.ansible.com/ +[6]:https://en.wikipedia.org/wiki/Transport_Layer_Security +[7]:https://getfedora.org/en/workstation/ +[8]:https://twitter.com/CHouseknecht +[9]:https://github.com/ansible/role-secure-docker-daemon +[10]:https://github.com/trishnaguha/fedora-cloud-ansible/tree/master/docker-remote-access +[11]:https://cdn.fedoramagazine.org/wp-content/uploads/2017/01/docker-daemon.jpg diff --git a/translated/tech/20170117 5 of the Best Places to Find DEBs Packages for Debian-Based Linux Distros.md b/translated/tech/20170117 5 of the Best Places to Find DEBs Packages for Debian-Based Linux Distros.md new file mode 100644 index 0000000000..7fbee261dc --- /dev/null +++ b/translated/tech/20170117 5 of the Best Places to Find DEBs Packages for Debian-Based Linux Distros.md @@ -0,0 +1,75 @@ +5 个在基于 Debian 的 Linux 发行版上找到 deb 软件包的方法 +============================================================ + ![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/deb-packages.jpg "5 of the Best Places to Find DEBs Packages for Debian-Based Linux Distross") + + +基于 Debian 的 Linux 发行版上有一个问题:为用户提供高级软件选择。当涉及到为 Linux 制作软件时,所有的大公司都首先瞄准这种类型的 Linux 发行版。通常一些开发人员甚至不打算为其他类型的 Linux 发行版做并且_只_做 DEB 包。 + +然而,只是因为许多开发人员针对这些类型的 Linux 发行版并不意味着用户从来没有遇到寻找软件的问题。大多数 Debian 和 Ubuntu 用户会自己在互联网上搜索 DEB 包。 + +因此,我们决定写一篇文章,它涵盖了五个最好的网站以找到基于 Debian 的 Linux 发行版的 DEB 软件包。 这样用户就能够更容易地找到他们需要的软件,而不是浪费时间在互联网上搜索。 + +### 1\. Launchpad + +[Launchpad][11]是互联网上最大的基于 Debian 的软件包仓库。 为什么? 这是 PPA 所在的地方!Canonical 创建了这个服务,所以任何开发商(大的或小的)都可以使用它,并且轻松地将其软件包分发给 Ubuntu 用户。 + +不幸的是,并不是所有基于 Debian 的 Linux 发行版都是 Ubuntu。但是,只是因为你的 Linux 发行版不使用 PPA 并不意味着此服务是无用的。Launchpad 使得很有可能直接下载任何 Debian 软件包进行安装。 + + ![debian-packages-launchpad](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/debian-packages-launchpad.jpg "debian-packages-launchpad") + +### 2\. Pkgs.org + +除了 Launchpad,[Pkgs.org][12]可能是互联网上查找 Debian 软件包的最大的地方。如果一个 Linux 用户需要一个 deb,并且不能在它的发布包的软件包仓库中找到它,它很可能在这个网站上找到。 + + ![debian-packages-pkgs-org](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/debian-packages-pkgs-org.jpg "debian-packages-pkgs-org") + +### 3\. Getdeb + +Getdeb][13] 是一个特定于 Ubuntu 的项目,它托管最新的 Ubuntu 版本的软件。这使它成为一个找 Debian 包很好的地方。特别是如果用户是在 Ubuntu、Linux Mint、Elementary OS和其他许多基于 Ubuntu 的 Linux 发行版上。此外,这些软件包甚至可以在 Debian 上工作! + + ![debian-packages-get-deb](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/debian-packages-get-deb.jpg "debian-packages-get-deb") + +### 4\. RPM Seek + +即使[这个网站][14]声称是 “Linux RPM 包搜索引擎”,奇怪的是,它也可以搜索 DEB 包。如果你试图找到一个特定的 DEB 包,并且在其他地方都找过了,再检查下 RPM Seek 或许是一个好主意,因为它可能有你所需要的。 + + ![debian-packages-rpm-seek](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/debian-packages-rpm-seek.jpg "debian-packages-rpm-seek") + +### 5\. Open Suse Software + +[Open SUSE 构建服务][15]是 Linux 上最知名的软件构建工具之一。有了它,开发人员可以轻松地获取他们的代码,并为许多不同的 Linux 发行版打包。因此,OSB 的包搜索允许用户下载 DEB 文件。 + +更有趣的是,许多开发人员选择使用 OSB 分发他们的软件,因为它可以轻松地生成 RPM、DEB等。如果用户急切需要 DEB,Open SUSE Build 的服务很值得去看下。 + + ![debian-packages-opensuse-build](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/01/debian-packages-opensuse-build.jpg "debian-packages-opensuse-build") + +### 总结 + +寻找 Linux 发行版的包可能是乏味的,有时令人沮丧。这就是为什么很高兴了解到有基于 Debian 的 Linux 发行版的用户可以访问获得他们需要的软件的网站。 + +-------------------------------------------------------------------------------- + +via: https://www.maketecheasier.com/best-places-find-debs-packages/ + +作者:[Derrik Diener][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.maketecheasier.com/author/derrikdiener/ +[1]:https://www.maketecheasier.com/author/derrikdiener/ +[2]:https://www.maketecheasier.com/best-places-find-debs-packages/#comments +[3]:https://www.maketecheasier.com/category/linux-tips/ +[4]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Fbest-places-find-debs-packages%2F +[5]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Fbest-places-find-debs-packages%2F&text=5+of+the+Best+Places+to+Find+DEBs+Packages+for+Debian-Based+Linux+Distros +[6]:mailto:?subject=5%20of%20the%20Best%20Places%20to%20Find%20DEBs%20Packages%20for%20Debian-Based%20Linux%20Distros&body=https%3A%2F%2Fwww.maketecheasier.com%2Fbest-places-find-debs-packages%2F +[7]:https://www.maketecheasier.com/add-paypal-wordpress/ +[8]:https://www.maketecheasier.com/keep-kids-videos-out-youtube-history/ +[9]:https://support.google.com/adsense/troubleshooter/1631343 +[10]:https://www.maketecheasier.com/find-rpms-for-redhat-based-distros/ +[11]:https://launchpad.net/ +[12]:https://pkgs.org/ +[13]:http://www.getdeb.net/welcome/ +[14]:http://www.rpmseek.com/index.html +[15]:https://build.opensuse.org/ diff --git a/translated/tech/20170118 Linux command line navigation tips: the basics of pushd and popd commands.md b/translated/tech/20170118 Linux command line navigation tips: the basics of pushd and popd commands.md new file mode 100644 index 0000000000..3ffb356b4c --- /dev/null +++ b/translated/tech/20170118 Linux command line navigation tips: the basics of pushd and popd commands.md @@ -0,0 +1,144 @@ +Linux 命令行导航贴士:pushd 和 popd 命令基础 +============================================================ + +### 在本篇中 + +1. [pushd 和 popd 命令基础][1] +2. [一些高级用法][2] +3. [总结][3] + +在本系列的[第一部分][4]中,我们通过讨论 **cd -** 命令的用法,重点介绍了 Linux 中的命令行导航。还讨论了一些其他相关要点/概念。现在进一步讨论,在本文中,我们将讨论如何使用 pushd 和 popd 命令在 Linux 命令行上获得更快的导航体验。 + +在我们开始之前,值得分享的一点是,此后提到的所有指导和命令已经在 Ubuntu 14.04 和 Bash shell(4.3.11)上测试过。 + +### pushd 和 popd 命令基础 + +为了更好地理解 pushd 和 popd 命令的作用,让我们先讨论堆栈的概念。想象一下你厨房案板上的一个空白区域,现在想象一下你想在上面放一套盘子。你会怎么做?很简单,一个接一个地放在上面。 + +所以在整个过程的最后,案板上的第一个盘子是盘子中的最后一个,你手中最后一个盘子是盘子堆中的第一个。现在当你需要一个盘子时,你选择在堆的顶部使用它,然后在下次需要时选择下一个。 + +pushd 和 popd 命令是类似的概念。在Linux系统上有一个目录堆栈,你可以堆叠目录路径以供将来使用。你可以使用 **dirs** 命令来在任何时间点快速查看堆栈的内容。 + +下面的例子显示了在命令行终端启动后立即在我的系统上使用 dirs 命令的输出: + +$ dirs +~ + +输出中的波浪号(〜)表示目录堆栈当前仅包含用户的主目录。 + +继续下去,使用 pushd 和 popd 命令来执行存储目录路径并删除它的操作。使用 pushd 非常容易 - 只需将要存储在目录堆栈中的路径作为此命令的参数传递。这里有一个例子: + +pushd /home/himanshu/Downloads/ + +上述命令的作用是,将当前工作目录更改为你作为参数传递的目录,并且还将路径添加到目录堆栈中。为了方便用户,pushd 命令在其输出中产生目录堆栈的内容。因此,当运行上面的命令时,产生了以下输出: + +``` +~/Downloads ~ +``` + +输出显示现在堆栈中有两个目录路径:一个是用户的主目录,还有用户的下载目录。它们的保存顺序是:主目录位于底部,新添加的 Downloads 目录位于其上。 + +要验证 pushd 的输出是正确的,你还可以使用dirs命令: + +$ dirs +~/Downloads ~ + +因此你可以看到 dirs 命令同样产生相同的输出。 + +让我们再使用下 pushd 命令: + +$ pushd /usr/lib/; pushd /home/himanshu/Desktop/ +/usr/lib ~/Downloads ~ +~/Desktop /usr/lib ~/Downloads ~ + +所以目录堆栈现在包含总共四个目录路径,其中主目录(〜)在底部,并且用户的桌面目录在顶部。 + +一定要记住的是堆栈的头是你当前的目录。这意味着现在我们当前的工作目录是 ~/Desktop。 + +现在,假设你想回到 /usr/lib 目录,所以你所要做的就是执行 popd 命令: + +$ popd +/usr/lib ~/Downloads ~ + +popd 命令不仅会将当前目录切换到 /usr/lib,它还会从目录堆栈中删除 ~/Desktop,这一点可以从命令输出中看出。这样,popd 命令将允许你以相反的顺序浏览这些目录。 + +### 一些高级用法 + +现在我们已经讨论了 pushd 和 popd 命令的基础知识,让我们继续讨论与这些命令相关的一些其他细节。首先,这些命令还允许你操作目录堆栈。例如,假设你的目录堆栈看起来像这样: + +$ dirs +~/Desktop /usr/lib ~ ~/Downloads + +现在,我们的要求是改变堆栈中目录路径的顺序,最上面的元素(~/Desktop)放到底部,剩下的每个都向上移动一个位置。这可以使用以下命令实现: + +pushd +1 + +这里是上面的命令对目录堆栈做的: + +$ dirs +/usr/lib ~ ~/Downloads ~/Desktop + +因此,我们看到目录堆栈中的元素顺序已经改变,并且现在和我们想要的一样。当然,你可以让目录堆栈元素移动任何次数。例如,以下命令会将它们向上移动两次: + +$ pushd +2 +~/Downloads ~/Desktop /usr/lib ~ + +你也可以使用负的索引值: + +$ pushd -1 +/usr/lib ~ ~/Downloads ~/Desktop + +相似地,你可以在 popd 命令中使用此技术来从目录堆栈删除任何条目,而不用离开当前工作目录。例如,如果要使用 popd 从顶部(目前是 ~/Downloads)删除第三个条目,你可以运行以下命令: + +popd +2 + +记住堆栈索引的初始值是 0,因此我们使用 2 来访问第三个条目。 + +因此目录堆栈现在包含: + +$ dirs +/usr/lib ~ ~/Desktop + +确认条目已经被移除了。 + +如果由于某些原因,你发现你很难记住元素在目录堆栈中的位置以及它们的索引,你则可以对在 dirs 命令中使用 -v 选项。这里有一个例子: + +$ dirs -v +0 /usr/lib +1 ~ +2 ~/Desktop + +你可能已经猜到了,左边的数字是索引,接下来跟的是这个索引对应的目录路径。 + +**注意**: 在 dir 中使用 -c 选项清除目录堆栈。 + +现在让我们简要地讨论一下 popd 和 pushd 命令的实际用法。虽然它们第一眼看起来可能有点复杂,但是这些命令在编写 shell 脚本时会派上用场 - 你不需要记住你从哪里来; 只要执行一下 popd,你就能回到你来的目录。 + +经验丰富的脚本编写者通常以以下方式使用这些命令: + +`popd >/dev/null 2>&1` + +上述命令确保 popd 保持静默(不产生任何输出)。同样,你也可以静默 pushd。 + +pushd 和 popd 命令也被 Linux 服务器管理员使用,他们通常在几个相同的目录之间移动。 [这里][5]一些其他真正有信息量的案例解释。 + +### 总结 + +我同意 pushd 和 popd 的概念不是很直接。但是,它需要的只是一点练习 - 是的,你需要让你实践。花一些时间在这些命令上,你就会开始喜欢他们,特别是如果有一些能方便你生活的用例存在时。 + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/ + +作者:[Ansh ][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/ +[1]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#the-basics-of-pushd-and-popd-commands +[2]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#some-advanced-points +[3]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#conclusion +[4]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/ +[5]:http://unix.stackexchange.com/questions/77077/how-do-i-use-pushd-and-popd-commands diff --git a/translated/tech/20170118 Why Linux Installers Need to Add Security Features.md b/translated/tech/20170118 Why Linux Installers Need to Add Security Features.md new file mode 100644 index 0000000000..2771c56e9f --- /dev/null +++ b/translated/tech/20170118 Why Linux Installers Need to Add Security Features.md @@ -0,0 +1,71 @@ +为何 Linux 安装者需要添加安全功能 +============================================================ + +> _由于安全问题越来越严重,Linux 发行版需要在安装程序中突出显示基本安全选项,而不是用户稍后可以手动添加的选项。_ + +十二年前,Linux 发行版努力使安装变得简单。在 Ubuntu 和 Fedora 的领导下,它们很早就实现了这一目标。现在,随着对安全性越来越关注,它们需要稍微转变下方向,并在安装程序中突出显示基本安全选项,而不是用户稍后可以手动添加的选项。 + +当然,在最好的情况下,说服用户来设置安全功能都是困难的。太多用户不愿意添加如非特权用户帐户或密码一样简单的功能,他们显然更喜欢用重装或者以每小时 80 美元的价格咨询专家来减少风险。 + +然而,如果一般用户不会注意安全,那他可能会在安装过程中注意。他们可能永远不会再想到它,但也许在安装过程中,当他们的注意力集中时,特别是如果有可见的解释,他们可能被说服选择一个复选框。 + +这种转变也并不伟大。许多安装程序已经提供了自动登录的选择 - 一个不包含个人数据的安装功能或许是可以接受的,但很可能不会被那些觉得登录不方便的用户使用。同样感谢 Ubuntu,它选择加密文件系统 - 至少在主目录中是这样 - 它已经成为许多安装程序的标准。我真正建议的是这样的。 + +此外,外部安装程序如 Firefox 已经无缝合并了隐私浏览,[Signal Private Messenger][8] 是一个替代标准 Android 手机和联系人应用程序。 + +这些建议远不是激进的。它只需要意志和想象力来实现它。 + +### Linux 安全第一步 + +应该将什么类型的安全功能添加到安装程序? + +首先是防火墙。有许多图形界面程序可以设置设置防火墙。尽管十七年的经验,但是为了解释 Byron 谈论 Coleridge 的形而上学的猜测,我有时希望有人解释他们的解释。 + +尽管有良好的意图,大多数防火墙工具让处理 iptables 似乎很直接。[Bastille Linux][9],一个现在已经停止维护加固系统,可以用于安装一个基本的防火墙,我看不出为什么其他发行版不能做同样的事情。 + +一些工具在安装后就可以使用,并且对安装者而言可以没有困难地添加。例如,[Grub 2][10],大多数发行版使用的引导管理器包含了基本密码保护。但不可否认的是,密码仍可以通过 Live CD 绕过,但它仍然在日常情况下提供一定程度的保护,包括远程登录。 + +类似地,一个后安装的密码管理器(如 [pwgen][11])可以添加到安装程序的设置帐户部分。这些工具强制可接受密码的长度,以及它们的大小写字母,数字和特殊字符的组合。它们许多都可以为你生成密码,有些甚至可以记住密码。 + +还有些工具可以在安装中添加。例如,安装程序可以请求定期备份的计划,并添加一个 cronjob 和一个简单的备份工具,如[kbackup][12]。 + +那么加密电子邮件怎么办?如今最流行的邮件阅读器包括了加密邮件的能力,但是设置和使用加密需要用户采取额外的设置,这使常见的任务复杂化,以至于用户会忽略它。然而,看看 Signal 在手机上的加密有多么简单,很显然,在笔记本电脑和工作站上加密会更容易。这大多数发行版可能都喜欢对等加密,而不喜欢 Signal 那样的集中式服务器,但像 [Ring][13] 这样的程序可以提供这种功能。 + +无论在安装程序中添加了什么功能,也许预防措施也可以扩展到生产力软件,如 LibreOffice。大多数安全工作都集中在电子邮件、网络浏览和聊天中,但文字处理程序和电子表格,以及他们的宏语言,是一个明显的恶意软件感染的来源和隐私关注。除了像 [Qubes OS][14]或 [Subgraph][15] 这样的几个意外之外,很少有人努力将生产力软件纳入其安全预防措施 - 这可能会留下一个空白的安全漏洞。 + +### 适应现代 + +当然,在意安全的用户也许会采取一些安全的方法。然而,这样的用户可以是信任自己。 + +我关心的是那些不太了解或不太愿意自己做修补的用户。我们越来越需要易于使用的安全性,并且亟待解决。 + +这些例子只是开始。它们中的大多数已经存在,并且需要以这样的方式来实现它们,使得用户不能忽略它们,并且能够以最少的知识来使用它们。可能实现所有这些只需要一个程序员,包括原型、UI 设计和测试,且不用超过一个月。 + +然而,直到添加这些功能后,大多数主流的 Linux 发行版几乎不能说是对安全性关注。毕竟,如果用户从不使用它们,那怎么会是好工具? + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/security/why-linux-installers-need-to-add-security-features.html + +作者:[Bruce Byfield][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.datamation.com/author/Bruce-Byfield-6030.html +[1]:http://www.datamation.com/feedback/http://www.datamation.com/security/why-linux-installers-need-to-add-security-features.html +[2]:http://www.datamation.com/author/Bruce-Byfield-6030.html +[3]:http://www.datamation.com/e-mail/http://www.datamation.com/security/why-linux-installers-need-to-add-security-features.html +[4]:http://www.datamation.com/print/http://www.datamation.com/security/why-linux-installers-need-to-add-security-features.html +[5]:http://www.datamation.com/security/why-linux-installers-need-to-add-security-features.html#comment_form +[6]:http://www.datamation.com/security/why-linux-installers-need-to-add-security-features.html# +[7]:http://www.datamation.com/author/Bruce-Byfield-6030.html +[8]:https://whispersystems.org/ +[9]:http://bastille-linux.sourceforge.net/ +[10]:https://help.ubuntu.com/community/Grub2/Passwords +[11]:http://pwgen-win.sourceforge.net/downloads.html +[12]:http://kbackup.sourceforge.net/ +[13]:https://savannah.gnu.org/projects/ring/ +[14]:https://www.qubes-os.org/ +[15]:https://subgraph.com/sgos/ diff --git a/translated/tech/20170119 Get to know Tuleap for project management.md b/translated/tech/20170119 Get to know Tuleap for project management.md new file mode 100644 index 0000000000..7045120b6d --- /dev/null +++ b/translated/tech/20170119 Get to know Tuleap for project management.md @@ -0,0 +1,77 @@ +开始了解 Tuleap 用于项目管理 +============================================================ + +### Tuleap 正在被 Eclipse 基金会使用,用来取代 Bugzilla + + ![Get to know Tuleap for project management](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/rh_003588_01_rd3os.combacktoschoolseriesk12_rh_021x_0.png?itok=kOixOaEU "Get to know Tuleap for project management") + +图片提供:opensource.com + +Tuleap 是一个独特的开源项目管理工具,目前发展势头很好,现在,每个月它会出一个大版本。它还被列在[ 2015 年前 5 大开源项目管理工具][1]和[ 2016 年前 11 个项目管理工具][2]中。 + +Manuel Vacelet,Enalean 的联合创始人和 CTO,Tuleap 项目背后的公司说:“Tuleap 是一个完整的 GPLv2 平台,用于托管软件项目,它提供了一个中心位置,在这里团队可以找到他们所需的所有工具,成功地追踪他们软件项目的生命周期。他们可以找到项目管理(Scrum、看板、瀑布、混合等等)、源码控制(git 和 svn)和代码审查(pull 请求和 gerrit)、持续集成、问题跟踪、wiki 和文档等的支持。” + +在这次采访中,我会和 Manuel 讨论如何开始使用它,以及如何以开源方式管理 Tuleap。 + +**Nitish Tiwari (NT): 为什么 Tuleap 项目很重要? ** + +**Manuel Vacelet(MV):** Tuleap 很重要是因为我们坚信一个成功的(软件)项目必须涉及所有利益相关者:开发人员、项目经理、QA、客户和用户。 + +很久以前,我是 SourceForge 的一个实习生(当 SourceForge 还是一个自由开源项目时),它最终会在几年后将成为 Tuleap。 我的第一个贡献是将 PhpWiki 集成到该工具中(不要告诉任何人,代码写的很糟)。 + +现在,我很高兴作为首席技术官和产品负责人在 Enalean 工作,该公司是 Tuleap 项目的主要贡献公司。 + +**NT: 给我们说下技术方面。** + +**MV:** Tuleap 核心系统是基于 LAMP 并且依赖于 CentOS。如今的开发栈是 AngularJS (v1)、REST 后端(PHP)、基于 NodeJS 的实时推送服务器。但如果你想成为一名 Tuleap 全栈开发人员,你还将需要接触 bash、Perl、Python、Docker、Make。 + +说到技术方面,需要重点强调的 Tuleap 的一个显著特征是它的可扩展性。Tuleap 在单实例、单服务器上并且没有复杂的 IT,可以处理超过 10,000 人。 + +**NT:给我们说下关于项目的用户和社区。有谁参与?他们如何使用这个工具?** + +**MV:** 用户非常多样化。从小型初创公司使用 Tuleap 跟踪他们的项目进度并管理他们的源代码到非常大的公司,如法国电信运营商 Orange,它部署了超过 17,000 用户和 5000 个项目。 + +许多用户依靠 Tuleap 来促进敏捷项目并跟踪其进度。开发人员和客户共享同一个工作区。客户不需要学习如何使用 GitHub,也不需要开发人员做额外的工作,将其工作转换到“客户可访问”平台。 + +今年,Tuleap 被[ Eclipse 基金会][3]使用,取代了Bugzilla。 + +印度电子信息技术部使用 Tuleap 创建了印度政府开放电子政务的开放式协作开发平台。 + +Tuleap 有多种不同的使用方式和配置。有些人使用它作为 Drupal 客户门户网站的后端; 它们通过 REST API 插入到 Tuleap 中以管理 bug 和服务请求。 + +甚至一些建筑师也使用它来管理他们的工作进度和 AutoCAD 文件。 + +**NT:Tuleap 是否做了一些特别的事,使社区更安全,更多样化?** + +**MV:** 我们还没有创建“行为准则”; 本社区非常平和以及受欢迎,但我们有计划这样做。Tuleap 的开发人员和贡献者来自不同的国家(例如加拿大、突尼斯、法国)。而且 35% 的活跃开发者和贡献者是女性。 + +**NT:由社区建议的 Tuleap 功能的百分比是多少?** + +**MV:** 几乎 100% 的功能是由社区驱动的。 + +这是 Enalean 的关键挑战之一:找到一种商业模式,使我们能以正确的方式做开源软件。对我们来说,“开放核心”模式(其中应用程序的核心是开放的,但有趣和有用的部分是封闭源的)不是正确的方法,因为你最终还是要依赖闭源。因此,我们发明了[OpenRoadmap][4],这种方式是我们从社区和最终用户那里收集需求,并找公司来支付。 + + +-------------------------------------------------------------------------------- + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/nitish-crop.png?itok=h4PaLDQq) + +Nitish 是一名专业的软件开发人员并对开源有热情。作为基于 Linux 的杂志的技术作者,他会尝试新的开源工具。他喜欢阅读和探索任何开源。在他的空闲时间,他喜欢读励志书。他目前正在构建 DevUp - 一个让开发人员以真正的方式连接所有工具和拥抱 DevOps 的平台。你可以在 Twitter 上关注他 @tiwari_nitish。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/interview-Tuleap-project + +作者:[Nitish Tiwari][a] +译者:[geekpi](https://github.com/geeki) +校对:[jamsinepeng](https://github.com/jasminepeng) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/tiwarinitish86 +[1]:https://opensource.com/business/15/1/top-project-management-tools-2015 +[2]:https://opensource.com/business/16/3/top-project-management-tools-2016 +[3]:http://www.eclipse.org/ +[4]:https://blog.enalean.com/enalean-open-roadmap-how-it-works/ diff --git a/translated/tech/20170119 Long-term Embedded Linux Maintenance Made Easier.md b/translated/tech/20170119 Long-term Embedded Linux Maintenance Made Easier.md new file mode 100644 index 0000000000..d66f89a454 --- /dev/null +++ b/translated/tech/20170119 Long-term Embedded Linux Maintenance Made Easier.md @@ -0,0 +1,53 @@ +长期维护嵌入式 Linux 内核变得容易 +============================================================ + + ![Jan Lübbe ](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jan-lubbe-elc.png?itok=6G5lADKu "Jan Lübbe ") +Pengutronix 内核黑客 JanLübbe 总结了嵌入式 Linux 中正在增长的安全威胁,并在这次在欧洲举行的嵌入式 Linux 会议上概述了一个计划,以保持长期设备的安全和完整功能。[Linux 基金会][1] + +过去安全漏洞只发生在在民间快速衰落的 Windows 上。恶意软件黑客和拒绝服务专家越来越多地针对过时的嵌入式 Linux 设备,因此 10 月在[欧洲举行的嵌入式 Linux 会议][3](ELCE)上的几个演讲的主题是关于修复 Linux 安全漏洞。 + +最好的参加者之一是“长期维护、管理嵌入式系统10年以上“的 [Pengutronix][4]内核黑客 JanLübbe。在总结嵌入式 Linux 中不断增长的安全威胁后,Lübbe 制定了一项计划,以确保长期设备的安全和完整的功能。 Lübbe说:“我们需要迁移到更新、更稳定的内核,并进行持续维护以修复关键漏洞。我们需要做上游和自动化流程,并建立一个可持续的工作流程。我们没有任何借口在系统中使用过时的软件。” + +随着 Linux 设备变得越来越老,传统的生命周期程序已经不再适用。 Lübbe说:“通常,你会从 SoC 供应商或主线上获取内核、构建系统,并添加到用户空间。你自定义并添加了一个程序,并在做了一些检测后就完成了。但是,在 15 年的维护阶段,你最好希望没有平台变化,或者想添加新的功能,或者需要应用监管变化。” + +所有这些变化越来越多地暴露新的系统错误,并需要大量更新以与上游软件保持同步。 Lübbe说:“但这并不总是在内核中发生导致问题的无意错误”。去年在 Allwinner 内核中发现的[后门][5]后,它补充说:“这些供应商内核从来不会执行主线社区的审查流程”。 + +Lübbe继续说:“你不能相信你的供应商会做正确的事情。也许只有一两个工程师看到这个后门代码。如果补丁发布在 Linux 内核邮件列表上,这将永远不会发生。因为会有人注意到。硬件供应商不关心安全或维护。也许你会在一两年后得到更新,但是即使这样,他们在一个固定版本开始开发到他们声明稳定的点通常需要几年的时间。如果你开始在这个基础上开发,你可能又增加了半年,甚至更过时了。 + +越来越多的嵌入式开发人员在长期稳定(LTS)内核上构建长期产品。但这并不意味着你的工作已经完成。Lübbe说:“一个产品发布后,人们不再经常遵循稳定的发行链,因此他们不应用安全补丁。你会得到两个世界中最糟糕的:一个过时的内核以及没有安全。你不会得到许多人测试的好处。” + +Lübbe 指出,使用像 Red Hat 这样的面向服务器的发行版的 Pengutronix 客户经常遇到问题,因为可以如没有值守人员那样快速的定制、部署、升级系统。 + +“更新可以用于某些东西上,特别是如果它们是 x86,但每个项目基本上是自己建立基础设施更新到新版本。” + +许多开发人员选择向后移植作为更新长期产品的解决方案。Lübbe 说:“开始时很容易,但是一旦你不在项目的维护窗口,他们不会告诉你你使用的版本是否受到一个错误的影响,所以很难找出一个修复是否相关。所以你堆积补丁、修改以及 bug 积累,这些你必须自己维护,因为没有人会使用这些补丁。使用开源软件的好处就丢失了。” + +### 跟随上游项目 + +Lübbe 认为最好的解决方案是跟踪由上游项目维护的版本。“我们主要关注基于主线的开发,所以我们在产品和主流内核及其他上游项目之间尽可能没有差别。长期系统在主线上得到很好的支持。大多数不使用 3D 图形的系统可以运行很少的补丁。较新的内核版本还有很多[新的强化功能][6],这些可以减少漏洞的影响。 + +跟随主线似乎对许多开发人员来说是令人畏惧的,但是如果从一开始就这样,然后坚持下去,就会相对容易一些,Lübbe说:“你需要为系统制定一切开发过程。你总是需要知道什么软件正在运行,这在使用良好的构建系统时会更容易。每个软件版本应定义完整的系统,以便你可以更新系统中的一切。如果你不知道那里有什么,那么你就不能解决它。你还会想要进行自动测试和自动部署更新。 + +为了“保存更新周期”,Lübbe 建议在开始开发时使用最新的 Linux 内核,并且在进入测试时才移动到稳定的内核。之后,他建议每年将系统中的所有软件(包括内核、构建系统、用户空间、glibc 和组件(如 OpenSSL))更新为上一年度其他上游项目支持的版本。 + +Lübbe说:“你在这点更新并不意味着你需要部署。如果你没有看到安全漏洞,你可以把补丁放在一版,如果你需要它就准备好了。 + +最后,Lübbe 建议每个月查看发布公告,并且每周检查 CVE 和主线列表上的安全公告。你只需要回应 “公告实际影响了你”。他补充说:“如果你的内核足够现代,这并没有太多的工作。你不想在新闻中看到你的设备而获得有关你产品的反馈。” + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/event/ELCE/2017/long-term-embedded-linux-maintenance-made-easier + +作者:[ERIC BROWN][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/ericstephenbrown +[1]:https://www.linux.com/licenses/category/linux-foundation +[2]:https://www.linux.com/files/images/jan-lubbe-elcpng +[3]:http://events.linuxfoundation.org/events/archive/2016/embedded-linux-conference-europe +[4]:http://www.pengutronix.de/index_en.html +[5]:http://arstechnica.com/security/2016/05/chinese-arm-vendor-left-developer-backdoor-in-kernel-for-android-pi-devices/ +[6]:https://www.linux.com/news/event/ELCE/2017hardening-kernel-protect-against-attackers diff --git a/translated/tech/20170120 Getting Started with Bitbucket for Version Control.md b/translated/tech/20170120 Getting Started with Bitbucket for Version Control.md new file mode 100644 index 0000000000..20a8bda679 --- /dev/null +++ b/translated/tech/20170120 Getting Started with Bitbucket for Version Control.md @@ -0,0 +1,125 @@ +使用 Bitbucket 开始版本控制 +============================================================ + + ![](https://www.blogmint.com/frontendUtil/openPage?page=blog-post-read&oId=c41aba944ad4408095c09ccabc1921ec&uId=1a715d24df2f49c0be2acf7d7409ffbb&count=1&image=one-pixel.png) + +在互联网成为一个巨大的、世界性的现象之前,开发团队曾经被限制在一个小的物理空间内。如果一家公司没有资金支持这样一个冒险,那么与世界另一方的人合作是一个非常昂贵或几乎不可能的梦想。 + +幸运的是,情况不再是这样了。互联网诞生了基于网络的解决方案,允许公司组成的合作团体,包括彼此相距数千英里的人。 + +自从 2008 年首次推出以来,[Bitbucket][1]已成为使用 Mercurial 或 Git 版本控制系统(VCS)的开发人员团队中越来越受欢迎的选择。 + +它提供两个免费帐户与无限数量的私人存储库(每个最多5个用户)和多个付费计划,允许每个帐户有更多用户。此外,标记为 public 的仓库对可以编辑或读取其内容的人数没有限制。 + +### 注册 Bitbucket + +要使用 Bitbucket,你需要设置一个免费帐户。要这样做,请进入 [https://bitbucket.org/][2],然后单击开始免费按钮。 + +首先,你需要输入有效的电子邮件地址,然后点击继续。 你的电子邮件帐户将被验证,如果一切正常,你将被提示输入所需的密码。完成后,再次点击“继续”,并检查你的电子邮件收件箱以确认你的帐户是否已创建: + +[ + ![Bitbucket Singup](http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Singup.png) +][3] + +Bitbucket 注册 + +验证电子邮件地址后,系统会要求你选择用户名。 然后将创建你的帐户,你将会进入 Bitbucket 面板,在那里开始创建团队、项目和仓库: + +[ + ![Bitbucket Dashboard](http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Dashboard.png) +][4] + +Bitbucket 面板 + +如你所见,你可以在几分钟内注册 Bitbucket。Atlassianhave 的人简化了这个过程,以便你可以把你的时间真正用在 Bitbucket 上- 我们接下来会解释这个。 + +### 使用使用 Bitbucket + +让我们检查下在注册完 Bitbucket 之后必须要做的事情。下面是最需做的清单: + +[ + ![Explore Bitbucket Features](http://www.tecmint.com/wp-content/uploads/2017/01/Explore-Bitbucket-Features.png) +][5] + +探索 Bitbucket 功能 + +###### 1). 创建一个团队通过允许多个 Bitbucket 用户共享一个账号计划的方式鼓励协作。 + +这将允许他们轻松地管理团队拥有的仓库。要创建团队,请输入所需的名称,并确保团队标识不存在。接下来,输入你要添加到群组的人员的电子邮件地址,并指明是否要将其设为管理员。最后,单击创建: + +[ + ![Bitbucket - Create a Team](http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Create-a-Team.png) +][6] + +Bitbucket – 创建一个团队 + +###### 2) 创建或导入一个仓库 + +如果你已经使用基于 Git 的解决方案,你可以轻松地将你的仓库导入 Bitbucket。否则,你可以从头创建一个。让我们看看在每种情况下你需要做什么。 + +要创建新的仓库,请单击“仓库”菜单中的“创建仓库”选项。为新仓库和要分组到的项目选择一个名称。接下来,指明是否要将其设置为 private 以及类型(Git 或 Mercurial)。最后,单击创建仓库: + +[ + ![Bitbucket - Create a New Repository](http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Create-a-New-Repository.png) +][7] + +Bitbucket – 创建一个新仓库 + +要导入现有仓库,请从仓库下拉菜单中选择导入仓库。要开始导入,请指定源,输入 URL 和所需的登录凭据(如果需要)。 + +最后,选择新的仓库设置,然后单击导入仓库。忽略有关在指定的 URL 处找不到的仓库的警告,因为它是虚拟的,仅用于演示目的: + +[ + ![Bitbucket - Import Existing Code](http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Import-Existing-Code.png) +][8] + +Bitbucket – 导入存在的代码 + +就是这样,很简单吧。 + +### 在 Bitbucket 中使用仓库工作 + +在你创建一个新仓库或者导入一个仓库时,它会在你的列表上展示出来。这时你就能执行一些常规操作比如克隆、创建分支、pull request、提交修改、添加 README 文件等等: + +[ + ![Bitbucket - Repository Overview](http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Repository-Overview.png) +][9] + +Bitbucket – 仓库概述 + +如果你想了解如何用仓库工作,或者你觉得你想要提升你的 git 技能,你可以参考[ Bitbucket 离线文档][10]。 + +##### 总结 + +如你所见,不管你是版本管理的新手或者老手,Bitbucket 让它变得简单。如果你对本文有任何疑问或评论,请不要犹豫让我们知道。我们期待听到你的声音! + +-------------------------------------------------------------------------------- + +作者简介: + +![](http://1.gravatar.com/avatar/7badddbc53297b2e8ed7011cf45df0c0?s=256&d=blank&r=g) + +我是 Ravi Saive,TecMint 的创建者。一个喜爱在互联网上分享技巧和提示的计算机 geek 和 Linux 老手。我的大多数服务运行在 Linux 开源平台上。请在 Twitter、Facebook、Google+ 上关注我。 + +-------------------------------------------------------------------------------- + + +via: http://www.tecmint.com/bitbucket-for-version-control/ + +作者:[Ravi Saive][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:http://bit.ly/2ieExnS +[2]:http://bit.ly/2ioJISt +[3]:http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Singup.png +[4]:http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Dashboard.png +[5]:http://www.tecmint.com/wp-content/uploads/2017/01/Explore-Bitbucket-Features.png +[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Create-a-Team.png +[7]:http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Create-a-New-Repository.png +[8]:http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Import-Existing-Code.png +[9]:http://www.tecmint.com/wp-content/uploads/2017/01/Bitbucket-Repository-Overview.png +[10]:https://confluence.atlassian.com/bitbucket/bitbucket-cloud-documentation-home-221448814.html diff --git a/translated/tech/20170120 How to write web apps in R with Shiny.md b/translated/tech/20170120 How to write web apps in R with Shiny.md new file mode 100644 index 0000000000..e89a885718 --- /dev/null +++ b/translated/tech/20170120 How to write web apps in R with Shiny.md @@ -0,0 +1,68 @@ +如何用 R 语言的 Shiny 库编写 web 程序 +============================================================ + ![How to write web apps in R with Shiny](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_lightbulbs.png?itok=70w-2-Ta "How to write web apps in R with Shiny") +图片提供:  + +opensource.com + +新年快乐!我这个月在写一些更加长的文章,所以你可以在未来几个星期内寻找它们。对于这个月的 Nooks 和 Crannies,我想简要地提一个我一直在自己在玩的一个很棒的 R 库。 + +我的一个亲密朋友最近在用 R 编写东西。我一直都对它很感兴趣,一直在试图挤一点时间,至少学习更多关于 R 以及你可以做的事情的种类。探索 R 的数字处理能力对我而言是一个持续斗争,因为我并不是如我朋友那样有一个数学头脑。这对我来说很慢,但我一直试图将它与我在其他领域的经验联系起来,我甚至开始考虑非常简单的 web 程序。 + +[Shiny][1]是一个来自 RStudio 的工具包,它让创建 web 程序变得更容易。它能从 R 控制台轻松安装,只需要一行,最新的稳定版本将加载供你使用。这里有一个很棒的[教程][2],它会通过设置应用程序的概念、通过前面的课程构建技能的方式引导你。 Shiny 的授权是 GPLv3,源代码可以在 [GitHub][3] 上获得。 + +这是一个用 Shiny 写的简单的小 web 程序: + +``` + +library(shiny) + +server <- function(input, output, session) { + observe({ + myText <- paste("Value above is: ", input$textIn) + updateTextInput(session, "textOut", value=myText) + }) +} + +ui <- basicPage( + h3("My very own sample application!"), + textInput("textIn", "Input goes here, please."), + textInput("textOut", "Results will be printed in this box") +) + +shinyApp(ui = ui, server = server) +``` + +当你在输入框中输入时文字时,它会复制提示语句后面的文字。这并没有什么奇特的,但它向你展示了一个 Shiny 程序的基本结构。“服务端”部分允许你处理所有后端工作,如计算、数据库检索或程序需要发生的任何其他操作。“UI”部分定义了接口,它可以根据需要变得简单或复杂。 + +Shiny 中包含的大量样式和主题使用的是 [Bootstrap][4],所以你可以在学习了一点后,就能用 R 创建广泛的、功能丰富的 web 程序。附加包可以扩展功能,甚至更高级的 JavaScript 程序、模板等。 + +你可以以几种方式处理 Shiny 的后端工作。如果你只是在本地运行你的程序,加载库会就能做到。对于想要发布到网络上的程序,你可以在[ RStudio 的 Shiny 网站][5]上共享它们,运行开源版本的 Shiny 服务器,或通过年度订阅服务从 RStudio 处购买 Shiny Server Pro。 + +经验丰富的 R 大牛可能已经知道 Shiny 了;它已经存在大约几年了。对于像我这样从一个完全不同的编程语言来的人并希望学习一点 R 的人来说,我发现它是相当有帮助的。 + +-------------------------------------------------------------------------------- + + +作者简介: + +![](https://opensource.com/sites/default/files/styles/profile_pictures/public/ruth1_avi.jpg?itok=I_EE7NmY) + +D Ruth Bavousett - D Ruth Bavousett 已经成为一名系统管理员和软件开发人员很长时间了,他的专业生涯开始于 VAX 11/780。在她的职业生涯(迄今为止)中,她花费了大量的时间在满足库的需求上,她自 2008 年以来一直是 Koha 开源库自动化套件的贡献者. Ruth 目前是休斯敦 cPanel 的 Perl 开发人员, 的两只猫的工作人员。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/writing-new-web-apps-shiny + +作者:[D Ruth Bavousett][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/druthb +[1]:http://shiny.rstudio.com/ +[2]:http://shiny.rstudio.com/tutorial +[3]:https://github.com/studio/shiny +[4]:http://getbootstrap.com/ +[5]:http://shinyapps.io/ diff --git a/translated/tech/20170123 How to Hide Apache Version Number and Other Sensitive Info.md b/translated/tech/20170123 How to Hide Apache Version Number and Other Sensitive Info.md new file mode 100644 index 0000000000..c3f396b5a0 --- /dev/null +++ b/translated/tech/20170123 How to Hide Apache Version Number and Other Sensitive Info.md @@ -0,0 +1,93 @@ +如何隐藏 Apache 版本号和其他敏感信息 +============================================================ + +当远程请求发送到你的 Apache Web 服务器时,在默认情况下,一些有价值的信息,如 web 服务器版本号、服务器操作系统详细信息、已安装的 Apache 模块等等,这些服务器生成的信息会发送回客户端。 + +这里包含了攻击者可利用的漏洞并访问 web 服务器的很多信息。为了避免显示 web 服务器信息,我们将在本文中演示如何使用特定的 Apache 指令隐藏 Apache Web 服务器的信息。 + +**推荐阅读:** [13 个有用的使你的 Apache 服务器安全的贴士][1] + +两个重要的指令是: + +##### ServerSignature + +这允许在服务器生成的文档(如错误消息、mod_proxy ftp 目录列表、mod_info 输出等等)下添加一个显示服务器名称和版本号的页脚行。 + +它有三个可能的值: + +1. **On** - 允许在服务器生成的文档中添加尾部页脚行, +2. **Off** - 禁用页脚行 +3. **EMail** - 创建一个 “**mailto:**” 引用; 它将邮件发送到所引用文档的 ServerAdmin。 + +##### ServerTokens + +它确定发送回客户端的服务器响应头字段是否包含服务器操作系统类型的描述和有关已启用的 Apache 模块的信息。 + +此指令具有以下可能的值(以及在设置特定值时发送到客户端的示例信息): + +``` +ServerTokens Full (或者不指定) +发送给客户端的信息: Server: Apache/2.4.2 (Unix) PHP/4.2.2 MyMod/1.2 +ServerTokens Prod[uctOnly] +发送给客户端的信息: Server: Apache +ServerTokens Major +发送给客户端的信息: Server: Apache/2 +ServerTokens Minor +发送给客户端的信息: Server: Apache/2.4 +ServerTokens Min[imal] +发送给客户端的信息:Server: Apache/2.4.2 +ServerTokens OS +发送给客户端的信息: Server: Apache/2.4.2 (Unix) +``` + +**注意**:在 Apache **2.0.44** 之后,**ServerTokens** 同样控制由 **ServerSignature** 指令提供的信息。 + +**推荐阅读:** [5 个加速 Apache Web 服务器的贴士][2] + +为了隐藏 web 服务器版本号、服务器操作系统细节、已安装的 Apache 模块等等,使用你最喜欢的编辑器打开 Apache 配置文件: + +``` +$ sudo vi /etc/apache2/apache2.conf #Debian/Ubuntu systems +$ sudo vi /etc/httpd/conf/httpd.conf #RHEL/CentOS systems +``` + +添加/修改/附加下面的行: + +``` +ServerTokens Prod +ServerSignature Off +``` + +保存并退出文件,重启你的 Apache 服务器: + +``` +$ sudo systemctl apache2 restart #SystemD +$ sudo sevice apache2 restart #SysVInit +``` + +本篇中,我们解释了如何使用特定的 Apache 指令隐藏Apache web 服务器版本号及其他信息。 + +如果你在 Apache 中运行 PHP,我建议你[隐藏 PHP 版本号][3]。 + +如往常一样,你可以在评论栏中写下你的想法。 + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin 及 web 开发者,目前是 TecMint 的内容创作者,他喜欢用电脑工作,并坚信分享知识。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/hide-apache-web-server-version-information/ + +作者:[Aaron Kili][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者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/apache-security-tips/ +[2]:http://www.tecmint.com/apache-performance-tuning/ +[3]:http://www.tecmint.com/hide-php-version-http-header/ diff --git a/translated/tech/20170124 How to Hide PHP Version Number in HTTP Header.md b/translated/tech/20170124 How to Hide PHP Version Number in HTTP Header.md new file mode 100644 index 0000000000..f3272f7f87 --- /dev/null +++ b/translated/tech/20170124 How to Hide PHP Version Number in HTTP Header.md @@ -0,0 +1,99 @@ +如何在 HTTP 头中隐藏 PHP 版本号 +============================================================ + +PHP 配置默认允许服务器在 HTTP 响应头 “**X-Powered-By**” 显示安装在服务器上的 PHP 版本。 + +出于服务器安全原因(虽然不是主要的要担心的威胁),建议你禁用或隐藏此信息,避免那些针对你的服务器的攻击者知道你是否运行了 PHP。 + +假设你服务器上安装的特定版本的 PHP 具有安全漏洞,另一方面,攻击者可以了解这一点,他们将更容易利用漏洞并通过脚本访问服务器。 + +在我以前的文章中,我已经展示了[如何隐藏 apache 版本号][1],在那里你已经看到如何不再显示 apache 的安装版本。但是如果你在你的 apache 服务器上运行 PHP,你需要隐藏 PHP 的安装版本,这我们将在本文中展示。 + +因此,在本文中,我们将解释如何隐藏或关闭服务器 HTTP 响应头中的 PHP 版本号。 + +此设置可以在加载的 PHP 配置文件中配置。如果你不知道此配置文件在服务器上的位置,请运行以下命令找到它: + +``` +$ php -i | grep "Loaded Configuration File" +``` +PHP 配置文件位置 +``` +---------------- 在 CentOS/RHEL/Fedora 上---------------- +Loaded Configuration File => /etc/php.ini +---------------- 在 Debian/Ubuntu/Linux Mint 上---------------- +Loaded Configuration File => /etc/php/7.0/cli/php.ini +``` + +在对 PHP 配置文件进行任何更改之前,我建议您首先备份您的 PHP 配置文件,如下所示: + +``` +----------------在 CentOS/RHEL/Fedora 上---------------- +$ sudo cp /etc/php.ini /etc/php.ini.orig +---------------- 在 Debian/Ubuntu/Linux Mint 上---------------- +$ sudo cp /etc/php/7.0/cli/php.ini /etc/php/7.0/cli/php.ini.orig +``` + +[用你最喜欢的编辑器][2],使用超级用户权限打开文件: + +``` +---------------- 在 CentOS/RHEL/Fedora 上---------------- +$ sudo vi /etc/php.ini +----------------在 Debian/Ubuntu/Linux Mint 上---------------- +$ sudo vi /etc/php/7.0/cli/php.ini +``` + +定位到关键词 `expose_php`,并将值设置成 **Off**: + +``` +expose_php = off +``` + +保存并退出文件。在这之后,重启 web 服务器: + +``` +---------------- 使用 SystemD ---------------- +$ sudo systemctl restart httpd +$ sudo systemctl restart apache2 +---------------- 使用 SysVInit ---------------- +$ sudo service httpd restart +$ sudo service apache2 restart +``` + +最后但并非不重要,使用下面的命令检查服务器 HTTP 响应头是否仍然显示你的 PHP 版本号。 + +``` +$ lynx -head -mime_header http://localhost +或者 +$ lynx -head -mime_header http://server-address +``` + +这里的标志是: + +1. `-head` – 发送对 mime 报头的 HEAD 请求。 +2. `-mime_header` – 打印所提取文档的 MIME 标头及其来源。 + +**注意**: 确保你系统中已经安装了 [lynx- 命令行 web 浏览器][3]。 + +就是这样了!在本文中,我们解释了如何隐藏服务器 HTTP 响应头中的 PHP 版本号以保护 web 服务器免受可能的攻击。你可以在下面的评论栏中留下你的想法或者相关的问题。 + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin 及 web 开发者,目前是 TecMint 的内容创作者,他喜欢用电脑工作,并坚信分享知识。 + +--------------------------------------------------------------------------------- + + +via: http://www.tecmint.com/hide-php-version-http-header/ + +作者:[Aaron Kili][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者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/hide-apache-web-server-version-information/ +[2]:http://www.tecmint.com/linux-command-line-editors/ +[3]:http://www.tecmint.com/command-line-web-browsers/ diff --git a/translated/tech/20170125 How to Run sudo Command Without Entering a Password in Linux.md b/translated/tech/20170125 How to Run sudo Command Without Entering a Password in Linux.md new file mode 100644 index 0000000000..701bc9f47b --- /dev/null +++ b/translated/tech/20170125 How to Run sudo Command Without Entering a Password in Linux.md @@ -0,0 +1,92 @@ +如何在 Linux 中不输入密码运行 “sudo” 命令 +============================================================ + +假设你在只有自己使用的计算机上运行 Linux 系统,比如在笔记本电脑上,在每次调用 **sudo** 时需要输入密码,从长远来看都会变得无聊。因此,在本指南中,我们将描述[如何配置 sudo 命令][4]在运行时而不输入密码。 + +此设置在 **/etc/sudoers** 文件中完成,它让 sudoers 使用 [sudo 命令][5]的默认安全策略; 在用户权限指定user privilege specification部分。 + +**重要**:在 **sudeors** 文件中,默认打开的 authenticate 参数用于验证目的。如果设置了它,用户必须通过密码(或其他身份验证方法)进行身份验证,然后才能使用 **sudo** 运行命令。 + +但是,可以使用 **NOPASSWD**(当用户调用 **sudo** 命令时不需要密码)标记来覆盖此默认值。 + +配置用户权限的语法如下: + +``` +user_list host_list=effective_user_list tag_list command_list +``` + +其中: + +1. `user_list` - 用户列表或已经设置的用户别名。 +2. `host_list` - 主机列表或用户可以在其上运行 sudo 的主机别名。 +3. `effective_user_list` - 目标用户 +4. `tag_list` - 标签列表,如 NOPASSWD。 +5. `command_list` - 用户使用 sudo 运行的命令或命令别名列表。 + +要允许用户(下面的示例中的 `aaronkilik`)使用 **sudo** 不输入密码即可运行所有命令,请打开 **sudoers** 文件: + +``` +$ sudo visudo +``` + +添加下面的行: + +``` +aaronkilik ALL=(ALL) NOPASSWD: ALL +``` + +对于组而言,在组名前面使用 `%` 字符;这意味着 `sys` 组的所有成员都可以不用密码使用 sudo。 + +``` +%sys ALL=(ALL) NOPASSWD: ALL +``` + +要允许用户不用密码使用 sudo 运行指定命令(`/bin/kill`),添加下面的行: + +``` +aaronkilik ALL=(ALL) NOPASSWD: /bin/kill +``` + +下面的行会让 `sys` 组成员在使用 **sudo** 运行命令:**/bin/kill**、**/bin/rm** 时不用输入密码: + +``` +%sys ALL=(ALL) NOPASSWD: /bin/kill, /bin/rm +``` +[ + ![Run sudo Without Password](http://www.tecmint.com/wp-content/uploads/2017/01/Run-sudo-Without-Password.png) +][6] + +*不用密码运行 sudo* + +对于更多的 **sudo** 配置和其他使用选项,请阅读我们的有更多例子描述的文章,: + +-  [在 Linux 中设置 sudo 的十条 sudoers 实用配置][1] +-  [让 sudo 在你输入错误的密码时“嘲讽”你][2] +-  [如何在 Linux 中让 sudo 密码会话的超时更长些][3] + +在本篇中,我们讨论了如何配置 sudo 命令来不用输入密码运行。不要忘记在评论栏中给我们提供你关于这份指导的想法和其他对于 Linux 系统管理员有用的 sudoers 配置。 + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili 是 Linux 和 F.O.S.S 爱好者,将来的 Linux SysAdmin 及 web 开发者,目前是 TecMint 的内容创作者,他喜欢用电脑工作,并坚信分享知识。 + +---------------------------------------------------------------- + + +via: http://www.tecmint.com/run-sudo-command-without-password-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/aaronkili/ +[1]:https://linux.cn/article-8145-1.html?utm_source=index&utm_medium=more +[2]:https://linux.cn/article-8128-1.html +[3]:https://linux.cn/article-8151-1.html +[4]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ +[5]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/ +[6]:http://www.tecmint.com/wp-content/uploads/2017/01/Run-sudo-Without-Password.png diff --git a/translated/tech/20170125 Solid state drives in Linux Enabling TRIM for SSDs.md b/translated/tech/20170125 Solid state drives in Linux Enabling TRIM for SSDs.md new file mode 100644 index 0000000000..af1a382761 --- /dev/null +++ b/translated/tech/20170125 Solid state drives in Linux Enabling TRIM for SSDs.md @@ -0,0 +1,56 @@ +Linux 中固态驱动器:启用 SSD 中的 TRIM +============================================================ + + ![Solid state drives in Linux: Enabling TRIM for SSDs](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUSINESS_robots.png?itok=6eqf2Wjv "Solid state drives in Linux: Enabling TRIM for SSDs") +图片提供: opensource.com + +当我在运行 Linux 的计算机上第一次安装固态驱动器(SSD)后,我开始探索如何处理它们。固态驱动器在操作方式上与传统磁性驱动器不同,并且它们需要在软件上不同的照顾以达到功能优化。 + +在传统磁盘驱动器上,删除时删除的文件不会从磁盘中完全删除。这就是为什么你可以恢复已删除的文件。基本上,文件系统仅引用磁盘上文件的位置,并且当文件被删除时,该引用被擦除,允许你在这些空间中写入新数据覆盖原来的数据。然而,对于SSD,新数据只能写在驱动器上完全新的或已擦除的单元上。因为必须在写入之前清除空间,如果在写入文件时尚未有足够的可用空间,则必须首先擦除该空间。这可能会对性能产生负面影响。 + +如果操作系统在写入新数据之前擦除未使用的空间,则在设备未同时尝试写入时,可以提高文件保存性能。进入 [TRIM][1] 页面。 TRIM 命令本质上允许你的操作系统告诉驱动器哪些区域的数据不再使用,以便擦除它们,加快驱动器以便将来写入,并为 SSD 的用户提供更佳的体验。 + +在 Linux 中,**fstrim** 提供此功能,准备写入新数据的驱动器,并延长驱动器的使用寿命。由于在我使用的 Linux 发行版上 trim SSD 不是自动的,所以必须进行调度,否则 SSD 的性能会随着时间的推移而降低。 + +为了在驱动器上运行 fstrim,驱动器本身以及坐在其上的文件系统必须支持 TRIM。在文件系统挂载过程中可以启用 TRIM。例如,为了将设备 **/dev/sda2** 带 TRIM 挂载到 **/mnt**,你要运行: + +``` +mount -t ext4 -o discard /dev/sda2 /mnt +``` + +一旦启用,TRIM 过程本身就相当简单。TRIM SSD 也可以在命令行或 cron 作业中手动完成。作为超级用户(使用su或sudo),运行 ** fstrim / -v** 以完成手动修剪,或者设置 cron 作业以在计算机未使用时定期为你运行此命令。对于 fstrim 的完整选项列表请参考它的[man 手册][3]。 + +硬件支持根据使用的驱动器接口类型如 PCI、[ATA][4]、[SCSI][5] 还是 [SD/MMC][6] 而有所不同。你需要咨询你的 Linux 供应商以了解更多关于你的特定发行版如何支持 TRIM。 + +例如,红帽提供以下[ SSD 磁盘准则][7]。“性能随着使用的块数量接近磁盘容量而降低,性能影响程度因供应商而异,但是所有设备都会遇到一些性能降低。为了解决性能降低问题,主机系统(例如 Linux 内核)使用丢弃请求以通知存储器给定范围的块不再使用。” + +[Debian wiki][8] 提供了 SSD 使用的一些基本注意事项:使用 Linux 3.2 或更高版本内核,使用 SSD 的最新固件,使用 EXT4 文件系统,并且“在正常工作负载下有足够的 DRAM 用来操作而不用使用交换空间“。 + +-------------------------------------------------------------------------------- + +作者简介: + +Don Watkins - 教育家、教育技术专家、企业家、开源倡导者。教育心理学硕士、教育领导硕士、Linux系统管理员、CCNA、使用 Virtual Box 虚拟化。关注我 @Don_Watkins。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/solid-state-drives-linux-enabling-trim-ssds + +作者:[Don Watkins][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/don-watkins +[1]:https://en.wikipedia.org/wiki/Trim_(computing) +[2]:https://opensource.com/article/17/1/solid-state-drives-linux-enabling-trim-ssds?rate=7ZBblixmfl2icbl8HWXjIfzUr3-EUjlgkOGyEhI1DK8 +[3]:http://man7.org/linux/man-pages/man8/fstrim.8.html +[4]:https://en.wikipedia.org/wiki/Trim_(computing)#ATA +[5]:https://en.wikipedia.org/wiki/Trim_(computing)#SCSI +[6]:https://en.wikipedia.org/wiki/Trim_(computing)#SD.2FMMC +[7]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-ssd.html +[8]:https://wiki.debian.org/SSDOptimization +[9]:https://opensource.com/user/15542/feed +[10]:https://opensource.com/article/17/1/solid-state-drives-linux-enabling-trim-ssds#comments +[11]:https://opensource.com/users/don-watkins diff --git a/translated/tech/20170126 Disable Apache Web Directory Listing Using .htaccess File.md b/translated/tech/20170126 Disable Apache Web Directory Listing Using .htaccess File.md new file mode 100644 index 0000000000..46d0514373 --- /dev/null +++ b/translated/tech/20170126 Disable Apache Web Directory Listing Using .htaccess File.md @@ -0,0 +1,90 @@ +使用 .htaccess 文件禁用 Web 目录列举 +=========== + +[确保 Apache web 服务器安全][3] 是最重要的任务之一,特别是在你的网站刚刚搭建好的时侯。 + +比方说,如果你 Apache 服务目录 (**/var/www/tecmint** or **/var/www/html/tecmint**) 下创建一个名为“**tecmint**”的目录,并且忘记在该目录放置“**index.html**”,你会惊奇的发现所有访问者都可以在浏览器输入 **http://www.example.com/tecmint** 来完整列举所以在该目录的重要文件和文件夹。 + +本文将为你展示如何使用 **.htaccess** 文件禁用或阻止 Apache 服务器目录列举。 +一下便是不存在 **index.html** ,且未采取防范措施前,目录的列举详情。 + +[![Apache 目录列举](http://www.tecmint.com/wp-content/uploads/2017/01/Apache-Directory-Listing.png)][4] + +Apache 目录列举 + +首先,**.htaccess**  (**超文本 access**) 是一个文件,可以让站点管理员控制服务器的环境变量以及其他的重要选项,用以增强他/她的站点功能。 + +预知更多关于该重要文件的信息,请阅读以下文章,以便通过 **.htaccess** 的方法来确保 Apache Web 服务器的安全。 + +1. [确保 Apache Web 服务器安全的 25 条 .htaccess 设置技巧][1] +2. [使用 .htaccess 为 Apache Web 目录进行密码保护][2] + +使用这一简单方法,在站点目录树中的 任意/每个 目录创建 **.htaccess** 文件,以便为站点该目录、子目录和其中的文件提供保护支持。 + +首先要 Apache 主配置文件中为你的站点启用 **.htaccess** 文件。 + +``` +$ sudo vi /etc/apache2/apache2.conf #Debian/Ubuntu 系统 +$ sudo vi /etc/httpd/conf/httpd.conf #RHEL/CentOS 系统 +``` +然后寻找以下部分,其中 `AllowOverride` 指令必须设置为 `AllowOverride All`。 + +``` + +Options Indexes FollowSymLinks +AllowOverride All + +``` +如果已存在 **.htaccess** 文件,先备份(如下),假设文件在 **/var/www/html/tecmint/** (并要禁用该目录列举): + +``` +$ sudo cp /var/www/html/tecmint/.htaccess /var/www/html/tecmint/.htaccess.orig +``` +然后你就可以在某个特定的目录使用你喜欢的编辑器打开 (或创建) 它,以便修改。并添加以下内容来关闭目录列举。 + +``` +Options -Indexes +``` + +下一步就是重启 Apache Web 服务器: + +``` +-------- 使用 SystemD 的系统 -------- +$ sudo systemctl restart apache2 +$ sudo systemctl restart httpd +-------- 使用 systems 的系统 -------- +$ sudo /etc/init.d/apache2 restart +$ sudo /etc/init.d/httpd restart +``` + +现在来验证效果,在浏览器中输入:**http://www.example.com/tecmint**,你会得打类似如下的信息: + +[![Apache 目录列举已禁用](http://www.tecmint.com/wp-content/uploads/2017/01/Apache-Directory-Listing-Disabled.png)][5] + +Apache 目录列举已禁用 + +至此,文毕。在本文中,我们描述了如何使用 **.htaccess** 文件来禁用 Apache Web 服务器的目录列举。之后我们会介绍两种同样简单的我方法来实现这一相同目的。随时保持联系。 + + +像往常一样,在下方反馈表单中给我们发送关于本文的任何想法。 +-------------- + +作者简介: + +Aaron Kili 是一名 Linux 和 F.O.S.S 忠实拥护者、未来的 Linux 系统管理员、Web 开发者,目前是 TecMint 的原创作者,热衷于计算机并乐于知识分享。 + +------------- + +译者简介: + +[GHLandy](http://GHLandy.com) - 生活中所以欢乐与苦闷都应藏在心中,有些事儿注定无人知晓,自己也无从说起。 + +------------- + +via: http://www.tecmint.com/disable-apache-directory-listing-htaccess/ + +作者:[Aaron Kili][a] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProje) 原创编译,[Linux中国](https://linux.cn) 荣誉推出 diff --git a/translated/tech/20170131 5 DevOps Tools for Logging and Monitoring.md b/translated/tech/20170131 5 DevOps Tools for Logging and Monitoring.md new file mode 100644 index 0000000000..89155f8f56 --- /dev/null +++ b/translated/tech/20170131 5 DevOps Tools for Logging and Monitoring.md @@ -0,0 +1,73 @@ +5 个用于日志记录以及监控的 DevOps 工具 +============================================================ + + + ![DevOps tools](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/devops-logging.jpg?itok=8-1glKie "DevOps tools") +这些 DevOps 日志记录和监控工具是重塑云计算趋势的一部分 - 在“开放云”指南中了解更多。 + +[Creative Commons Zero][1]Pixabay + +在云中,开源工具和应用程序对 DevOps 提高了很多效率,对于日志记录和监视解决方案尤其如此。监控云平台,应用程序和组件以及处理和分析日志对于确保高可用性、高性能、低延迟等至关重要。事实上,RightScale 最近的[云状态调查][4]报告中说,最常见的云优化的行为中,45% 的大公司和中小型企业关注的是监控。 + +然而,专有的记录和监控解决方案是昂贵的。更糟的是,它们通常捆绑更昂贵的管理服务产品。 + +进入强大的开放日志和监控解决方案的新浪潮。其中一些关注于有针对性的任务,例如容器集群的监控和性能分析,而其他作为整体监控和警报工具包,它们能够进行多维度的数据收集和查询。 + +Linux基金会最近[宣布][5]了报告[开放云指导:当前趋势和开源项目][6]。这第三份年度报告全面地介绍了开放云计算的状态,包括有关 DevOps 社区的日志记录和监控的部分。该报告现在可以[下载][7]、汇总和分析研究了,它阐述了容器、监控,更多的是重塑云计算的趋势。该报告提供了对当今开放云环境的中心的分类项目的描述和链接。需要特别注意的是,DevOps 已经成为云中应用交付和维护的最有效方法。 + +在这里的[一系列帖子][8]中,我们按照类别从指南中列出了这些项目,提供了关于整体类别如何发展的额外见解。下面,你将看到一些用于记录和监视的重要 DevOps 工具集合,以及它们所带来的影响,以及它们的 GitHub 链接,这些都是从“开放云”指南收集而来的: + +### 日志记录和监控 + +[Fluentd][9] + +Fluentd 是一个用于统一日志记录层的开源数据收集器,由 Treasure Data 赞助。它将数据结构化为 JSON,以统一处理日志数据的所有方面:在多个源和目标之间收集、过滤、缓冲和输出日志。[Fluentd 的 GitHub][10] + +[Heapster][11] + +Heapster 是 Kubernetes 的一个容器集群监控和性能分析工具。它本身支持 Kubernetes 和 CoreOS,并可以适应在 OpenShift 上运行。它还支持可插拔的存储后端:使用 Grafana 的 InfluxDB、Google Cloud Monitoring、Google Cloud Logging、Hawkular、Riemann 和 Kafka。[Heapster 的 GitHub][12] + +[Logstash][13] + +Logstash 是 Elastic 的开源数据管道,用于帮助处理来自各种系统的日志和其他事件数据。它的插件可以连接到各种源和大规模流数据到中央分析系统。[LogStash 的 GitHub][14] + +[Prometheus][15] + +Prometheus 是一个开源系统监控和警报工具包,最初由 SoundCloud 构建,现在是 Linux 基金会的云计算基础项目。它适用于以机器为中心和微服务架构,并支持多维度数据收集和查询。[Prometheus 的 GitHub][16] + + +[Weave Scope][17] + +Weave Scope 是 Weaveworks 的开源工具,用于实时监控分布式应用程序及其容器。它与 Kubernetes 和 AWS ECS 集成。[Weave Scope 的 GitHub][18] + +_了解更多关于开源云计算的趋势,并查看顶级开源云计算项目的完整列表。[现在下载 Linux 基金会的开放云报告指南][3]! _ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/open-cloud-report/2016/5-devops-tools-logging-and-monitoring + +作者:[SAM DEAN][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/sam-dean +[1]:https://www.linux.com/licenses/category/creative-commons-zero +[2]:https://www.linux.com/files/images/devops-loggingjpg +[3]:http://bit.ly/2eHQOwy +[4]:http://www.rightscale.com/blog/cloud-industry-insights/cloud-computing-trends-2016-state-cloud-survey +[5]:https://www.linux.com/blog/linux-foundation-issues-2016-guide-open-source-cloud-projects +[6]:http://go.linuxfoundation.org/l/6342/2016-10-31/3krbjr?utm_source=press-release&utm_medium=pr&utm_campaign=open-cloud-report-2016 +[7]:http://go.linuxfoundation.org/l/6342/2016-10-31/3krbjr +[8]:https://www.linux.com/news/open-cloud-report/2016/guide-open-cloud-state-micro-oses +[9]:http://www.fluentd.org/ +[10]:https://github.com/fluent +[11]:http://blog.kubernetes.io/2015/05/resource-usage-monitoring-kubernetes.html +[12]:https://github.com/kubernetes/heapster +[13]:https://www.elastic.co/products/logstash +[14]:https://github.com/elastic/logstash +[15]:https://prometheus.io/ +[16]:https://github.com/prometheus +[17]:https://www.weave.works/products/weave-scope/ +[18]:https://github.com/weaveworks/scope diff --git a/translated/tech/20170131 5 new guides for working with OpenStack.md b/translated/tech/20170131 5 new guides for working with OpenStack.md new file mode 100644 index 0000000000..9443ae62c8 --- /dev/null +++ b/translated/tech/20170131 5 new guides for working with OpenStack.md @@ -0,0 +1,55 @@ +5 个新的使用 OpenStack 指南 +============================================================ + + ![OpenStack tutorials](https://opensource.com/sites/default/files/styles/image-full-size/public/images/education/rh_003588_01_rd3os.combacktoschoolserieshe_rh_051x_0.png?itok=Tm2UcSXw "OpenStack tutorials") +图片提供:opensource.com + +OpenStack 经验仍然是技术世界中最需要的技能,越来越多的组织正在寻求构建和管理自己的开源云。但是 OpenStack 是一个巨大的知识领域,包含了十几个正在积极开发的单独项目。只是保持更新你的技能仍可能是一个挑战。 + +好消息是现在有很多资源可以让你跟上。除了[官方项目文档][9],各种培训和认证程序、印刷指南和其他资源,还有大量的由 OpenStack 社区成员编写并发布在各种博客和线上出版物上的教程和指南。 + +在 Opensource.com,我们每个月都会收集这些社区创建的资源中的最好的资源,并将它们放到一个集锦中。这是我们上个月的内容。 + +* 这次是来自 Julie Pichon 对[ Mistral 在 TripleO 中的使用][1]的一个快速介绍。Mistral 是一个工作流服务,允许你设置一个多步过程自动化和异步协调操作。在本快速指南中学习 Mistral 的基础知识、它如何工作,以及如何在 TripleO 中使用它。 + +* 想深入了解 TripleO 来使用 OpenStack 自己的一套工具来管理 OpenStack 部署么?你会想看看这[一套为那些在 OpenStack 设置中使用 TripleO 写的 cheatsheets][2]。这是一个正在进行的工作,所以如果你还想包含什么,欢迎随时自由贡献。 + +* 完成我们的 TripleO 指南,不要错过这个[快速指南][3]来使用 TripleO 设置独立的 Ceph 部署。它所需要的是一个简短的 YAML 文件和一个简单的命令。 + +* 接下来,如果你是一个 OpenStack 贡献者,你可能会熟悉[ Grafana 面板][4],它显示了 OpenStack 持续集成基础设施的各种指标。有没有想过这个服务如何工作,或想创建一个新的指标到面板上?学习[如何创建][5]你自己的本地面板的副本,它用于测试目的,所以你可以玩弄它,并创建自己的修改。 + +* 有没有想过 OpenStack 云上的网络发生了什么?OpenStack 经常使用[ Open vSwitch ][6]用于 Neutron 和 Nova 的网络服务;在[这个演练][7]中学习设置的基础。 + +* * * + +这次就是这样了。和往常一样,请务必查看我们完整的[ OpenStack 教程][10],它汇集了过去三年发布的数百个单独的指南。 + +-------------------------------------------------------------------------------- + +作者简介: + +Jason Baker - Jason 热衷于使用技术使世界更加开放,从软件开发到给当地政府带来阳光。Linux 桌面爱好者。地图/地理空间书呆子。树莓派工匠。数据分析和可视化 geek。偶尔的码农。 云本土主义者。在 Twitter 上关注他。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/openstack-tutorials + +作者:[Jason Baker][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker +[1]:http://www.jpichon.net/blog/2016/12/quick-introduction-mistral-tripleo/ +[2]:http://www.anstack.com/blog/2016/12/16/printing-tripleo-cheat-sheet.html +[3]:http://giuliofidente.com/2016/12/tripleo-to-deploy-ceph-standlone.html +[4]:http://grafana.openstack.org/ +[5]:http://blog.cafarelli.fr/2016/12/local-testing-of-openstack-grafana-dashboard-changes/ +[6]:http://openvswitch.org/ +[7]:http://superuser.openstack.org/articles/openvswitch-openstack-sdn/ +[8]:https://opensource.com/article/17/1/openstack-tutorials?rate=q5H-KT2pm4NLExRhlHc0ru2dyjLkTSA45wim_2KtIec +[9]:http://docs.openstack.org/ +[10]:https://opensource.com/resources/openstack-tutorials +[11]:https://opensource.com/user/19894/feed +[12]:https://opensource.com/users/jason-baker diff --git a/translated/tech/LXD/Part 11 - LXD 2.0--LXD and Juju.md b/translated/tech/LXD/Part 11 - LXD 2.0--LXD and OpenStack.md similarity index 100% rename from translated/tech/LXD/Part 11 - LXD 2.0--LXD and Juju.md rename to translated/tech/LXD/Part 11 - LXD 2.0--LXD and OpenStack.md diff --git a/translated/tech/Tmux_doc_cn.md b/translated/tech/Tmux_doc_cn.md index 5d2ac507c2..4d94302414 100644 --- a/translated/tech/Tmux_doc_cn.md +++ b/translated/tech/Tmux_doc_cn.md @@ -1,3 +1,5 @@ +校对中 + - [名称](#名称) - [用法](#用法) - [描述](#描述)