mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-12 01:40:10 +08:00
commit
441b796fa2
@ -0,0 +1,38 @@
|
||||
有理想,有追求的系统管理员会在 Linux 中成长
|
||||
===============================================
|
||||
|
||||

|
||||
|
||||
我第一次看到运行着的 Linux 操作系统是在我的首份工作时,大约是在 2001 年。当时我在澳大利亚的一家汽车业供应商担任客户经理,和公司的 IT 工程师共用一间办公室。他做了一台 CD 刻录工作站(一个可以同时刻录好几张 CD 的巨大的东西),然后我们可以把汽车零配件目录刻录到 CD 并送给客户。刻录工作站最初是为 Windows 设计的,但是他一直没能让刻录机正常工作。最终他放弃在 Windows 上使用的念头并且换成在 Linux 上使用,刻录机完美工作了。
|
||||
|
||||
对我来说,Linux 的一切都是晦涩难懂的。大部分工作都在看起来像 DOS(LCTT 译注:磁盘操作系统,早期的个人电脑操作系统) 的命令行下完成,但它更加强大(后来我才认识到这一点)。我从 1993 年就开始使用 Mac 电脑,在那个时候,在我看来命令行界面有点过时了。
|
||||
|
||||
直到几年后——我记得是 2009 年,我才真正的认识 Linux。那时我已经移民荷兰并且在一家零售供应商那里找到了工作。那是一个只有 20 人的小公司,我除了做一个关键客户经理的正常工作,还无意间成了个一线 IT 技术支持。只要东西有了故障,他们总是会在花大价钱请外部 IT 顾问之前先来询问我。
|
||||
|
||||
我的一个同事因为点击了一封似乎来自 DHL(LCTT 译注:全球著名的邮递和物流集团 Deutsche Post DHL 旗下公司) 的电子邮件所附带的一个 .exe 文件而受到了一次网络钓鱼攻击。(是的,这的确发生了。)他的电脑被完全入侵了,他什么事都做不了。甚至完全格式化电脑都不起作用,好像病毒只靠它丑陋的脑袋就能活下来。我在后来才了解到这种情况可能是病毒被复制到了 MBR(主引导记录)里。而此时,为了节约成本,公司已经终止了和外部 IT 顾问的合同。
|
||||
|
||||
于是我帮助同事安装了 Ubuntu 操作系统让他继续工作,这的确很有效。他的电脑再次嗡嗡的运转了,而且我找到了他们工作必需的所有应用。我承认,从某些方面来说这不是最优雅的解决方案,不过他(包括我)喜欢这个操作系统的流畅度和稳定性。
|
||||
|
||||
然而我的同事在 Windows 世界形成的观念根深蒂固,他无法习惯新的使用方式,开始不停的抱怨。(很耳熟吧?)
|
||||
|
||||
虽然我的同事不能忍受新的使用方式,但我发现到这对我这个 Mac 用户已经不是一个问题。它们之间有很多相似点,我被迷住了。所以我在我工作用的笔记本电脑上又安装了一个 Ubuntu 组成双系统,我的工作效率提高了,让机器做我想做的事也变得更容易。从那时起我有规律的使用了几个 Linux 发行版,但我最喜欢 Ubuntu 和 Elementary。
|
||||
|
||||
当时我失业了,因此我有大量的时间给自己充电。由于我一直对 IT 行业很感兴趣,所以我致力于研究对 Linux 操作系统的管理。但是目前得到一个展示学识的机会太难了,因为我多年来所学的 95% 都不能简单的通过邮寄一份简历展示出来。我需要一个入职面试来展示我所知道的东西,所以我进行了 Linux 认证得到证书,希望能给我一些帮助。
|
||||
|
||||
我对开源做贡献已经有好一阵子了。刚开始时是为 xTuple ERP(LCTT 译注:世界领先的开源 ERP 软件)做翻译工作(英语译德语),现在已经转为在 Twitter 上做 Mozilla 的“客户服务”,提交 bug 报告等。我为自由和开源软件做推广宣传(取得了不同程度的成功)并且尽我所能在财政方面支持一些 FOSS(LCTT 译注:自由及开源软件)倡导组织(DuckDuckGo、bof.nl、EFF、GIMP、LibreCAD、维基百科以及其他)。目前我也在准备设立一个本地的隐私咖啡馆(LCTT 译注:这是荷兰的一个旨在强化网上个人隐私安全的咖啡馆/志愿者组织,参见: https://privacycafe.bof.nl/)。
|
||||
|
||||
除此之外,我已经开始写我的第一本书。这应该是一本涉及计算机隐私和安全领域的简易实用手册,适用于普通计算机用户,我希望它能在今年年底自主出版。(这本书遵循知识共享许可协议 CC。)至于这本书的内容,正如你预料的那样我会详细解释为什么隐私如此重要,以及“我没有什么需要隐藏“这种思想错的有多么离谱。但是最主要的部分还是指导读者如何避免让人讨厌的广告追踪,加密你的硬盘和邮件,通过 OTR(LCTT 译注:一种安全协议,为即时通讯提供加密保护)网上聊天,如何使用 TOR(LCTT 译注:第二代洋葱路由,可以在因特网上进行匿名交流)等等。虽然起初说这是一个手册,但我尽量会使用随和的语调来叙述,并且会根据精彩的我亲身经历的故事让它更加通俗易懂。
|
||||
|
||||
我依然爱着我所有的 Mac,只要买得起(主要因为它那伟大的构造),我还会使用它们,但是我的 Linux 一直在虚拟机里完成我的几乎所有的日常工作。没有什么不可思议的,不是自夸:文档编辑(LibreOffice 和 Scribus),建立我的网页和博客(Wordpress 和 Jekyll),编辑图片(Shotwell 和 Gimp),听音乐(Rhythmbox),以及几乎其他任何工作。
|
||||
|
||||
不论我最后怎么找到工作,Linux 永远都是我必用的操作系统。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/life/16/5/my-linux-story-rene-raggl
|
||||
|
||||
作者:[Rene Raggl][a]
|
||||
译者:[fuowang](https://github.com/fuowang)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
[a]: https://opensource.com/users/rraggl
|
103
published/20160811 5 best linux init system.md
Normal file
103
published/20160811 5 best linux init system.md
Normal file
@ -0,0 +1,103 @@
|
||||
现代 Linux 的五大初始化系统(1992-2015)
|
||||
============================================
|
||||
|
||||
在 Linux 和其他类 Uniux 系统中,init(初始化)进程是系统启动时由内核执行的第一个进程,其进程 ID(PID)为 1,并静默运行在后台,直到系统关闭。
|
||||
|
||||
init 进程负责启动其他所有的进程,比如守护进程、服务和其他后台进程,因此,它是系统中其它所有进程之母(偏偏叫做“父进程”)。某个进程可以启动许多个子进程,但在这个过程中,某个子进程的父进程结束之后,该子进程的父进程会变成 init 进程。
|
||||
|
||||

|
||||
|
||||
这么多年过去了,许多的初始化系统在主流 Linux 脱颖而出,和本文中,我将你来看看在 Linux 操作系统最好的初始化系统。
|
||||
|
||||
### 1. System V Init
|
||||
|
||||
System V (SysV) 是一个在类 Unix 系统中最为成熟而且大受欢迎的初始化方案,是 Unix/Linux 系统中所有进程的父进程。SysV 是第一个商业 Unix 系统设计的初始化方案。
|
||||
|
||||
除了 Gentoo 使用自主的初始化系统、Slackware 使用 BSD 风格的初始化方案外,几乎所有的 Linux 发行版都率先使用 SysV 作为初始化方案。
|
||||
|
||||
随着时间的推移,由于一些设计上的缺陷,有几个 SysV 初始化替换方案已经开发出来,用以为 Linux 创建更加高效和完美的初始化系统。
|
||||
|
||||
尽管这些替代方案都超越了 SysV 并提供了更多新特性,但它们仍然和原始 SysV 初始化脚本保持兼容。
|
||||
|
||||
### 2. SystemD
|
||||
|
||||
SystemD 是一个 Linux 平台中相对较新的初始化方案。它由 Fedora 15 引入,集成了各类工具以便更好的管理系统。主要目的是:系统初始化、管理和跟踪引导进程中和系统运行时所有的系统进程。
|
||||
|
||||
Systemd 全面有别于其他传统的 Unix 初始化系统,特别是在启动系统和服务管理方面。它同样兼容 SysV 和 LBS 初始化脚本。
|
||||
|
||||
其中较为突出的特性如下:
|
||||
|
||||
- 纯粹、简单、高效的设计
|
||||
- 启动时的并发和并行处理
|
||||
- 更好的 API
|
||||
- 开启可选进程的移除功能
|
||||
- 使用 journald 来支持事件日志
|
||||
- 使用 systemd calender timers 来支持任务计划
|
||||
- 以二进制文件存储日志
|
||||
- 保存 systemd 的状态以待今后查看
|
||||
- 与 GNOME 更好整合实现等
|
||||
|
||||
查看 Systemd 初始化系统简介:<https://fedoraproject.org/wiki/Systemd>
|
||||
|
||||
### 3. Upstart
|
||||
|
||||
Upstart 是一个基于事件的初始化系统,由 Ubuntu 的制作团队开发的,用以替代 SysV。它可以启动不同的系统任务和进程、在系统运行时校验进程并在系统关闭时结束进程。
|
||||
|
||||
它是一个使用 SysV 和 Systemd 启动脚本的混合初始化系统,Upstart 中值得一提的特性如下:
|
||||
|
||||
- Ubuntu 的原生初始化系统,但可以运行在其他所有的发行版中
|
||||
- 基于事件启动/结束的任务和服务
|
||||
- 启动/结束任务和服务时生成事件
|
||||
- 可以由其他系统进程发送事件
|
||||
- 使用 D-Bus 和 init 进程通信
|
||||
- 用户可以启动/结束其各自的进程
|
||||
- 可以再现崩溃的进程等
|
||||
|
||||
访问 Upstart 主页:<http://upstart.ubuntu.com/index.html>
|
||||
|
||||
### 4. OpenRC
|
||||
|
||||
OpenRC 是一个基于依赖关系的类 Unix 系统初始化方案,兼容 SysV。基本可以说是 SysV 的升级版,但必须要清楚记住的是:OpenRC 并非只是完全替代 /sbin/init 文件。
|
||||
|
||||
它所提供的出色特性如下:
|
||||
|
||||
- 可运行在包括 Gentoo 和 BSD 在内的多数 Linux 系统之中
|
||||
- 支持硬件触发的初始化脚本(LCTT 译注:如硬件热插拔所触发的)
|
||||
- 支持单个配置文件
|
||||
- 不支持单个服务配置文件
|
||||
- 以守护进程的方式运行
|
||||
- 并行服务启动等
|
||||
|
||||
访问 OpenRC 主页:<https://wiki.gentoo.org/wiki/OpenRC>
|
||||
|
||||
### 5. runit
|
||||
|
||||
runit 同样是一个跨平台初始化系统,可以运行在 GNU/Linux、Solaris、BSD 和 Mac OS X 中,用替代 SysV,同时提供服务监控。
|
||||
|
||||
相比于 SysV 和其他 Linux 初始化系统,它提供了一些好用和卓越的组件,如下:
|
||||
|
||||
- 服务监控:每个服务都关联一个服务目录
|
||||
- 清理进程状态,以保证每个进程处于干净状态
|
||||
- 可靠的日志机制
|
||||
- 快速的系统启动和关闭
|
||||
- 可移植
|
||||
- 打包方便
|
||||
- 代码体积小等
|
||||
|
||||
访问 runit 主页:<http://smarden.org/runit/>
|
||||
|
||||
正如我之前所说的,Linux 中的初始化系统负责启动和管理所有的进程。此外,SysV 是 Linux 系统中主要的初始化系统,但由于一些性能缺陷,系统开发者已经开发出几个替代品。
|
||||
|
||||
在这里,我已经介绍了几个可用的替代方案,但你可能觉得有一些其他的初始化系统值得在此提及。请在下方的评论区将你的想法告诉我们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/best-linux-init-systems/
|
||||
|
||||
作者:[Aaron Kili](http://www.tecmint.com/author/aaronkili/)
|
||||
译者:[GHLandy](https://github.com/GHLandy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
|
68
published/20160921 Rust meets Fedora.md
Normal file
68
published/20160921 Rust meets Fedora.md
Normal file
@ -0,0 +1,68 @@
|
||||
当 Rust 遇上 Fedora
|
||||
=============
|
||||
|
||||

|
||||
|
||||
### Rust 是什么?
|
||||
|
||||
Rust 是一种系统编程语言,它运行速度惊人,并且可以避免几乎所有的崩溃、[内存区块错误](https://wikipedia.org/wiki/Segmentation_fault) 以及数据竞争。你也许会质疑为什么我们还需要又一种这样的语言,因为已经有很多同类的语言了。这篇文章将会告诉你为什么。
|
||||
|
||||
### 安全性 vs. 控制权
|
||||
|
||||

|
||||
|
||||
你也许见过上面的图谱。一边是 C/C++,对运行的硬件拥有更多的控制权,因此它可以让开发者通过对所生成的机器代码进行更精细的控制来优化性能。然而这不是很安全,这很容易造成内存区块错误以及像 [心血漏洞](https://fedoramagazine.org/update-on-cve-2014-0160-aka-heartbleed/) 这样的安全漏洞。
|
||||
|
||||
另一边是像 Python、Ruby 和 JavaScript 这种没有给予开发者多少控制权但是可以创建出更安全的代码的语言。虽然这些代码可以生成相当安全并且可控的异常,但是它们不会造成内存区块错误。
|
||||
|
||||
在图谱中间的区域是 Java 和一些其它混合了这些特性的语言。它们提供对运行的硬件部分控制权,并且尝试尽量减少漏洞的出现。
|
||||
|
||||
Rust 有点不太一样,它并没有出现在这个图谱上。它同时提供给开发者安全性和控制权。
|
||||
|
||||
### Rust 的特性
|
||||
|
||||
Rust 是一种像 C/C++ 一样的系统编程语言,除此之外它还给予开发者对内存分配细粒度的控制。它不需要垃圾回收器。它的运行环境(runtime)很小,运行速度接近于在裸机上的运行。它为开发者提供了代码性能更大的保证。此外,任何了解 C/C++ 的人都能读懂以及编写 Rust 的代码。
|
||||
|
||||
Rust 的运行速度非常快,因为它是一种编译语言。它使用 LLVM 作为编译器的后端,并且还可以利用一大堆优化。在许多领域,它的性能都要高于 C/C++。它像 JavaScript、Ruby 和 Python 一样,与生俱来就是安全的,这意味着它们不会造成内存区块错误、野指针(dangling pointers)或者空指针(null pointers)。
|
||||
|
||||
另外一个很重要的特性就是消除数据竞争。如今,大多数计算机都具有多个核心,许多线程并发运行。然而,开发者很难编写好的并行代码,因此这个特性除去了他们的后顾之忧。Rust 使用两个关键概念来消除数据竞争:
|
||||
|
||||
* 所有权(Ownership)。每一个变量都被移动到一个新的位置,并防止通过先前的位置来引用它。每一个数据块只有一个所有者。
|
||||
* 借用(Borrowing)。被拥有的值可以借用,以允许在一段时间内使用。
|
||||
|
||||
### 在 Fedora 24 和 25 上使用 Rust
|
||||
|
||||
若要开始使用,只需安装软件包:
|
||||
|
||||
```
|
||||
sudo dnf install rust
|
||||
```
|
||||
|
||||
```
|
||||
fn main() {
|
||||
println!("Hello, Rust is running on Fedora 25 Alpha!");
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
rustc helloworld.rs
|
||||
./helloworld
|
||||
```
|
||||
|
||||
在 Fedora 上执行以下命令来安装最新的测试版本:
|
||||
|
||||
```
|
||||
sudo dnf --enablerepo=updates-testing --refresh --best install rust
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/rust-meets-fedora/
|
||||
|
||||
作者:[Sumantro Mukherjee][a]
|
||||
译者:[OneNewLife](https://github.com/OneNewLife)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/sumantrom/
|
@ -0,0 +1,30 @@
|
||||
概览最有前景的下一代嵌入式 Linux 软件更新机制
|
||||
===============
|
||||
|
||||

|
||||
|
||||
随着像 APT 和 Yum 等传统包管理解决方案渐渐老去,并且不适用于嵌入式和 IoT 等 Linux 的大量新兴领域,新一代的基于原子化的 Linux 软件升级方案应运而生。Konsulko Group 的 Matt Porter 在本周的 2016 年欧洲嵌入式 Linux 峰会(LCTT 译注:于 2016 年 10 月 11-13 日在德国柏林召开)为大家对比了这些新技术的不同点。
|
||||
|
||||
目前已有多个 Linux 软件商使用增量原子更新方式来传递更可靠的发行版更新,通过二进制差异实现更小体积的更新,假如出现意外状况也运行回退。这些新的发行版升级机制包含了 SWUpdate、Mender、OSTree 和 swupd。但有趣的是,幻灯片之中并没有提及 Ubuntu 的 Snappy。
|
||||
|
||||
SWUpdate 一种单/双镜像的模块化升级框架,支持镜像签名、可以使用 Kconfig 来进行配置、能够处理本地或者远程升级等。[SWUpdate](https://github.com/sbabic/swupdate) 简直就是为嵌入式系统设计的。
|
||||
|
||||
而 [Mender](https://github.com/mendersoftware/mender) 则是以无线传输进行升级位目标的升级方案。它是用 Go 编程语言编写的双镜像升级框架。
|
||||
|
||||
[OSTree](https://github.com/ostreedev/ostree) 是此次增量原子升级方案演示中最有名气的,它类似于 Git。Fedora 和 RedHat 都有它的身影,甚至 Gnome 的 Flatpak 容器系统也使用了 OSTree。
|
||||
|
||||
Swupd 是最后展示的一个升级系统,是由 Intel 的 Clear Linux 发行版率先使用的升级方案。它的代码放在 [GitHub](https://github.com/clearlinux/swupd-client),而它的客户端和服务端则由 Clear Linux 托管。Swupd 与 OSTree 相似,但它不必重启就可以启用更新。
|
||||
|
||||
而那些在本次柏林召开的欧洲嵌入式 Linux 峰会中没有提及的,你也可以访问 [这些 PDF 讲演稿](http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies.pdf) 来了解这些专注于嵌入式 Linux 的软件更新机制。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://phoronix.com/scan.php?page=news_item&px=ELC2016-Software-Updates
|
||||
|
||||
作者:[Michael Larabel][a]
|
||||
译者:[GHLandy](https://github.com/GHLandy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.michaellarabel.com/
|
@ -1,192 +0,0 @@
|
||||
Editing by FrankXinqi
|
||||
|
||||
Linux vs. Windows device driver model : architecture, APIs and build environment comparison
|
||||
============================================================================================
|
||||
|
||||
Device drivers are parts of the operating system that facilitate usage of hardware devices via certain programming interface so that software applications can control and operate the devices. As each driver is specific to a particular operating system, you need separate Linux, Windows, or Unix device drivers to enable the use of your device on different computers. This is why when hiring a driver developer or choosing an R&D service provider, it is important to look at their experience of developing drivers for various operating system platforms.
|
||||
|
||||

|
||||
|
||||
The first step in driver development is to understand the differences in the way each operating system handles its drivers, underlying driver model and architecture it uses, as well as available development tools. For example, Linux driver model is very different from the Windows one. While Windows facilitates separation of the driver development and OS development and combines drivers and OS via a set of ABI calls, Linux device driver development does not rely on any stable ABI or API, with the driver code instead being incorporated into the kernel. Each of these models has its own set of advantages and drawbacks, but it is important to know them all if you want to provide a comprehensive support for your device.
|
||||
|
||||
In this article we will compare Windows and Linux device drivers and explore the differences in terms of their architecture, APIs, build development, and distribution, in hopes of providing you with an insight on how to start writing device drivers for each of these operating systems.
|
||||
|
||||
### 1. Device Driver Architecture
|
||||
|
||||
Windows device driver architecture is different from the one used in Linux drivers, with either of them having their own pros and cons. Differences are mainly influenced by the fact that Windows is a closed-source OS while Linux is open-source. Comparison of the Linux and Windows device driver architectures will help us understand the core differences behind Windows and Linux drivers.
|
||||
|
||||
#### 1.1. Windows driver architecture
|
||||
|
||||
While Linux kernel is distributed with drivers themselves, Windows kernel does not include device drivers. Instead, modern Windows device drivers are written using the Windows Driver Model (WDM) which fully supports plug-and-play and power management so that the drivers can be loaded and unloaded as necessary.
|
||||
|
||||
Requests from applications are handled by a part of Windows kernel called IO manager which transforms them into IO Request Packets (IRPs) which are used to identify the request and convey data between driver layers.
|
||||
|
||||
WDM provides three kinds of drivers, which form three layers:
|
||||
|
||||
- Filter drivers provide optional additional processing of IRPs.
|
||||
- Function drivers are the main drivers that implement interfaces to individual devices.
|
||||
- Bus drivers service various adapters and bus controllers that host devices.
|
||||
|
||||
An IRP passes these layers as it travels from the IO manager down to the hardware. Each layer can handle an IRP by itself and send it back to the IO manager. At the bottom there is Hardware Abstraction Layer (HAL) which provides a common interface to physical devices.
|
||||
|
||||
#### 1.2. Linux driver architecture
|
||||
|
||||
The core difference in Linux device driver architecture as compared to the Windows one is that Linux does not have a standard driver model or a clean separation into layers. Each device driver is usually implemented as a module that can be loaded and unloaded into the kernel dynamically. Linux provides means for plug-and-play support and power management so that drivers can use them to manage devices correctly, but this is not a requirement.
|
||||
|
||||
Modules export functions they provide and communicate by calling these functions and passing around arbitrary data structures. Requests from user applications come from the filesystem or networking level, and are converted into data structures as necessary. Modules can be stacked into layers, processing requests one after another, with some modules providing a common interface to a device family such as USB devices.
|
||||
|
||||
Linux device drivers support three kinds of devices:
|
||||
|
||||
- Character devices which implement a byte stream interface.
|
||||
- Block devices which host filesystems and perform IO with multibyte blocks of data.
|
||||
- Network interfaces which are used for transferring data packets through the network.
|
||||
|
||||
Linux also has a Hardware Abstraction Layer that acts as an interface to the actual hardware for the device drivers.
|
||||
|
||||
### 2. Device Driver APIs
|
||||
|
||||
Both Linux and Windows driver APIs are event-driven: the driver code executes only when some event happens: either when user applications want something from the device, or when the device has something to tell to the OS.
|
||||
|
||||
#### 2.1. Initialization
|
||||
|
||||
On Windows, drivers are represented by a DriverObject structure which is initialized during the execution of the DriverEntry function. This entry point also registers a number of callbacks to react to device addition and removal, driver unloading, and handling the incoming IRPs. Windows creates a device object when a device is connected, and this device object handles all application requests on behalf of the device driver.
|
||||
|
||||
As compared to Windows, Linux device driver lifetime is managed by kernel module's module_init and module_exit functions, which are called when the module is loaded or unloaded. They are responsible for registering the module to handle device requests using the internal kernel interfaces. The module has to create a device file (or a network interface), specify a numerical identifier of the device it wishes to manage, and register a number of callbacks to be called when the user interacts with the device file.
|
||||
|
||||
#### 2.2. Naming and claiming devices
|
||||
|
||||
##### **Registering devices on Windows**
|
||||
|
||||
Windows device driver is notified about newly connected devices in its AddDevice callback. It then proceeds to create a device object used to identify this particular driver instance for the device. Depending on the driver kind, device object can be a Physical Device Object (PDO), Function Device Object (FDO), or a Filter Device Object (FIDO). Device objects can be stacked, with a PDO in the bottom.
|
||||
|
||||
Device objects exist for the whole time the device is connected to the computer. DeviceExtension structure can be used to associate global data with a device object.
|
||||
|
||||
Device objects can have names of the form **\Device\DeviceName**, which are used by the system to identify and locate them. An application opens a file with such name using CreateFile API function, obtaining a handle, which then can be used to interact with the device.
|
||||
|
||||
However, usually only PDOs have distinct names. Unnamed devices can be accessed via device class interfaces. The device driver registers one or more interfaces identified by 128-bit globally unique identifiers (GUIDs). User applications can then obtain a handle to such device using known GUIDs.
|
||||
|
||||
##### **Registering devices on Linux**
|
||||
|
||||
On Linux user applications access the devices via file system entries, usually located in the /dev directory. The module creates all necessary entries during module initialization by calling kernel functions like register_chrdev. An application issues an open system call to obtain a file descriptor, which is then used to interact with the device. This call (and further system calls with the returned descriptor like read, write, or close) are then dispatched to callback functions installed by the module into structures like file_operations or block_device_operations.
|
||||
|
||||
The device driver module is responsible for allocating and maintaining any data structures necessary for its operation. A file structure passed into the file system callbacks has a private_data field, which can be used to store a pointer to driver-specific data. The block device and network interface APIs also provide similar fields.
|
||||
|
||||
While applications use file system nodes to locate devices, Linux uses a concept of major and minor numbers to identify devices and their drivers internally. A major number is used to identify device drivers, while a minor number is used by the driver to identify devices managed by it. The driver has to register itself in order to manage one or more fixed major numbers, or ask the system to allocate some unused number for it.
|
||||
|
||||
Currently, Linux uses 32-bit values for major-minor pairs, with 12 bits allocated for the major number allowing up to 4096 distinct drivers. The major-minor pairs are distinct for character and block devices, so a character device and a block device can use the same pair without conflicts. Network interfaces are identified by symbolic names like eth0, which are again distinct from major-minor numbers of both character and block devices.
|
||||
|
||||
#### 2.3. Exchanging data
|
||||
|
||||
Both Linux and Windows support three ways of transferring data between user-level applications and kernel-level drivers:
|
||||
|
||||
- **Buffered Input-Output** which uses buffers managed by the kernel. For write operations the kernel copies data from a user-space buffer into a kernel-allocated buffer, and passes it to the device driver. Reads are the same, with kernel copying data from a kernel buffer into the buffer provided by the application.
|
||||
- **Direct Input-Output** which does not involve copying. Instead, the kernel pins a user-allocated buffer in physical memory so that it remains there without being swapped out while data transfer is in progress.
|
||||
- **Memory mapping** can also be arranged by the kernel so that the kernel and user space applications can access the same pages of memory using distinct addresses.
|
||||
|
||||
##### **Driver IO modes on Windows**
|
||||
|
||||
Support for Buffered IO is a built-in feature of WDM. The buffer is accessible to the device driver via the AssociatedIrp.SystemBuffer field of the IRP structure. The driver simply reads from or writes to this buffer when it needs to communicate with the userspace.
|
||||
|
||||
Direct IO on Windows is mediated by memory descriptor lists (MDLs). These are semi-opaque structures accessible via MdlAddress field of the IRP. They are used to locate the physical address of the buffer allocated by the user application and pinned for the duration of the IO request.
|
||||
|
||||
The third option for data transfer on Windows is called METHOD_NEITHER. In this case the kernel simply passes the virtual addresses of user-space input and output buffers to the driver, without validating them or ensuring that they are mapped into physical memory accessible by the device driver. The device driver is responsible for handling the details of the data transfer.
|
||||
|
||||
##### **Driver IO modes on Linux**
|
||||
|
||||
Linux provides a number of functions like clear_user, copy_to_user, strncpy_from_user, and some others to perform buffered data transfers between the kernel and user memory. These functions validate pointers to data buffers and handle all details of the data transfer by safely copying the data buffer between memory regions.
|
||||
|
||||
However, drivers for block devices operate on entire data blocks of known size, which can be simply moved between the kernel and user address spaces without copying them. This case is automatically handled by Linux kernel for all block device drivers. The block request queue takes care of transferring data blocks without excess copying, and Linux system call interface takes care of converting file system requests into block requests.
|
||||
|
||||
Finally, the device driver can allocate some memory pages from kernel address space (which is non-swappable) and then use the remap_pfn_range function to map the pages directly into the address space of the user process. The application can then obtain the virtual address of this buffer and use it to communicate with the device driver.
|
||||
|
||||
### 3. Device Driver Development Environment
|
||||
|
||||
#### 3.1. Device driver frameworks
|
||||
|
||||
##### **Windows Driver Kit**
|
||||
|
||||
Windows is a closed-source operating system. Microsoft provides a Windows Driver Kit to facilitate Windows device driver development by non-Microsoft vendors. The kit contains all that is necessary to build, debug, verify, and package device drivers for Windows.
|
||||
|
||||
Windows Driver Model defines a clean interface framework for device drivers. Windows maintains source and binary compatibility of these interfaces. Compiled WDM drivers are generally forward-compatible: that is, an older driver can run on a newer system as is, without being recompiled, but of course it will not have access to the new features provided by the OS. However, drivers are not guaranteed to be backward-compatible.
|
||||
|
||||
##### **Linux source code**
|
||||
|
||||
In comparison to Windows, Linux is an open-source operating system, thus the entire source code of Linux is the SDK for driver development. There is no formal framework for device drivers, but Linux kernel includes numerous subsystems that provide common services like driver registration. The interfaces to these subsystems are described in kernel header files.
|
||||
|
||||
While Linux does have defined interfaces, these interfaces are not stable by design. Linux does not provide any guarantees about forward or backward compatibility. Device drivers are required to be recompiled to work with different kernel versions. No stability guarantees allow rapid development of Linux kernel as developers do not have to support older interfaces and can use the best approach to solve the problems at hand.
|
||||
|
||||
Such ever-changing environment does not pose any problems when writing in-tree drivers for Linux, as they are a part of the kernel source, because they are updated along with the kernel itself. However, closed-source drivers must be developed separately, out-of-tree, and they must be maintained to support different kernel versions. Thus Linux encourages device driver developers to maintain their drivers in-tree.
|
||||
|
||||
#### 3.2. Build system for device drivers
|
||||
|
||||
Windows Driver Kit adds driver development support for Microsoft Visual Studio, and includes a compiler used to build the driver code. Developing Windows device drivers is not much different from developing a user-space application in an IDE. Microsoft also provides an Enterprise Windows Driver Kit, which enables command-line build environment similar to the one of Linux.
|
||||
|
||||
Linux uses Makefiles as a build system for both in-tree and out-of-tree device drivers. Linux build system is quite developed and usually a device driver needs no more than a handful of lines to produce a working binary. Developers can use any [IDE][5] as long as it can handle Linux source code base and run make, or they can easily compile drivers manually from terminal.
|
||||
|
||||
#### 3.3. Documentation support
|
||||
|
||||
Windows has excellent documentation support for driver development. Windows Driver Kit includes documentation and sample driver code, abundant information about kernel interfaces is available via MSDN, and there exist numerous reference and guide books on driver development and Windows internals.
|
||||
|
||||
Linux documentation is not as descriptive, but this is alleviated with the whole source code of Linux being available to driver developers. The Documentation directory in the source tree documents some of the Linux subsystems, but there are [multiple books][4] concerning Linux device driver development and Linux kernel overviews, which are much more elaborate.
|
||||
|
||||
Linux does not provide designated samples of device drivers, but the source code of existing production drivers is available and can be used as a reference for developing new device drivers.
|
||||
|
||||
#### 3.4. Debugging support
|
||||
|
||||
Both Linux and Windows have logging facilities that can be used to trace-debug driver code. On Windows one would use DbgPrint function for this, while on Linux the function is called printk. However, not every problem can be resolved by using only logging and source code. Sometimes breakpoints are more useful as they allow to examine the dynamic behavior of the driver code. Interactive debugging is also essential for studying the reasons of crashes.
|
||||
|
||||
Windows supports interactive debugging via its kernel-level debugger WinDbg. This requires two machines connected via a serial port: a computer to run the debugged kernel, and another one to run the debugger and control the operating system being debugged. Windows Driver Kit includes debugging symbols for Windows kernel so Windows data structures will be partially visible in the debugger.
|
||||
|
||||
Linux also supports interactive debugging by means of KDB and KGDB. Debugging support can be built into the kernel and enabled at boot time. After that one can either debug the system directly via a physical keyboard, or connect to it from another machine via a serial port. KDB offers a simple command-line interface and it is the only way to debug the kernel on the same machine. However, KDB lacks source-level debugging support. KGDB provides a more complex interface via a serial port. It enables usage of standard application debuggers like GDB for debugging Linux kernel just like any other userspace application.
|
||||
|
||||
### 4. Distributing Device Drivers
|
||||
|
||||
##### 4.1. Installing device drivers
|
||||
|
||||
On Windows installed drivers are described by text files called INF files, which are typically stored in C:\Windows\INF directory. These files are provided by the driver vendor and define which devices are serviced by the driver, where to find the driver binaries, the version of the driver, etc.
|
||||
|
||||
When a new device is plugged into the computer, Windows looks though
|
||||
installed drivers and loads an appropriate one. The driver will be automatically unloaded as soon as the device is removed.
|
||||
|
||||
On Linux some drivers are built into the kernel and stay permanently loaded. Non-essential ones are built as kernel modules, which are usually stored in the /lib/modules/kernel-version directory. This directory also contains various configuration files, like modules.dep describing dependencies between kernel modules.
|
||||
|
||||
While Linux kernel can load some of the modules at boot time itself, generally module loading is supervised by user-space applications. For example, init process may load some modules during system initialization, and the udev daemon is responsible for tracking the newly plugged devices and loading appropriate modules for them.
|
||||
|
||||
#### 4.2. Updating device drivers
|
||||
|
||||
Windows provides a stable binary interface for device drivers so in some cases it is not necessary to update driver binaries together with the system. Any necessary updates are handled by the Windows Update service, which is responsible for locating, downloading, and installing up-to-date versions of drivers appropriate for the system.
|
||||
|
||||
However, Linux does not provide a stable binary interface so it is necessary to recompile and update all necessary device drivers with each kernel update. Obviously, device drivers, which are built into the kernel are updated automatically, but out-of-tree modules pose a slight problem. The task of maintaining up-to-date module binaries is usually solved with [DKMS][3]: a service that automatically rebuilds all registered kernel modules when a new kernel version is installed.
|
||||
|
||||
#### 4.3. Security considerations
|
||||
|
||||
All Windows device drivers must be digitally signed before Windows loads them. It is okay to use self-signed certificates during development, but driver packages distributed to end users must be signed with valid certificates trusted by Microsoft. Vendors can obtain a Software Publisher Certificate from any trusted certificate authority authorized by Microsoft. This certificate is then cross-signed by Microsoft and the resulting cross-certificate is used to sign driver packages before the release.
|
||||
|
||||
Linux kernel can also be configured to verify signatures of kernel modules being loaded and disallow untrusted ones. The set of public keys trusted by the kernel is fixed at the build time and is fully configurable. The strictness of checks performed by the kernel is also configurable at build time and ranges from simply issuing warnings for untrusted modules to refusing to load anything with doubtful validity.
|
||||
|
||||
### 5. Conclusion
|
||||
|
||||
As shown above, Windows and Linux device driver infrastructure have some things in common, such as approaches to API, but many more details are rather different. The most prominent differences stem from the fact that Windows is a closed-source operating system developed by a commercial corporation. This is what makes good, documented, stable driver ABI and formal frameworks a requirement for Windows while on Linux it would be more of a nice addition to the source code. Documentation support is also much more developed in Windows environment as Microsoft has resources necessary to maintain it.
|
||||
|
||||
On the other hand, Linux does not constrain device driver developers with frameworks and the source code of the kernel and production device drivers can be just as helpful in the right hands. The lack of interface stability also has an implications as it means that up-to-date device drivers are always using the latest interfaces and the kernel itself carries lesser burden of backwards compatibility, which results in even cleaner code.
|
||||
|
||||
Knowing these differences as well as specifics for each system is a crucial first step in providing effective driver development and support for your devices. We hope that this Windows and Linux device driver development comparison was helpful in understanding them, and will serve as a great starting point in your study of device driver development process.
|
||||
|
||||
Download this article as ad-free PDF (made possible by [your kind donation][2]): [Download PDF][1]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/linux-vs-windows-device-driver-model.html
|
||||
|
||||
作者:[Dennis Turpitka][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://xmodulo.com/author/dennis
|
||||
[1]: http://xmodulo.com/linux-vs-windows-device-driver-model.html?format=pdf
|
||||
[2]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PBHS9R4MB9RX4
|
||||
[3]: http://xmodulo.com/build-kernel-module-dkms-linux.html
|
||||
[4]: http://xmodulo.com/go/linux_device_driver_books
|
||||
[5]: http://xmodulo.com/good-ide-for-c-cpp-linux.html
|
@ -1,68 +0,0 @@
|
||||
OneNewLife translating
|
||||
|
||||
Why Linux pioneer Linus Torvalds prefers x86 chips over ARM processors
|
||||
=============
|
||||
|
||||
**Torvalds has an affinity for x86 because of the infrastructure and ecosystem**
|
||||
|
||||

|
||||
|
||||
*Linus Torvalds addressed a packed auditorium of Linux enthusiasts during his speech at the LinuxWorld show in San Jose, California, on August 10, 1999. Credit: James Niccolai
|
||||
*
|
||||
|
||||
Linux pioneer Linus Torvalds is a stand-up guy—he says what he feels. There’s no sugarcoating, and he’ll admit to faults, like [recent issues][1] with the Linux 4.8 kernel.
|
||||
|
||||
He was [full of surprises][2] at last week’s Linaro Connect conference, when he was asked about his favorite chip architecture. He didn’t blink before saying it was x86, not ARM.
|
||||
|
||||
It may have been the long history of x86 with PCs that influenced his answer. There’s little fragmentation of software and hardware with x86, and things just work.
|
||||
|
||||
People are too fixated with the instruction set and the CPU core, Torvalds said, but it ultimately is the ecosystem around the architecture that matters more.
|
||||
|
||||
“What matters is all the infrastructure around the instruction set, and x86 has all that infrastructure... at a lot of different levels,” Torvalds said. “It’s opening a way that no other architecture is.”
|
||||
|
||||
A lot of application development happens on PCs with x86 chips from Intel or AMD. Compatibility matters for x86 chips and PCs, which have a unified model around hardware, development, and other infrastructure.
|
||||
|
||||
The same can’t be said about ARM. From hardware vendor perspective, that leads to a fragmented market, Torvalds said.
|
||||
|
||||
“Being compatible just wasn’t as big of a deal for the ARM ecosystem as it has been traditionally for the x86 ecosystem,” Torvalds said during a fireside chat with ARM developers listening on.
|
||||
|
||||
|
||||
ARM dominates the mobile-device market, and a majority of devices use Android, which is based on the Linux kernel. But there are a lot of fragmentation in the ARM ecosystem, and that’s caused support and device issues.
|
||||
|
||||
One problem: It’s not possible to make one build of Android that can be deployed across all mobile devices because of different hardware configurations. Hardware makers tune Android to be compatible with chipsets in their devices. One Android update can’t be delivered to all mobile devices, unlike Windows updates to PCs.
|
||||
|
||||
Intel tried to put its x86 chips in smartphones but has now stopped the effort. One of Intel’s goals was to [deliver Android updates][3] that could be downloaded and installed on all x86 handsets.
|
||||
|
||||
There are also ARM server software development issues. Architectural, networking, and I/O characteristics are different on each chipset, and software has to be written to exploit those features. That has significantly slowed down the adoption of ARM in servers. There isn’t a matching problem with x86, which continues to dominate the server market.
|
||||
|
||||
“I’ve been personally pretty disappointed with ARM as a hardware platform, not as an instruction set, though I’ve had my issues there, too,” Torvalds said. “As a hardware platform, it is still not very pleasant to deal with.”
|
||||
|
||||
When he was growing up, Torvalds programmed on an 8-bit 6502 microprocessor in machine code and loved the architecture because the instructions were pipelined, something no other hardware did at the time. That architecture delivered more on-chip performance.
|
||||
|
||||
“What I wanted to upgrade to was Acorn Archimedes ... the thing that gave ARM its name,” Torvalds said. “That was my dream machine for a while.”
|
||||
|
||||
The [Archimedes][4] was a personal computer based on the first ARM RISC chips from Acorn Computer Group. ARM was formed as an offshoot of Acorn.
|
||||
|
||||
Torvalds liked the Archimedes because it had the 6502-like feature of pipelining with RAM chips to get high-performance. Unfortunately, he couldn’t find the computer.
|
||||
|
||||
He went with an “odd British computer,” [Sinclair QL][5], which was an even bigger failure than Acorn Archimedes, Torvalds said.
|
||||
|
||||
“Finland wasn’t the center of the universe back then,” Torvalds said. “After that, I learned my lesson—never ever go buy into something that doesn’t have infrastructure.”
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.pcworld.com/article/3129300/linux/why-linux-pioneer-linus-torvalds-prefers-x86-over-arm.html
|
||||
|
||||
作者:[Agam Shah][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.pcworld.com/author/Agam-Shah/
|
||||
[1]: http://www.theregister.co.uk/2016/10/05/linus_torvalds_admits_buggy_crap_made_it_into_linux_48/
|
||||
[2]: https://www.youtube.com/watch?v=fuAebQvFnRI
|
||||
[3]: http://www.infoworld.com/article/2908072/android/google-and-intel-vow-to-speed-up-delivery-of-android-updates-to-devices.html
|
||||
[4]: http://www.pcworld.com/article/3097427/hardware/how-arm-set-itself-up-for-a-32-billion-acquisition.html
|
||||
[5]: http://oldcomputers.net/ql.html
|
@ -1,38 +0,0 @@
|
||||
Aspiring sys admin works his way up in Linux
|
||||
===============================================
|
||||
|
||||

|
||||
|
||||
I first saw Linux in action around 2001 at my first job. I was as an account manager for an Austrian automotive industry supplier and shared an office with our IT guy. He was creating a CD burning station (one of those huge things that can burn and print several CDs simultaneously) so that we could create and send CDs of our car parts catalogue to customers. While the burning station was originally designed for Windows, he just could not get it to work. He eventually gave up on Windows and turned to Linux, and it worked flawlessly.
|
||||
|
||||
For me, it was all kind of arcane. Most of the work was done on the command line, which looked like DOS but was much more powerful (even back then, I recognized this). I had been a Mac user since 1993, and a CLI (command line interface) seemed a bit old fashioned to me at the time.
|
||||
|
||||
It was not until years later—I believe around 2009—that I really discovered Linux for myself. By then, I had moved to the Netherlands and found a job working for a retail supplier. It was a small company (about 20 people) where, aside from my normal job as a key account manager, I had involuntarily become the first line of IT support. Whenever something didn't work, people first came to me before calling the expensive external IT consultant.
|
||||
|
||||
One of my colleagues had fallen for a phishing attack and clicked on an .exe file in an email that appeared to be from DHL. (Yes, it does happen.) His computer got completely taken over and he could not do anything. Even a complete reformat wouldn't help, as the virus kept rearing it's ugly head. I only later learned that it probably had written itself to the MBR (Master Boot Record). By this time, the contract with the external IT consultant had been terminated due to cost savings.
|
||||
|
||||
I turned to Ubuntu to get my colleague to work again. And work it did—like a charm. The computer was humming along again, and I got all the important applications to work like they should. In some ways it wasn't the most elegant solution, I'll admit, yet he (and I) liked the speed and stability of the system.
|
||||
|
||||
However, my colleague was so entrenched in the Windows world that he just couldn't get used to the fact that some things were done differently. He just kept complaining. (Sound familiar?)
|
||||
|
||||
While my colleague couldn't bear that things were done differently, I noticed that this was much less of an issue for me as a Mac user. There were more similarities. I was intrigued. So, I installed a dual boot with Ubuntu on my work laptop and found that I got much more work done in less time and it was much easier to get the machine to do what I wanted. Ever since then I've been regularly using several Linux distros, with Ubuntu and Elementary being my personal favorites.
|
||||
|
||||
At the moment, I am unemployed and hence have a lot of time to educate myself. Because I've always had an interest in IT, I am working to get into Linux systems administration. But is awfully hard to get a chance to show your knowledge nowadays because 95% of what I have learned over the years can't be shown on a paper with a stamp on it. Interviews are the place for me to have a conversation about what I know. So, I signed up for Linux certifications that I hope give me the boost I need.
|
||||
|
||||
I have also been contributing to open source for some time. I started by doing translations (English to German) for the xTuple ERP and have since moved on to doing Mozilla "customer service" on Twitter, filing bug reports, etc. I evangelize for free and open software (with varying degrees of success) and financially support several FOSS advocate organizations (DuckDuckGo, bof.nl, EFF, GIMP, LibreCAD, Wikipedia, and many others) whenever I can. I am also currently working to set up a regional privacy cafe.
|
||||
|
||||
Aside from that, I have started working on my first book. It's supposed to be a lighthearted field manual for normal people about computer privacy and security, which I hope to self-publish by the end of the year. (The book will be licensed under Creative Commons.) As for content, you can expect that I will explain in detail why privacy is important and what is wrong with the whole "I have nothing to hide" mentality. But the biggest part will be instructions how to get rid of pesky ad-trackers, encrypting your hard disk and mail, chat OTR, how to use TOR, etc. While it's a manual first, I aim for a tone that is casual and easy to understand spiced up with stories of personal experiences.
|
||||
|
||||
I still love my Macs and will use them whenever I can afford it (mainly because of the great construction), but Linux is always there in a VM and is used for most of my daily work. Nothing fancy here, though: word processing (LibreOffice and Scribus), working on my website and blog (Wordpress and Jekyll), editing some pictures (Shotwell and Gimp), listening to music (Rhythmbox), and pretty much every other task that comes along.
|
||||
|
||||
Whichever way my job hunt turns out, I know that Linux will always be my go-to system.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/life/16/5/my-linux-story-rene-raggl
|
||||
|
||||
作者:[Rene Raggl][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
[a]: https://opensource.com/users/rraggl
|
@ -1,105 +0,0 @@
|
||||
GHLandy Translating
|
||||
|
||||
5 Best Modern Linux ‘init’ Systems (1992-2015)
|
||||
============================================
|
||||
|
||||
In Linux and other Unix-like operating systems, the init (initialization) process is the first process executed by the kernel at boot time. It has a process ID (PID) of 1, it is executed in the background until the system is shut down.
|
||||
|
||||
The init process starts all other processes, that is daemons, services and other background processes, therefore, it is the mother of all other processes on the system. A process can start many other child processes on the system, but in the event that a parent process dies, init becomes the parent of the orphan process.
|
||||
|
||||

|
||||
|
||||
Over the years, many init systems have emerged in major Linux distributions and in this guide, we shall take a look at some of the best init systems you can work with on the Linux operating system.
|
||||
|
||||
### 1. System V Init
|
||||
|
||||
System V (SysV) is a mature and popular init scheme on Unix-like operating systems, it is the parent of all processes on a Unix/Linux system. SysV is the first commercial Unix operating system designed.
|
||||
|
||||
Almost all Linux distributions first used SysV init scheme except Gentoo which has a custom init and Slackware using BSD-style init scheme.
|
||||
|
||||
As years have passed by, due to some imperfections, several SysV init replacements have been developed in quests to create more efficient and perfect init systems for Linux.
|
||||
|
||||
Although these alternatives seek to improve SysV and probably offer new features, they are still compatible with original SysV init scripts.
|
||||
|
||||
### 2. SystemD
|
||||
|
||||
SystemD is a relatively new init scheme on the Linux platform. Introduced in Fedora 15, its is an assortment of tools for easy system management. The main purpose is to initialize, manage and keep track of all system processes in the boot process and while the system is running.
|
||||
|
||||
Systemd init is comprehensively distinct from other traditional Unix init systems, in the way it practically approaches system and services management. It is also compatible with SysV and LBS init scripts.
|
||||
|
||||
It has some of the following eminent features:
|
||||
|
||||
- Clean, straightforward and efficient design
|
||||
- Concurrent and parallel processing at bootup
|
||||
- Better APIv
|
||||
- Enables removal of optional processes
|
||||
- Supports event logging using journald
|
||||
- Supports job scheduling using systemd calender timers
|
||||
- Storage of logs in binary files
|
||||
- Preservation of systemd state for future reference
|
||||
- Better integration with GNOME plus many more
|
||||
|
||||
Read the Systemd init Overview: <https://fedoraproject.org/wiki/Systemd>
|
||||
|
||||
### 3. Upstart
|
||||
|
||||
Upstart is an event-based init system developed by makers of Ubuntu as a replacement for SysV init system. It starts different system tasks and processes, inspects them while the system is running and stops them during system shut down.
|
||||
|
||||
It is a hybrid init system which uses both SysV startup scripts and also Systemd scripts, some of the notable features of Upstart init system include:
|
||||
|
||||
- Originally developed for Ubuntu Linux but can run on all other distributions
|
||||
- Event-based starting and stopping of tasks and services
|
||||
- Events are generated during starting and stopping of tasks and services
|
||||
- Events can be sent by other system processes
|
||||
- Communication with init process through D-Bus
|
||||
- Users can start and stop their own processes
|
||||
- Re-spawning of services that die abruptly and many more
|
||||
|
||||
Visit Homepage: <http://upstart.ubuntu.com/index.html>
|
||||
|
||||
### 4. OpenRC
|
||||
|
||||
OpenRC is a dependency-based init scheme for Unix-like operating systems, it is compatible with SysV init. As much as it brings some improvements to Sys V, you must keep in mind that OpenRC is not an absolute replacement for /sbin/init file.
|
||||
|
||||
It offers some illustrious features and these include:
|
||||
|
||||
- It can run on other many Linux distributions including Gentoo and also on BSD
|
||||
- Supports hardware initiated init scripts
|
||||
- Supports a single configuration file
|
||||
- No per-service configurations supported
|
||||
- Runs as a daemon
|
||||
- Parallel services startup and many more
|
||||
|
||||
Visit Homepage: <https://wiki.gentoo.org/wiki/OpenRC>
|
||||
|
||||
### 5. runit
|
||||
|
||||
runit is also a cross-platform init system that can run on GNU/Linux, Solaris, *BSD and Mac OS X and it is an alternative for SysV init, that offers service supervision.
|
||||
|
||||
It comes with some benefits and remarkable components not found in SysV init and possibly other init systems in Linux and these include:
|
||||
|
||||
Service supervision, where each service is associated with a service directory
|
||||
Clean process state, it guarantees each process a clean state
|
||||
It has a reliable logging facility
|
||||
Fast system boot up and shutdown
|
||||
It is also portable
|
||||
Packaging friendly
|
||||
Small code size and many more
|
||||
Visit Homepage: <http://smarden.org/runit/>
|
||||
|
||||
As I had earlier on mentioned, the init system starts and manages all other processes on a Linux system. Additionally, SysV is the primary init scheme on Linux operating systems, but due to some performance weaknesses, system programmers have developed several replacements for it.
|
||||
|
||||
And here, we looked at a few of those replacements, but there could be other init systems that you think are worth mentioning in this list. You can let us know of them via the comment section below.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/best-linux-init-systems/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+tecmint+%28Tecmint%3A+Linux+Howto%27s+Guide%29
|
||||
|
||||
作者:[Aaron Kili ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.tecmint.com/author/aaronkili/
|
@ -1,52 +0,0 @@
|
||||
translating by Chao-zhi
|
||||
|
||||
4 big ways companies benefit from having open source program offices
|
||||
====
|
||||
|
||||

|
||||
|
||||
In the first article in my series on open source program offices, I took a deep dive into [what an open source program office is and why your company might need one][1]. Next I looked at [how Google created a new kind of open source program office][2]. In this article, I'll explain a few benefits of having an open source program office.
|
||||
|
||||
At first glance, one big reason why a company not in the business of software development might more enthusiastically embrace an open source program office is because they have less to lose. After all, they're not gambling with software products that are directly tied to revenue. Facebook, for example, can easily unleash a distributed key-value datastore as an open source project because they don't sell a product called "enterprise key-value datastore." That answers the question of risk, but it still doesn't answer the question of what they gain from contributing to the open source ecosystem. Let's look at a few potential reasons and then tackle each. You'll notice a lot of overlap with vendor open source program offices, but some of the motivations are slightly different.
|
||||
|
||||
### Recruiting
|
||||
|
||||
Recruiting is perhaps the easiest way to sell an open source program office to upper management. Show them the costs associated with recruiting, as well as the return on investment, and then explain how developing relationships with talented engineers results in a pipeline of talented developers who are actually familiar with your technology and excited to help work on it. We don't really need to go in more depth here—it's self-explanatory, right?
|
||||
|
||||
### Technology influence
|
||||
|
||||
Once upon a time, companies that didn't specialize in selling software were powerless to influence development cycles of their software vendors directly, especially if they were not a large customer. Open source completely changed that dynamic and brought users onto a more level playing field with vendors. With the rise of open source development, anyone could push technology into a chosen direction, assuming they were willing to invest the time and resources. But these companies learned that simply investing in developer time, although fruitful, could be even more useful if tied to an overarching strategic effort&mdash. Think bug fixes vs. software architects—lots of companies push bug fixes to upstream open source projects, but some of these same companies began to learn that coordinating a sustained effort with a deeper commitment paid off with faster feature development, which could be good for business. With the open source program office model, companies have staffers who can sniff out strategically important open source communities in which they then invest developer resources.
|
||||
|
||||
With rapidly growing companies such as Google and Facebook, providing leadership in existing open source projects still proved insufficient for their expanding businesses. Facing the challenges of intense growth and building out hyperscale systems, many of the largest companies had built highly customized stacks of software for internal use only. What if they could convince others to collaborate on some of these infrastructure projects? Thus, while they maintained investments in areas such as the Linux kernel, Apache, and other existing projects, they also began to release their own large projects. Facebook released Cassandra, Twitter created Mesos, and eventually Google created the Kubernetes project. These projects have become major platforms for industry innovation, proving to be spectacular successes for the companies involved. (Note that Facebook stopped using Cassandra internally after it needed to create a new software project to solve the problem at a larger scale. However, by that time Cassandra had already become popular and DataStax had formed to take on development). Each of these projects have spawned entire ecosystems of developers, related projects, and end users that serve to accelerate growth and development.
|
||||
|
||||
This would not have been possible without coordination between an open source program office and strategic company initiatives. Without that effort, each of the companies mentioned would still be trying to solve these problems individually—and more slowly. Not only have these projects helped solve business problems internally, they also helped establish the companies that created them as industry heavyweights. Sure, Google has been an industry titan for a few years now, but the growth of Kubernetes ensures both better software, and a direct say in the future direction of container technologies, even more than it already had. These companies are still known for their hyperscale infrastructure and for simply being large Silicon Valley stalwarts. Lesser known, but possibly even more important, is their new relevance as technology producers. Open source program offices guide these efforts and maximize their impact, through technology recommendations and relationships with influential developers, not to mention deep expertise in community governance and people management.
|
||||
|
||||
### Marketing power
|
||||
|
||||
Going hand-in-hand with technology influence is how each company talks about its open source efforts. By honing the messages around these projects and communities, an open source program office is able to deliver maximum impact through targeted marketing campaigns. Marketing has long been a dirty word in open source circles, because everyone has had a bad experience with corporate marketing. In the case of open source communities, marketing takes on a vastly different form from a traditional approach and involves amplifying what is already happening in the communities of strategic importance. Thus, an open source program office probably won't create whiz-bang slides about a project that hasn't even released any code yet, but they'll talk about the software they've created and other initiatives they've participated in. Basically, no vaporware here.
|
||||
|
||||
Think of the first efforts made by Google's open source program office. They didn't simply contribute code to the Linux kernel and other projects—they talked about it a lot, often in keynotes at open source conferences. They didn't just give money to students who write open source code—they created a global program, the Google Summer of Code, that became a cultural touchstone of open source development. This marketing effort cemented Google's status as a major open source developer long before Kubernetes was even developed. As a result, Google wielded major influence during the creation of the GPLv3 license, and company speakers and open source program office representatives became staples at tech events. The open source program office is the entity best situated to coordinate these efforts and deliver real value for the parent company.
|
||||
|
||||
### Improve internal processes
|
||||
|
||||
Improving internal processes may not sound like a big benefit, but overcoming chaotic internal processes is a challenge for every open source program office, whether software vendor or company-driven. Whereas a software vendor must make sure that their processes don't step on products they release (for example, unintentionally open sourcing proprietary software), a user is more concerned with infringement of intellectual property (IP) law: patents, copyrights, and trademarks. No one wants to get sued simply for releasing software. Without an active open source program office to manage and coordinate licensing and other legal questions, large companies face great difficulty in arriving at a consensus around open source processes and governance. Why is this important? If different groups release software under incompatible licenses, not only will this prove to be an embarrassment, it also will provide a significant obstacle to achieving one of the most basic goals—improved collaboration.
|
||||
|
||||
Combined with the fact that many of these companies are still growing incredibly quickly, an inability to establish basic rules around process will prove unwieldy sooner than expected. I've seen large spreadsheets with a matrix of approved and unapproved licenses as well as guidelines for how to (and how not to) create open source communities while complying with legal restrictions. The key is to have something that developers can refer to when they need to make decisions, without incurring the legal overhead of a massive, work-slowing IP review every time a developer wants to contribute to an open source community.
|
||||
|
||||
Having an active open source program office that maintains rules over license compliance and source contribution, as well as establishing training programs for engineers, helps to avoid potential legal pitfalls and costly lawsuits. After all, what good is better collaboration on open source projects if the company loses real money because someone didn't read the license? The good news is that companies have less to worry about with respect to proprietary IP when compared to software vendors. The bad news is that their legal questions are no less complex, especially when they run directly into the legal headwinds of a software vendor.
|
||||
|
||||
How has your organization benefited from having an open source program office? Let me know about it in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/business/16/9/4-big-ways-companies-benefit-having-open-source-program-offices
|
||||
|
||||
作者:[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/business/16/5/whats-open-source-program-office
|
||||
[2]: https://opensource.com/business/16/8/google-open-source-program-office
|
@ -1,69 +0,0 @@
|
||||
### [Rust meets Fedora](https://fedoramagazine.org/rust-meets-fedora/)
|
||||
|
||||
### 
|
||||
|
||||
### What is Rust?
|
||||
|
||||
Rust is a system programming language which runs blazingly fast, and prevents almost all crashes, [segfaults](https://wikipedia.org/wiki/Segmentation_fault), and data races. You might wonder exactly why yet another programming language is useful, since there are already so many of them. This article aims to explain why.
|
||||
|
||||
### Safety vs. control
|
||||
|
||||
[](https://i0.wp.com/cdn.fedoramagazine.org/wp-content/uploads/2016/09/Screenshot-from-2016-09-12-08-29-02.png?ssl=1)
|
||||
|
||||
You may have seen a diagram of the above spectrum. On one side there’s C/C++, which has more control of the hardware it’s running on. Therefore it lets the developer optimize performance by executing finer control over the generated machine code. However, this isn’t very safe; it’s easier to cause a segfault, or security bugs like [Heartbleed](https://fedoramagazine.org/update-on-cve-2014-0160-aka-heartbleed/).
|
||||
|
||||
On the other hand, there are languages like Python, Ruby, and JavaScript where the developer has little control but creates safer code. The code can’t generate a segfault, although it can generate exceptions which are fairly safe and contained.
|
||||
|
||||
Somewhere in the middle, there’s Java and a few other languages which are a mixture of these characteristics. They offer some control of the hardware they run on but try to minimize vulnerabilities.
|
||||
|
||||
Rust is a bit different, and doesn’t fall in this spectrum. Instead it gives the developer both safety and control.
|
||||
|
||||
### Specialties of Rust
|
||||
|
||||
Rust is a system programming language like C/C++, except that it gives the developer fine grained control over memory allocations. A garbage collector is not required. It has a minimal runtime, and runs very close to the bare metal. The developer has greater guarantees about the performance of the code. Furthermore, anyone who knows C/C++ can understand and write code for this language.
|
||||
|
||||
Rust runs blazingly fast, since it’s a compiled language. It uses LLVM as the compiler backend and can tap into a large suite of optimizations. In many areas it can perform better than C/C++. Like JavaScript, Ruby, and Python, it’s safe by default, meaning it doesn’t cause segfaults, dangling pointers, or null pointers.
|
||||
|
||||
Another important feature is the elimination of data races. Nowadays, most computers have multiple cores and many threads running in parallel. However it’s tough for developers to write good parallel code, so this feature removes that necessity. There are two key concepts Rust uses to eliminate data races:
|
||||
|
||||
* Ownership. Each variable is moved to a new location, and prevents the previous location from using it. There is only oneowner of each piece of data.
|
||||
* Borrowing. Owned values can be borrowed to allow usage for a certain period of time.
|
||||
|
||||
### Rust in Fedora 24 and 25
|
||||
|
||||
To get started, just install the package:
|
||||
|
||||
```
|
||||
sudo dnf install rust
|
||||
```
|
||||
|
||||
```
|
||||
fn main() {
|
||||
println!("Hello, Rust is running on Fedora 25 Alpha!");
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
rustc helloworld.rs
|
||||
./helloworld
|
||||
```
|
||||
|
||||
Run the following command to install the latest testing version on Fedora:
|
||||
|
||||
```
|
||||
sudo dnf --enablerepo=updates-testing --refresh --best install rust
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/rust-meets-fedora/
|
||||
|
||||
作者:[Sumantro Mukherjee][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/sumantrom/
|
602
sources/tech/20161005 GETTING STARTED WITH ANSIBLE.md
Normal file
602
sources/tech/20161005 GETTING STARTED WITH ANSIBLE.md
Normal file
@ -0,0 +1,602 @@
|
||||
GETTING STARTED WITH ANSIBLE
|
||||
==========
|
||||
|
||||
|
||||
This is a crash course on Ansible that you can also use as a template for small projects or to get you into this awesome tool. By the end of this guide, you will know enough to automate server configurations, deployments and more.
|
||||
|
||||
### What is Ansible and why you should care ?
|
||||
|
||||
Ansible is a configuration management system known for its simplicity. You only need ssh access to your servers or equipment. It also differs from other options because it pushes changes instead of pulling like puppet or chef normally do. You can deploy code to any number of servers, configure network equipment or automate anything in your infrastructure.
|
||||
|
||||
#### Requirements
|
||||
|
||||
It’s assumed that you are using Mac or Linux as your workstation, Ubuntu Trusty for your servers and have some experience installing packages. Also, you will need the following software on your computer. So, if you don’t have them already, go ahead and install:
|
||||
|
||||
- Virtualbox
|
||||
- Vagrant
|
||||
- Mac users: Homebrew
|
||||
|
||||
#### Scenario
|
||||
We are going to emulate 2 web application servers connecting to a MySQL database. The web application uses Rails 5 with Puma.
|
||||
|
||||
### Preparations
|
||||
|
||||
#### Vagrantfile
|
||||
|
||||
Create a folder for this project and save the following content in a file called: Vagrantfile
|
||||
|
||||
```
|
||||
VMs = [
|
||||
[ "web1", "10.1.1.11"],
|
||||
[ "web2", "10.1.1.12"],
|
||||
[ "dbserver", "10.1.1.21"],
|
||||
]
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
VMs.each { |vm|
|
||||
config.vm.define vm[0] do |box|
|
||||
box.vm.box = "ubuntu/trusty64"
|
||||
box.vm.network "private_network", ip: vm[1]
|
||||
box.vm.hostname = vm[0]
|
||||
box.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "512"
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
```
|
||||
|
||||
### Configure your virtual network
|
||||
|
||||
We want our VMs to talk to each other, but don’t let that traffic go out to your real network, so we are going to create aHost-Only adapter in Virtualbox.
|
||||
|
||||
1. Open Virtualbox
|
||||
2. Go to Preferences
|
||||
3. Go to Network
|
||||
4. Click on Host-Only networks
|
||||
5. Click to add a network
|
||||
6. Click on Adapter
|
||||
7. Set IPv4 to 10.1.1.1, IPv4 Network Mark: 255.255.255.0
|
||||
8. Click Ok
|
||||
|
||||
#### Test your VMs and virtual network
|
||||
|
||||
In a terminal, in the directory for this project where you have the Vagrantfile, type the following command:
|
||||
|
||||
```
|
||||
vagrant up
|
||||
```
|
||||
|
||||
This will create your VMs so it may take a while. Check that everything worked by typing this command and verifying the output:
|
||||
|
||||
```
|
||||
$ vagrant status
|
||||
Current machine states:
|
||||
|
||||
web1 running (virtualbox)
|
||||
web2 running (virtualbox)
|
||||
master running (virtualbox)
|
||||
|
||||
This environment represents multiple VMs. The VMs are all listed
|
||||
above with their current state. For more information about a specific
|
||||
VM, run `vagrant status NAME`.
|
||||
```
|
||||
|
||||
Now log into each one of the VMs using user & password vagrant and the IPs in the Vagrantfile, this will validate the VMs and add their keys to your known hosts file.
|
||||
|
||||
```
|
||||
ssh vagrant@10.1.1.11 # password is `vagrant`
|
||||
ssh vagrant@10.1.1.12
|
||||
ssh vagrant@10.1.1.21
|
||||
```
|
||||
|
||||
Congratulations! Now you have servers to play with. Here comes the exiting part!
|
||||
|
||||
### Install Ansible
|
||||
|
||||
For Mac users:
|
||||
|
||||
```
|
||||
$ brew install ansible
|
||||
```
|
||||
|
||||
For Ubuntu users:
|
||||
|
||||
```
|
||||
$ sudo apt install ansible
|
||||
```
|
||||
|
||||
Make sure you got a recent version of ansible that is 2.1 or superior:
|
||||
|
||||
```
|
||||
$ ansible --version
|
||||
ansible 2.1.1.0
|
||||
```
|
||||
|
||||
### The Inventory
|
||||
|
||||
Ansible uses an inventory to know what servers to work with and how to group them to perform tasks(in parallel). Let’s create our inventory for this project and name it inventory in the same folder as the Vagrantfile:
|
||||
|
||||
```
|
||||
[all:children]
|
||||
webs
|
||||
db
|
||||
|
||||
[all:vars]
|
||||
ansible_user=vagrant
|
||||
ansible_ssh_pass=vagrant
|
||||
|
||||
[webs]
|
||||
web1 ansible_host=10.1.1.11
|
||||
web2 ansible_host=10.1.1.12
|
||||
|
||||
[db]
|
||||
dbserver ansible_host=10.1.1.21
|
||||
```
|
||||
|
||||
- `[all:children]` defines a group(all) of groups
|
||||
- `[all:vars]` defines variables that belong to the group all
|
||||
- `[webs]` defines a group just like [dbs]
|
||||
- The rest of the file is just declarations of hosts, with their names and IPs
|
||||
- A blank line means end of a declaration
|
||||
|
||||
Now that we have an inventory we can start using ansible from the command line, specifying a host or a group to perform commands. Here is a typical example of a command to check connectivity to your servers:
|
||||
|
||||
```
|
||||
$ ansible -i inventory all -m ping
|
||||
```
|
||||
|
||||
- `-i` specifies the inventory file
|
||||
- `all` specifies the server or group of servers to operate
|
||||
- `-m` specifies an ansible module, in this case ping
|
||||
|
||||
Here is the output of this command:
|
||||
|
||||
```
|
||||
dbserver | SUCCESS => {
|
||||
"changed": false,
|
||||
"ping": "pong"
|
||||
}
|
||||
web1 | SUCCESS => {
|
||||
"changed": false,
|
||||
"ping": "pong"
|
||||
}
|
||||
web2 | SUCCESS => {
|
||||
"changed": false,
|
||||
"ping": "pong"
|
||||
}
|
||||
```
|
||||
|
||||
Note that servers respond with a different order. This only depends on who responds first, but is not relevant, because ansible keeps the status of each server separate.
|
||||
|
||||
You can also run any command using another switch:
|
||||
|
||||
- `-a <command>`
|
||||
|
||||
```
|
||||
$ ansible -i inventory all -a uptime
|
||||
web1 | SUCCESS | rc=0 >>
|
||||
21:43:27 up 25 min, 1 user, load average: 0.00, 0.01, 0.05
|
||||
|
||||
dbserver | SUCCESS | rc=0 >>
|
||||
21:43:27 up 24 min, 1 user, load average: 0.00, 0.01, 0.05
|
||||
|
||||
web2 | SUCCESS | rc=0 >>
|
||||
21:43:27 up 25 min, 1 user, load average: 0.00, 0.01, 0.05
|
||||
```
|
||||
|
||||
Here is another example with only one server:
|
||||
|
||||
```
|
||||
$ ansible -i inventory dbserver -a "df -h /"
|
||||
dbserver | SUCCESS | rc=0 >>
|
||||
Filesystem Size Used Avail Use% Mounted on
|
||||
/dev/sda1 40G 1.4G 37G 4% /
|
||||
```
|
||||
|
||||
### Playbooks
|
||||
|
||||
Playbooks are just YAML files that associate groups of servers in an inventory with commands. The correct word in ansible is tasks, and it can be a desired state, a shell command, or many other options. For a list of all the things you can do with ansible take a look at the list of all modules.
|
||||
|
||||
Here is an example of a playbook for running a shell command, save this as playbook1.yml:
|
||||
|
||||
```
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- shell: uptime
|
||||
```
|
||||
|
||||
- `---` is the start of the YAML file
|
||||
- `- hosts`: specifies what group is going to be used
|
||||
- `tasks`: marks the start of a list of tasks
|
||||
- `- shell`: specifies the first task using the shell module
|
||||
- REMEMBER: YAML requires indentation so make sure you are always following the correct structure in your playbooks
|
||||
|
||||
Run it with:
|
||||
|
||||
```
|
||||
$ ansible-playbook -i inventory playbook1.yml
|
||||
|
||||
PLAY [all] *********************************************************************
|
||||
|
||||
TASK [setup] *******************************************************************
|
||||
ok: [web1]
|
||||
ok: [web2]
|
||||
ok: [dbmaster]
|
||||
|
||||
TASK [command] *****************************************************************
|
||||
changed: [web1]
|
||||
changed: [web2]
|
||||
changed: [dbmaster]
|
||||
|
||||
PLAY RECAP *********************************************************************
|
||||
dbmaster : ok=2 changed=1 unreachable=0 failed=0
|
||||
web1 : ok=2 changed=1 unreachable=0 failed=0
|
||||
web2 : ok=2 changed=1 unreachable=0 failed=0
|
||||
```
|
||||
|
||||
As you can see ansible ran 2 tasks, instead of just one we have in our playbook. The TASK [setup] is an implicit task that runs first to capture information of the servers like hostnames, IPs, distributions, and many more details, that information can then be used to run conditional tasks.
|
||||
|
||||
There is also a final PLAY RECAP where ansible shows how many tasks ran and the corresponding state for each. In our case, since we ran a shell command, ansible doesn’t know the resulting state and it’s then considered as changed.
|
||||
|
||||
|
||||
### Installing Software
|
||||
|
||||
We are going to use apt to install software on our servers, for this we need to be root, so we have to use the become statement, save this content in playbook2.yml and run it(ansible-playbook playbook2.yml):
|
||||
|
||||
```
|
||||
---
|
||||
- hosts: webs
|
||||
become_user: root
|
||||
become: true
|
||||
tasks:
|
||||
- apt: name=git state=present
|
||||
```
|
||||
|
||||
There are statements you can apply to all modules in ansible; one is the name statement that let’s you print a more descriptive text about the task being executed. In order to use it you keep your task the same but add name: descriptive text as the first line, so our previous text will be:
|
||||
|
||||
```
|
||||
---
|
||||
- hosts: webs
|
||||
become_user: root
|
||||
become: true
|
||||
tasks:
|
||||
- name: This task will make sure git is present on the system
|
||||
apt: name=git state=present
|
||||
```
|
||||
|
||||
### Using `with_items`
|
||||
|
||||
When you are dealing with a list of items, packages to install, files to create, etc. ansible provides with_items. Here is how we use it in our playbook3.yml, adding at the same time some other statements we already know:
|
||||
|
||||
```
|
||||
---
|
||||
- hosts: all
|
||||
become_user: root
|
||||
become: true
|
||||
tasks:
|
||||
- name: Installing dependencies
|
||||
apt: name={{item}} state=present
|
||||
with_items:
|
||||
- git
|
||||
- mysql-client
|
||||
- libmysqlclient-dev
|
||||
- build-essential
|
||||
- python-software-properties
|
||||
```
|
||||
|
||||
### Using `template` and `vars`
|
||||
|
||||
`vars` is one statement that defines variables you can use either in `task` statements or inside `template` files. Jinja2 is the templating engine used in Ansible, but you don’t need to learn a lot about it to use it. Define variables in your playbook like this:
|
||||
|
||||
```
|
||||
---
|
||||
- hosts: all
|
||||
vars:
|
||||
- secret_key: VqnzCLdCV9a3jK
|
||||
- path_to_vault: /opt/very/deep/path
|
||||
tasks:
|
||||
- name: Setting a configuration file using template
|
||||
template: src=myconfig.j2 dest={{path_to_vault}}/app.conf
|
||||
```
|
||||
|
||||
As you can see I can use {{path_to_vault}} as part of the playbook, but also since I am using a template statement, I can use any variable inside the myconfig.j2 file, which has to be stored in a subfolder called templates. Your project tree should look like:
|
||||
|
||||
```
|
||||
├── Vagrantfile
|
||||
├── inventory
|
||||
├── playbook1.yml
|
||||
├── playbook2.yml
|
||||
└── templates
|
||||
└── myconfig.j2
|
||||
```
|
||||
|
||||
When ansible finds a template statement it will look into the templates folder and expand the variables surrounded by{{ and }}.
|
||||
|
||||
Example template:
|
||||
|
||||
```
|
||||
this is just an example vault_dir: {{path_to_vault}} secret_password: {{secret_key}}
|
||||
```
|
||||
|
||||
You can also use `template` even if you are not expanding variables. I do this in advance considering I may add them later. For example, let’s create a `hosts.j2` template and add the hostnames and IPs:
|
||||
|
||||
```
|
||||
10.1.1.11 web1
|
||||
10.1.1.12 web2
|
||||
10.1.1.21 dbserver
|
||||
```
|
||||
|
||||
This will require a statement like this:
|
||||
|
||||
```
|
||||
- name: Installing the hosts file in all servers
|
||||
template: src=hosts.j2 dest=/etc/hosts mode=644
|
||||
```
|
||||
|
||||
### Shell commands
|
||||
|
||||
You should always try to use modules because Ansible can track the state of the task and avoid repeating it unnecessarily, but there are times when a shell command is unavoidable. For those cases Ansible offers two options:
|
||||
|
||||
- command: Literally just running a command without environment variables or redirections (|, <, >, etc.)
|
||||
- shell: Runs /bin/sh and expands variables and redirections
|
||||
|
||||
#### Other useful modules
|
||||
|
||||
- apt_repository – Add/Remove package repositories in Debian family
|
||||
- yum_repository – Add/Remove package repositories in RedHat family
|
||||
- service – Start/Stop/Restart/Enable/Disable services
|
||||
- git – Deploy code from a git server
|
||||
- unarchive – Unarchive packages from the web or local sources
|
||||
|
||||
#### Running a task only in one server
|
||||
|
||||
Rails uses `migrations` to make gradual changes to your DB, but since you have more than one app server, these migrations can not be assigned as a group task, instead we need only one server to run the migrations. In cases like this is when run_once is used, run_once will delegate the task to one server and continue with the next task until this task is done. You only need to set run_once: true in your task.
|
||||
|
||||
```
|
||||
- name: 'Run db:migrate'
|
||||
shell: cd {{appdir}};rails db:migrate
|
||||
run_once: true
|
||||
```
|
||||
|
||||
##### Tasks that can fail
|
||||
|
||||
By specifying ignore_errors: true you can run a task that may fail but doesn’t affect the completion of the rest of your playbook. This is useful, for example, when deleting a log file that initially will not exist.
|
||||
|
||||
```
|
||||
- name: 'Delete logs'
|
||||
shell: rm -f /var/log/nginx/errors.log
|
||||
ignore_errors: true
|
||||
```
|
||||
|
||||
##### Putting it all together
|
||||
|
||||
Now using what we previously learned, here is the final version of each file:
|
||||
|
||||
Vagrantfile:
|
||||
|
||||
```
|
||||
VMs = [
|
||||
[ "web1", "10.1.1.11"],
|
||||
[ "web2", "10.1.1.12"],
|
||||
[ "dbserver", "10.1.1.21"],
|
||||
]
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
VMs.each { |vm|
|
||||
config.vm.define vm[0] do |box|
|
||||
box.vm.box = "ubuntu/trusty64"
|
||||
box.vm.network "private_network", ip: vm[1]
|
||||
box.vm.hostname = vm[0]
|
||||
box.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "512"
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
```
|
||||
|
||||
inventory:
|
||||
|
||||
```
|
||||
[all:children]
|
||||
webs
|
||||
db
|
||||
|
||||
[all:vars]
|
||||
ansible_user=vagrant
|
||||
ansible_ssh_pass=vagrant
|
||||
|
||||
[webs]
|
||||
web1 ansible_host=10.1.1.11
|
||||
web2 ansible_host=10.1.1.12
|
||||
|
||||
[db]
|
||||
dbserver ansible_host=10.1.1.21
|
||||
```
|
||||
|
||||
templates/hosts.j2:
|
||||
|
||||
```
|
||||
10.1.1.11 web1
|
||||
10.1.1.12 web2
|
||||
10.1.1.21 dbserver
|
||||
```
|
||||
|
||||
templates/my.cnf.j2:
|
||||
|
||||
```
|
||||
[client]
|
||||
port = 3306
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
|
||||
[mysqld_safe]
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
nice = 0
|
||||
|
||||
[mysqld]
|
||||
server-id = 1
|
||||
user = mysql
|
||||
pid-file = /var/run/mysqld/mysqld.pid
|
||||
socket = /var/run/mysqld/mysqld.sock
|
||||
port = 3306
|
||||
basedir = /usr
|
||||
datadir = /var/lib/mysql
|
||||
tmpdir = /tmp
|
||||
lc-messages-dir = /usr/share/mysql
|
||||
skip-external-locking
|
||||
bind-address = 0.0.0.0
|
||||
key_buffer = 16M
|
||||
max_allowed_packet = 16M
|
||||
thread_stack = 192K
|
||||
thread_cache_size = 8
|
||||
myisam-recover = BACKUP
|
||||
query_cache_limit = 1M
|
||||
query_cache_size = 16M
|
||||
log_error = /var/log/mysql/error.log
|
||||
expire_logs_days = 10
|
||||
max_binlog_size = 100M
|
||||
|
||||
[mysqldump]
|
||||
quick
|
||||
quote-names
|
||||
max_allowed_packet = 16M
|
||||
|
||||
[mysql]
|
||||
|
||||
[isamchk]
|
||||
key_buffer = 16M
|
||||
|
||||
!includedir /etc/mysql/conf.d/
|
||||
|
||||
final-playbook.yml:
|
||||
|
||||
- hosts: all
|
||||
become_user: root
|
||||
become: true
|
||||
tasks:
|
||||
- name: 'Install common software on all servers'
|
||||
apt: name={{item}} state=present
|
||||
with_items:
|
||||
- git
|
||||
- mysql-client
|
||||
- libmysqlclient-dev
|
||||
- build-essential
|
||||
- python-software-properties
|
||||
- name: 'Install hosts file'
|
||||
template: src=hosts.j2 dest=/etc/hosts mode=644
|
||||
|
||||
- hosts: db
|
||||
become_user: root
|
||||
become: true
|
||||
tasks:
|
||||
- name: 'Software for DB server'
|
||||
apt: name={{item}} state=present
|
||||
with_items:
|
||||
- mysql-server
|
||||
- percona-xtrabackup
|
||||
- mytop
|
||||
- mysql-utilities
|
||||
- name: 'MySQL config file'
|
||||
template: src=my.cnf.j2 dest=/etc/mysql/my.cnf
|
||||
- name: 'Restart MySQL'
|
||||
service: name=mysql state=restarted
|
||||
- name: 'Grant access to web app servers'
|
||||
shell: echo 'GRANT ALL PRIVILEGES ON *.* TO "root"@"%" WITH GRANT OPTION;FLUSH PRIVILEGES;'|mysql -u root mysql
|
||||
|
||||
- hosts: webs
|
||||
vars:
|
||||
- appdir: /opt/dummyapp
|
||||
become_user: root
|
||||
become: true
|
||||
tasks:
|
||||
- name: 'Add ruby-ng repo'
|
||||
apt_repository: repo='ppa:brightbox/ruby-ng'
|
||||
- name: 'Install rails software'
|
||||
apt: name={{item}} state=present
|
||||
with_items:
|
||||
- ruby-dev
|
||||
- ruby-all-dev
|
||||
- ruby2.2
|
||||
- ruby2.2-dev
|
||||
- ruby-switch
|
||||
- libcurl4-openssl-dev
|
||||
- libssl-dev
|
||||
- zlib1g-dev
|
||||
- nodejs
|
||||
- name: 'Set ruby to 2.2'
|
||||
shell: ruby-switch --set ruby2.2
|
||||
- name: 'Install gems'
|
||||
shell: gem install bundler rails
|
||||
- name: 'Kill puma if running'
|
||||
shell: file /run/puma.pid >/dev/null && kill `cat /run/puma.pid` 2>/dev/null
|
||||
ignore_errors: True
|
||||
- name: 'Clone app repo'
|
||||
git:
|
||||
repo=https://github.com/c0d5x/rails_dummyapp.git
|
||||
dest={{appdir}}
|
||||
version=staging
|
||||
force=yes
|
||||
- name: 'Run bundler'
|
||||
shell: cd {{appdir}};bundler
|
||||
- name: 'Run db:setup'
|
||||
shell: cd {{appdir}};rails db:setup
|
||||
run_once: true
|
||||
- name: 'Run db:migrate'
|
||||
shell: cd {{appdir}};rails db:migrate
|
||||
run_once: true
|
||||
- name: 'Run rails server'
|
||||
shell: cd {{appdir}};rails server -b 0.0.0.0 -p 80 --pid /run/puma.pid -d
|
||||
```
|
||||
|
||||
### Turn up your environment
|
||||
|
||||
Having these files in the same directory, turn up your dev environment by running:
|
||||
|
||||
```
|
||||
vagrant up
|
||||
ansible-playbook -i inventory final-playbook.yml
|
||||
```
|
||||
|
||||
#### Deployment of new code
|
||||
|
||||
Make changes to your code and push those changes to your repo. Then, simply make sure you have the correct branch in your git statement:
|
||||
|
||||
```
|
||||
- name: 'Clone app repo'
|
||||
git:
|
||||
repo=https://github.com/c0d5x/rails_dummyapp.git
|
||||
dest={{appdir}}
|
||||
version=staging
|
||||
force=yes
|
||||
```
|
||||
|
||||
As an example, you can change the version field with master, run the playbook again:
|
||||
|
||||
```
|
||||
ansible-playbook -i inventory final-playbook.yml
|
||||
```
|
||||
|
||||
Check that the page has changed on any of the web servers: `http://10.1.1.11` or `http://10.1.1.12`. Change it back to `version=staging` and rerun the playbook and check the page again.
|
||||
|
||||
You can also create an alternative playbook that has only the tasks related to the deployment so that it runs faster.
|
||||
|
||||
### What is next !?
|
||||
|
||||
This is a very small portion of what ansible can do. We didn’t touch roles, filters, debugor many other awesome features that it offers, but hopefully it gives you a good start! So, go ahead and start using it and learn as you go. If you have any questions you can reach me on twitter or comment below and let me know what else you’d like to find out about ansible!
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://gorillalogic.com/blog/getting-started-with-ansible/?utm_source=webopsweekly&utm_medium=email
|
||||
|
||||
作者:[JOSE HIDALGO][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://gorillalogic.com/author/josehidalgo/
|
@ -1,58 +0,0 @@
|
||||
Solving the Linux kernel code reviewer shortage
|
||||
====
|
||||
|
||||
Operating system security is [top of mind right now](http://www.infoworld.com/article/3124432/linux/is-the-linux-kernel-a-security-problem.html), and Linux is a big part of that discussion. One of the questions to be solved is: How do we ensure that patches going upstream are properly reviewed?
|
||||
|
||||
Wolfram Sang has been a Linux kernel developer since 2008, and frequently talks at Linux conferences around the world, like[LinuxCon Berlin 2016](https://linuxconcontainerconeurope2016.sched.org/event/7oA4/kernel-development-i-still-think-we-have-a-scaling-problem-wolfram-sang-consultant), about ways to improve kernel development practices.
|
||||
|
||||
Let's get his point of view.
|
||||
|
||||

|
||||
|
||||
### In 2013, you warned the ELCE audience in Edinburgh about subsystem latencies and other issues that may arise if things don't change. Did things change? Did some of the things you warned about end up happening?
|
||||
|
||||
Yes, to some extent. Of course, the Linux kernel is a very heterogeneous project, so subsystems with more focus are in a slightly better position. However, there are enough subsystems which are "just a piece of the puzzle" and for them latency has not improved, generally speaking.
|
||||
|
||||
### You've pointed out that the number of reviewers is a problem. Why do you think the kernel development community doesn't have enough reviewers?
|
||||
|
||||
One thing is that some people prefer to actually write code and not so much read code. This is OK. It just shows that not everyone is a reviewer, so we should really encourage everyone who likes to do that.
|
||||
|
||||
Another thing I see is when we ask people to join our community, it is first mostly about contributing patches. This is natural, I think, and worked well in the beginning when contributions were fewer. But as more and more have joined, especially companies, we've hit this review resource problem. Don't get me wrong, having so many contributions is awesome! I think that we now need to point out that taking part in the community also means more, like to take over some responsibility as a next step. It happens in some parts, but it is not enough to scale yet.
|
||||
|
||||
### Do you think more reviewer training or incentivization of reviewing would help?
|
||||
|
||||
One key point for me is to speak out about there being a problem. Yes, we are doing great so far, but that doesn't mean all is well. We also have problems like this scalability issue. Let people know so maybe some parties get interested and join. I don't think we need special training, though. Most reviewers I know are pretty good or talented, they are just too few or have too little time.
|
||||
|
||||
What you should have is this intrinsic motivation. For the rest, learning-by-doing works great in this field. This is one of the advantages I like to point out: Reviewing patches makes you a better coder.
|
||||
|
||||
### In your opinion, are there large, popular projects that you think are doing a really great job at scaling that we might borrow some ideas from?
|
||||
|
||||
I don't know one, but am open to hearing about them if there are.
|
||||
|
||||
I am very focused on the Linux kernel, so it might be plain bias. However, in my opinion the kernel is indeed special in terms of size, number of contributions, and diversity. So while I think looking at other projects to get inspiration for workflow improvements is always healthy, our scalability problems are pretty unique currently. I find it most useful to look what other subsystems in the kernel are doing.
|
||||
|
||||
### You've mentioned security issues as something that could come up. What should users be doing to avoid or ameliorate the severity of security issues?
|
||||
|
||||
My talk at LinuxCon Berlin this year is targeted at the development level. The security implications could come from patches going in without proper review. I don't want to have users deal with that, I rather want such issues to never happen. This will never work perfectly, but it is still my preferred way to tackle things.
|
||||
|
||||
### I'm wondering how the wider community could help. Are there certain kinds of bug reports that you wish people would file more often? Particular areas that need regular attention but don't get it for some reason?
|
||||
|
||||
We are not short on bug reports. What I am more afraid of is that the shortage of reviewers will lead to more bug reports due to incomplete patches going in. So, we then we'll not only have to deal with the huge amount of contributions, but also with more bugs and regressions.
|
||||
|
||||
### Is there anything else you wish our readers knew about your work?
|
||||
|
||||
With all the specialities around the Linux kernel, it often helps me to remember that at the bottom, it is just code.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/business/16/10/linux-kernel-review
|
||||
|
||||
作者:[Deb Nicholson][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/eximious
|
@ -0,0 +1,86 @@
|
||||
FEDORA FOR BEGINNERS: CHAPEAU LINUX 24 RELEASED
|
||||
===================
|
||||
|
||||
[][24]
|
||||
|
||||
[Chapeau][23] is a beginner focused [Fedora based Linux distribution][22]. Chapeau Linux has released its new version 24 recently.
|
||||
|
||||
As the name suggests, Chapeau 24 is based on Fedora 24\. So you can expect most, if not all, [Fedora 24 features][21] in Chapeau 24 as well.
|
||||
|
||||
I’ll add a trivia here. You might already know that [Fedora is kind of hat][20]. I think since [Fedora][19] is a community project from [Red Hat][18], they just named it after another kind of hat. Interestingly, [Chapeau is also a kind of hat][17], a French one. Now these names make sense, don’t they? If you like such trivial fact check out the logic behind other [Linux distributions naming conventions][16].
|
||||
|
||||
### CHAPEAU 24 FEATURES
|
||||
|
||||
Pretty much what Fedora 24 has to offer. It still runs GNOME 3.20 which is understandable as it was only recently that [GNOME 3.22 was released][15]. Some of the main new highlights of Chapeau 24 release are:
|
||||
|
||||
* [Gnome][10] 3.20 desktop environment
|
||||
* LibreOffice 5
|
||||
* [PlayOnLinux][9] & [Wine][8]
|
||||
* [Steam][7]
|
||||
* [VLC][6]
|
||||
* [Mozilla Firefox][5] with [Adobe Flash][4].
|
||||
* [Hardware Helper Tool (hht)][3] (introduced in [Chapeau 23][2], this tool helps to find drivers for your hardware)
|
||||
* [RPMFusion][1] software sources preconfigured
|
||||
* Media codecs and DVD playback support
|
||||
* Gnome Boxes
|
||||
* KVM virtualisation
|
||||
* Dropbox integration
|
||||
* UI improvements
|
||||
* Broadcom wireless chipset firmware
|
||||
* CUPS backend for Canon printers
|
||||
* Linux kernel 4.7
|
||||
|
||||
[][14]
|
||||
|
||||
[][13]
|
||||
|
||||
### SHOULD YOU BE USING CHAPEAU 24?
|
||||
|
||||
That’s a difficult question to answer. See, in the world of Linux, we have over 300 active Linux distributions. Plenty of them are for desktop users.
|
||||
|
||||
It is up to individuals what they prefer. You can totally install Fedora 24 and install various tool along with it and then you don’t need to look elsewhere. But you might also know that Fedora is quite tightfisted when it comes to proprietary hardware support.
|
||||
|
||||
Altogether, Chapeau is a nice to have Linux distribution that gives you Fedora minus the headaches. If GNOME is what you like, Chapeau Linux could be your game.
|
||||
|
||||
You can download Chapeau 24 from SourceForge:
|
||||
|
||||
[Download Chapeau 24][12]
|
||||
|
||||
Have you already given it a try? How is your experience with it?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/chapeau-linux-24-released/?utm_source=newsletter&utm_medium=email&utm_campaign=11_websites_for_linux_gamers_and_other_linux_stories&utm_term=2016-10-19
|
||||
|
||||
作者:[Abhishek Prakash ][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://itsfoss.com/author/abhishek/
|
||||
[1]:http://rpmfusion.org/
|
||||
[2]:https://itsfoss.com/chapeau-23-armstrong-released/
|
||||
[3]:http://chapeaulinux.org/hardware-helper-tool
|
||||
[4]:http://www.adobe.com/products/flashplayer.html
|
||||
[5]:https://www.mozilla.org/en-US/firefox/desktop
|
||||
[6]:http://www.videolan.org/
|
||||
[7]:https://itsfoss.com/install-steam-ubuntu-linux/
|
||||
[8]:https://itsfoss.com/use-windows-applications-linux/
|
||||
[9]:http://www.playonlinux.com/
|
||||
[10]:http://www.gnome.org/
|
||||
[12]:https://sourceforge.net/projects/chapeau/files/releases/Chapeau_24_x86-64.iso/download
|
||||
[13]:https://itsfoss.com/wp-content/uploads/2016/09/chapeau-24_desktop_wine.jpg
|
||||
[14]:https://itsfoss.com/wp-content/uploads/2016/09/chapeau-24-desktop-1.jpg
|
||||
[15]:https://itsfoss.com/gnome-3-22-new-features/
|
||||
[16]:https://itsfoss.com/linux-code-names/
|
||||
[17]:https://en.wikipedia.org/wiki/Chapeau
|
||||
[18]:https://www.redhat.com/en
|
||||
[19]:https://getfedora.org/
|
||||
[20]:https://en.wikipedia.org/wiki/Fedora
|
||||
[21]:https://itsfoss.com/fedora-24-released/
|
||||
[22]:https://itsfoss.com/best-fedora-linux-distributions/
|
||||
[23]:http://chapeaulinux.org/
|
||||
[24]:https://itsfoss.com/wp-content/uploads/2016/09/chapeau-24-release.jpg
|
@ -1,3 +1,4 @@
|
||||
ucasFL translating
|
||||
THIS OPEN SOURCE MINI COMPUTER WILL DELETE DATA IF TEMPERED WITH
|
||||
===========
|
||||
|
||||
|
124
sources/tech/20161012 7 Mistakes New Linux Users Make.md
Normal file
124
sources/tech/20161012 7 Mistakes New Linux Users Make.md
Normal file
@ -0,0 +1,124 @@
|
||||
OneNewLife translating.
|
||||
|
||||
7 Mistakes New Linux Users Make
|
||||
===================
|
||||
|
||||
Changing operating systems is a big step for anybody -- all the more so because many users are uncertain about exactly what an operating system is.
|
||||
|
||||
However, switching from Windows to Linux is especially hard. The two operating systems have different assumptions and priorities, as well as different ways of doing things. As a result, it is easy for new Linux users to wind up confused because the expectations they have developed using Windows no longer apply.
|
||||
|
||||
For instance, here, in no particular order, are seven mistakes that refugees from Windows can fall into when they start to use Linux:
|
||||
|
||||
### 7\. Choosing the Wrong Linux Distribution
|
||||
|
||||
Linux comes in several hundred different versions, or distributions as they are called. Many of these are specialized and intended for different versions or users. Choose the wrong one, and your first hands- on encounter with Linux can quickly become a nightmare.
|
||||
|
||||
If you are switching with the help of a friend, make sure that their recommendation is suitable for you, not them. Dozens of articles are available to help you, but if you stay with the top twenty or so on the[Distrowatch][46] listings, you are unlikely to go wrong.
|
||||
|
||||
Better yet, try a [Live DVD][45] of a distribution before installing it. A Live DVD runs the distribution from an external device, allowing you to test it without making any changes to your hard drive. In fact, unless you know how to make drives accessible under Linux, you won't even be able to see your hard drive.
|
||||
|
||||
### 6\. Expecting Everything to Be the Same
|
||||
|
||||
Because of limited experience, many Windows users do not understand that a new operating system means new programs and new ways of doing things. No, your Windows programs will not run on Linux unless you use [WINE][44] or have a virtual Windows machine. You can't run MS Office or PhotoShop either -- you'll have to learn LibreOffice and Krita instead. These days, the applications will probably have the same features as similar ones on Windows, but their features may have different names and may be available from different menus or toolbars.
|
||||
|
||||
Even the assumptions are different. Windows users are especially likely to be taken aback by the idea that they more than one desktop environment to choose from -- at least seven main ones, and several dozen minor ones.
|
||||
|
||||
### 5\. Puzzling About How to Install Software
|
||||
|
||||
In Windows, new software is installed as a completely separate program. Often, it include all the libraries and other dependencies it requires.
|
||||
|
||||
Two services called [Flatpak][43] and[Snap][42] are currently introducing a similar installation system on Linux, but they are largely for mobile and embedded devices. More often, Linux depends on a package management system in which programs install only the software that is absolutely necessary, relying on what is already installed to supply anything else that is needed.
|
||||
|
||||
Package management is essentially the workstation and laptop equivalent of Google Play on a phone or tablet: it is quick, and requires no physical media for installation. However, it can also save 20-35% of hard drive space because dependencies are not duplicated.
|
||||
|
||||
### 4\. Assuming Software Updates Will Be Done For You
|
||||
|
||||
Linux users value control. It provides services, but by default they have to be run manually. For example, most distributions will let you know that updated software is available, but you will have to choose to install the updates.
|
||||
|
||||
If you choose, you can even decide on each update separately. You may, for example, not want to run a new kernel because something in your installation requires keeping the existing one. Or perhaps you want to run all the security updates, but not the routine new releases. The choice is yours.
|
||||
|
||||
### 3\. Ignoring Passwords
|
||||
|
||||
Many Windows users ignore passwords because logging in is inconvenient. At least as many routinely run an administrative account for convenience.
|
||||
|
||||
Neither practice is easy on Linux. Many distributions, especially those based on Ubuntu, use [sudo][41], to prevent running as root, and most others are installed so that root cannot be run with a graphical interface. However, if you do succeed in setting up either of these practices on Linux, be aware that you are nullifying most of Linux's security advantages (and that neither is recommended for Windows, either)
|
||||
|
||||
Oh, and the option for automatic logins you might see on an install program? Those are intended for unusual circumstances like virtual machines that contain no private information.
|
||||
|
||||
### 2\. Worrying About Defragmentation and Anti-Virus Software
|
||||
|
||||
Linux does occasionally need defragmentation, but only when a partition is being recovered or is nearly full. And, of course, as solid state hard drives become increasingly popular, defragmentation is becoming a concern of the past, although solid state drives do require a regular running of [trim][40] on any operating system.
|
||||
|
||||
Similarly, anti-virus software is a major concern only when your Linux installation is regularly passing on files to Windows machines. Very few Linux viruses or malware exist, and running a non-root account for everyday purposes, using strong passwords, and keeping a current backup should be enough to thwart them.
|
||||
|
||||
### 1\. Imagining Yourself Locked in to Software
|
||||
|
||||
Software costs on Windows, and most categories are monopolized by one company -- for example, MS Office for office suites, and Adobe for graphics and design. These conditions encourage users to stick with the same applications, no matter what their faults.
|
||||
|
||||
On Linux, the story is different. Only a few high end programs cost, and almost every category of software has two or three alternatives, all available as downloads in ten minutes or less. If one alternative doesn't suit you, you can delete it and install another one with no greater effort. On Linux, you almost always have a choice.
|
||||
|
||||
### Transition Time
|
||||
|
||||
Probably no amount of advice can completely prepare Windows users for Linux. Even saying that new users should keep an open mind is only limited use, because expectations run so deep that many users are unaware that they even have them.
|
||||
|
||||
The best that new Linux users can do is expect to make mental adjustments, and to take some time getting used to them. The transition will take some effort, but, in the long run, it should repay the effort of making the switch many times over.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.datamation.com/open-source/7-mistakes-new-linux-users-make.html
|
||||
|
||||
作者:[Bruce Byfield][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.datamation.com/author/Bruce-Byfield-6030.html
|
||||
[1]:[https://www.youtube.com/channel/UCOfXyFkINXf_e9XNosTJZDw]
|
||||
[2]:[https://www.youtube.com/user/desainew]
|
||||
[3]:[https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w]
|
||||
[4]:[http://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F]
|
||||
[5]:[http://twitter.com/intent/tweet/?text=Is+Open+Source+Design+a+Thing%3F&url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F]
|
||||
[6]:[https://plus.google.com/share?url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F]
|
||||
[7]:[https://atom.io/]
|
||||
[8]:[http://froont.com/]
|
||||
[9]:[https://webflow.com/]
|
||||
[10]:[https://gravit.io/]
|
||||
[11]:[http://getbootstrap.com/]
|
||||
[12]:[https://inkscape.org/en/]
|
||||
[13]:[https://www.gimp.org/]
|
||||
[14]:[https://en.wikipedia.org/wiki/Free_and_open-source_software]
|
||||
[15]:[https://medium.com/dawn-capital/why-leverage-the-power-of-open-source-to-build-a-successful-software-business-8aba6f665bc4#.ggmn2ojxp]
|
||||
[16]:[https://github.com/majutsushi/tagbar]
|
||||
[17]:[http://ctags.sourceforge.net/]
|
||||
[18]:[https://github.com/majutsushi/tagbar/zipball/70fix]
|
||||
[19]:[https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim]
|
||||
[20]:[http://www.vim.org/scripts/script.php?script_id=2332]
|
||||
[21]:[https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-2-syntastic/]
|
||||
[22]:[https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-delimitmate-help.png]
|
||||
[23]:[https://github.com/Raimondi/delimitMate]
|
||||
[24]:[https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-visibility.png]
|
||||
[25]:[https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-ex2.png]
|
||||
[26]:[https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-example.png]
|
||||
[27]:[http://www.tldp.org/LDP/intro-linux/html/sect_06_02.html]
|
||||
[28]:[http://majutsushi.github.io/tagbar/]
|
||||
[29]:[http://vi.stackexchange.com/questions/388/what-is-the-difference-between-the-vim-plugin-managers]
|
||||
[30]:[https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-vimrc.png]
|
||||
[31]:[http://www.vim.org/]
|
||||
[32]:[https://github.com/scrooloose/syntastic]
|
||||
[33]:[https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt]
|
||||
[34]:[https://www.howtoforge.com/images/3337/big/syntastic-error-all-descr.png]
|
||||
[35]:[https://www.howtoforge.com/images/3337/big/syntastic-error-descr.png]
|
||||
[36]:[https://www.howtoforge.com/images/3337/big/syntastic-error-highlight.png]
|
||||
[37]:[https://github.com/scrooloose/syntastic]
|
||||
[38]:[http://www.vim.org/]
|
||||
[39]:[https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers/]
|
||||
[40]:[https://en.wikipedia.org/wiki/Trim_%28computing%29]
|
||||
[41]:[https://en.wikipedia.org/wiki/Sudo]
|
||||
[42]:[http://snapcraft.io/]
|
||||
[43]:[http://flatpak.org/]
|
||||
[44]:[https://en.wikipedia.org/wiki/Wine_%28software%29]
|
||||
[45]:[https://en.wikipedia.org/wiki/Live_CD]
|
||||
[46]:[http://distrowatch.com/]
|
92
sources/tech/20161014 IS OPEN SOURCE DESIGN A THING.md
Normal file
92
sources/tech/20161014 IS OPEN SOURCE DESIGN A THING.md
Normal file
@ -0,0 +1,92 @@
|
||||
fuowang 翻译中
|
||||
|
||||
IS OPEN SOURCE DESIGN A THING
|
||||
================
|
||||
|
||||
|
||||
The [prowess and power][15] of Open Source is undeniable. From servers, to the desktop, mobile, to the underpinnings of the so-called “Internet of Things”, Open Source spans sectors and continents, public and private. One profession, however, that has traditionally been dominated by closed, proprietary software solutions – and usually very expensive ones at that! – is the field of design. In this article, we’ll take a look at some free and open source options to pad, if not replace your existing design arsenal. Maybe you’re a designer just starting out and you are understandably on a budget. Maybe you’re more seasoned and simply want to adopt more of an “open” workflow. Read on and let’s see what the [free and open source software][14] world has to offer!
|
||||
|
||||
### GRAPHICS
|
||||
|
||||
In the open source world, there are a few very formidable and viable alternatives to the mainstays offered by Adobe.
|
||||
|
||||
### GIMP
|
||||
|
||||
The GIMP or [GNU Image Manipulation Program][13] is a very a powerful free and open source alternative to Adobe’s Photoshop. Developed and maintained by a sizeable core team, GIMP offers powerful photo editing tools for the design creative, such as filters, brushes, retouching. It can even handle .PSD files if you want to make use of UX/UI libraries for your design mock-ups. Finally, GIMP can also be used for digital art, logos and the like. GIMP is available as a free download for Linux, MacOS and Windows.
|
||||
|
||||
### Inkscape
|
||||
|
||||
[Inkscape][12], whose moniker, well represents their core values – “Draw Freely” – is an Open Source and free alternative to another Adobe product, Illustrator, a powerful but proprietary and expensive, vector program. Inkscape offers a plethora of design and drawing tools, easy to navigate color selection, filters and gradient tools and much, much more. Designers committed to open source solutions will also find good documentation online in the form of blog posts and forum posts. Like GIMP, Inkscape is free to download on Linux, MacOS and Windows.
|
||||
|
||||
Want to learn from some seasoned graphic and web designers making use of these open source tools? Check out these YouTubers:
|
||||
|
||||
* [Nick Saporito][3] (Nick is an excellent resource for an introduction to the basic features of Inkscape you’ll use on a daily basis as a logo, web or graphic designer).
|
||||
* [Irfan Prastinato][2] (Irfan’s channel highlights modern logo creation through the power of Inkscape).
|
||||
* [Cameron Bohnstedt][1] (Cameron is a digital artist who really showcases the power of open source tools (GIMP Inkscape, Blender) in the hands of a seasoned pro. Inspirational and informative).
|
||||
|
||||
### WEB DESIGN AND DEVELOPMENT
|
||||
|
||||
When it comes to designing and prototyping full-fledged, feature rich, responsive websites there are several options – some of them open source – for the designer. These options have come such a long way in recent years, that they are, in my opinion, a reflection, if not the reality of what responsive web design needs to look like as the devices we create for change as rapidly as design trends do.
|
||||
|
||||
### Bootstrap
|
||||
|
||||
In my opinion, [Bootstrap][11] has advanced and really pushed the responsive, even mobile-first design envelope forward, leaps and bounds. Originally crafted by Twitter developers Mark Otto and Jacob Thornton, Bootstrap is a framework that allows you to make sites that fit your client’s needs, fully open source and fully customizable. With Bootstrap you’ll get a rock solid base with Bootstrap 4.0, currently in alpha, promises many under-the-hood improvements to an already solid version 3.0, including the move from Less to Sass, an enhanced grid system, a reworking of JavaScript plugins, and much more.
|
||||
|
||||
### Gravit
|
||||
|
||||
Another up and coming free and open source vector program garnering much well-deserved attention is Gravit. Running in your browser,[Gravit][10] is not only a viable alternative to Adobe Illustrator from a vector standpoint (though not as feature rich), but also holds promise as a full-fledged design environment. You can straightforwardly and simply design everything from logos, to print work to mobile apps and websites. I’ve relied upon Gravit for some of the work I’ve done recently, since it’s available to me in the my browser of choice, in addition to being powerful, simple, clean and intuitive.
|
||||
|
||||
### Some Free, But Not Open Source, Solutions…
|
||||
|
||||
### Webflow
|
||||
|
||||
[Webflow][9] is a powerful all-encompassing web design environment, running in the comfort of your browser. The wonder of Webflow is the ability to design without coding, essentially, and while you design, have the code generated for you behind the scenes, as it were. I find the interface of Webflow to be clean, crisp and easy to follow…intuitive. Admittedly, Webflow isn’t Open Source, but there is a free option that allows a designer two projects at a time as they design and develop their sites.
|
||||
|
||||
### Froont
|
||||
|
||||
Another browser-based web design program is [Froont][8]. Similar to Webflow, Froont is very intuitive, cleanly designed and powerful. You can effectively and efficiently design an entire website that is fresh, unique and, most of all, responsive, working on all relevant devices. Finally, Froont, like Webflow allows the designer to export code as needed.
|
||||
|
||||
Both Webflow and Froont have free options in addition to paid plans, perfect for building out a site at a time, allowing you to also publish your work to the web, if you so choose.
|
||||
|
||||
### Text Editors
|
||||
|
||||
There are several options for designers and developers who want an open source and free alternative to write and/or edit code.
|
||||
|
||||
### Atom
|
||||
|
||||
Billed as a “[hackable editor for the 21st Century][7]”, Atom is a full-featured text editor with seemingly every built-in feature – like auto-complete and multi-pane views – needed to get the job done, but also completely hackable, allowing the user to customize to their liking. There’s also a package manager, in which users can download thousands of packages to customize Atom further and add unique levels of functionality.
|
||||
|
||||
### CONCLUSION
|
||||
|
||||
In this day and age, designers need not feel captive to expensive, bloated, proprietary software. With several free and open source tools at their disposal, the budget and free and Open Source-conscience designer has more than enough options to create, beautiful and functional designs for their clients! Please share this article if you liked it, and hit me up in the comments below with your favorite Open Source design tools!
|
||||
|
||||
[Share on Google+][6][Share on Twitter][5][Share on Facebook][4]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://freedompenguin.com/articles/opinion/open-source-design-thing/
|
||||
|
||||
作者:[Sean LeRoy][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://freedompenguin.com/author/seanleroy/
|
||||
[1]:https://www.youtube.com/channel/UCOfXyFkINXf_e9XNosTJZDw
|
||||
[2]:https://www.youtube.com/user/desainew
|
||||
[3]:https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w
|
||||
[4]:http://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[5]:http://twitter.com/intent/tweet/?text=Is+Open+Source+Design+a+Thing%3F&url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[6]:https://plus.google.com/share?url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[7]:https://atom.io/
|
||||
[8]:http://froont.com/
|
||||
[9]:https://webflow.com/
|
||||
[10]:https://gravit.io/
|
||||
[11]:http://getbootstrap.com/
|
||||
[12]:https://inkscape.org/en/
|
||||
[13]:https://www.gimp.org/
|
||||
[14]:https://en.wikipedia.org/wiki/Free_and_open-source_software
|
||||
[15]:https://medium.com/dawn-capital/why-leverage-the-power-of-open-source-to-build-a-successful-software-business-8aba6f665bc4#.ggmn2ojxp
|
@ -0,0 +1,155 @@
|
||||
WattOS: A Rock-Solid, Lightning-Fast, Lightweight Linux Distro For All
|
||||
=============================
|
||||
|
||||

|
||||
|
||||
Jack Wallen takes a look at what makes lightweight WattOS special.
|
||||
|
||||
[Used with permission][81]
|
||||
|
||||
Everyone in the land of Linux has either heard of or made use of a lightweight Linux distribution. We all know the drill: small footprint, low resource requirement, includes a lightweight desktop environment (or window manager), and offers the same general layout as the next distribution, staking the same claims.
|
||||
|
||||
And most often they do their jobs. One problem that strikes down many of these lightweight Linux distros is that they don’t really include the tools the average user needs to get their work done. To that end, they wind up relegated to specialty tasks (like data recovery, kiosks, etc.).
|
||||
|
||||
To some extent, WattOS suffers from these same pitfalls (the only productivity tool it includes is a PDF viewer, and it uses the standard “task bar/start menu” metaphor for the desktop). Fortunately, however, WattOS makes up for those shortcomings by way of incredible speed, reliability, and the inclusion of the Synaptic Package Manager; so, WattOS could easily become a lightweight Linux distribution for everyone.
|
||||
|
||||
Let’s take a look at what makes WattOS special.
|
||||
|
||||
### The kernel
|
||||
|
||||
I was actually surprised to find WattOS to ship with kernel 4.4\. After an immediate upgrade, the uname -r command returned 4.4.0-38-generic. Considering this is a distribution targeted at bringing life to older, slower machines, the inclusion of the same kernel found on my Elementary OS Loki release was a pleasant surprise. This means WattOS should do a great job of working with both older and newer hardware.
|
||||
|
||||
Not so surprising is the fact that, when you go to the WattOS, you’ll find downloads for both the 32- and 64-bit versions (most modern distros are leaning away from 32-bit releases now). So, not only does the kernel offer support for modern hardware, but the architecture releases will allow you to give life to those older 32-bit machines.
|
||||
|
||||
### The speed
|
||||
|
||||
Once I’d installed WattOS, I had one of those moments of purest envy. The speed at which WattOS runs is incredible. Even when working with the platform as a VirtualBox guest, the speed of the WattOS desktop blew away my Elementary OS Loki desktop. Understand that the machine running the host is a [System76 Leopard][80], with a liquid cooled i7 and 16GB of RAM. Handing over approximately 2GB of RAM to WattOS made it feel like absolutely nothing could slow it down. The impressiveness of the speed is almost too much to describe...it has to be experienced. I’ve never witnessed Firefox open so quickly.
|
||||
|
||||
Speaking of app launching...LibreOffice. I wanted to test the speed at which LibreOffice would open, so I fired up the Synaptic Package Manager and attempted an install of the flagship, open source office suite.
|
||||
|
||||
To no avail.
|
||||
|
||||
The issue with installing LibreOffice centered on an uninstallable python3-uno package, and no matter what I tried, I couldn’t get it installed. However, after downloading the latest .deb release from the [LibreOffice site][79], I could unpack that download file, cd into LibreOffice_5.2.2.2_Linux_x86-64_deb/DEBS/ and then issue the command sudo dpkg -i *.deb to finally get LibreOffice installed.
|
||||
|
||||
How did LibreOffice run? Insanely fast. Once again, I’ve never seen this app open as quickly as on WattOS. Upon clicking the LibreOffice Writer icon, the app launched in half the time as it did on the host Elementary OS Loki (and that already is quite fast).
|
||||
|
||||
### The desktop
|
||||
|
||||
My personal preference of desktops tends to veer toward the more modern iterations. I’m a fan of Ubuntu Unity, GNOME 3, and (especially) [Elementary OS][78]. So the idea of using an old-school desktop metaphor has very little appeal to me. Even so, WattOS has done a great job of breathing a bit of modernity into the old school design. Take, for instance, the default desktop theme (Figure 1). The WattOS UI designers have done a decent job of theming the desktop so it doesn’t completely fall too far into the well of Windows XP or old-school Linux CDE-like window managers.
|
||||
|
||||

|
||||
|
||||
>Figure 1: The WattOS file manage revealing a somewhat modern theme. [Used with permission][76]
|
||||
|
||||
There’s really little to say about the WattOS desktop (powered by [LXDE][75]) that hasn’t already been said about every Linux desktop of this ilk—it’s simple, straightforward, offers just enough flexibility and customization, and will be familiar to anyone who has used a computer since Windows 95.
|
||||
|
||||
### Surprises, good and bad
|
||||
|
||||
As with every new Linux desktop experience, there are always surprises of both the good and bad nature. First, the good.
|
||||
|
||||
Beyond the sheer speed of WattOS (and again I’ll comment on this with a simple...WOW!), there are a few little nice surprises tacked onto the desktop (most in the way of included applications). One of the best additions (one you rarely find included in a desktop by default) is [KeePassX][74]. I’ve come to the conclusion that password managers should be included on every desktop by default...and kudos to WattOS for including this outstanding tool.
|
||||
|
||||
Next comes the inclusion of Firefox. Many of the lightweight distributions will include browsers like [Surf][73] or [Midori][72]. Both are fine browsers, but they often fall short when it comes to websites like Google Docs. Because WattOS includes the full-blown Firefox, you will find the platform functions perfectly with any Firefox-compatible website.
|
||||
|
||||
Lastly, the less-than-good surprises. As I’ve already stated, I ran into an immediate hitch with installing LibreOffice. Installing the likes of GIMP went smoothly, however (so I concluded that was a one-off issue). Beyond that one problem, I believe the default desktop menu to be somewhat poorly laid out. For instance, the Synaptic Package Manager is found in the Preferences menu. I’d much rather see that listed prominently in the main menu and labeled something like “Install Applications” (or anything that a new user wouldn’t have trouble understanding). From my perspective, the Preferences menu should be dedicated to tools used to configure the various aspects of the platform...not installing applications.
|
||||
|
||||
Beyond that, you’d be hard-pressed to find anything wrong with WattOS—especially considering you’re looking at a Linux distribution geared toward older and lesser-powered hardware.
|
||||
|
||||
### The conclusion
|
||||
|
||||
Although WattOS is designed to give life to older hardware, there’s no reason why it couldn’t serve on a modern desktop...and serve it well. With a next-to-zero learning curve, WattOS is instantly familiar, blazingly fast, and rock solid. Give this small footprint Linux distro a try; I’m confident you’ll be equally impressed. And if you find WattOS not fast enough (something I cannot imagine happening), you can always give [Microwatt][71] a go (an even lighter, lightweight distribution).
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/wattos-rock-solid-lightning-fast-lightweight-linux-distro-all
|
||||
|
||||
作者:[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.youtube.com/channel/UCOfXyFkINXf_e9XNosTJZDw
|
||||
[2]:https://www.youtube.com/user/desainew
|
||||
[3]:https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w
|
||||
[4]:http://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[5]:http://twitter.com/intent/tweet/?text=Is+Open+Source+Design+a+Thing%3F&url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[6]:https://plus.google.com/share?url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[7]:https://atom.io/
|
||||
[8]:http://froont.com/
|
||||
[9]:https://webflow.com/
|
||||
[10]:https://gravit.io/
|
||||
[11]:http://getbootstrap.com/
|
||||
[12]:https://inkscape.org/en/
|
||||
[13]:https://www.gimp.org/
|
||||
[14]:https://en.wikipedia.org/wiki/Free_and_open-source_software
|
||||
[15]:https://medium.com/dawn-capital/why-leverage-the-power-of-open-source-to-build-a-successful-software-business-8aba6f665bc4#.ggmn2ojxp
|
||||
[16]:https://github.com/majutsushi/tagbar
|
||||
[17]:http://ctags.sourceforge.net/
|
||||
[18]:https://github.com/majutsushi/tagbar/zipball/70fix
|
||||
[19]:https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
[20]:http://www.vim.org/scripts/script.php?script_id=2332
|
||||
[21]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-2-syntastic/
|
||||
[22]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-delimitmate-help.png
|
||||
[23]:https://github.com/Raimondi/delimitMate
|
||||
[24]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-visibility.png
|
||||
[25]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-ex2.png
|
||||
[26]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-example.png
|
||||
[27]:http://www.tldp.org/LDP/intro-linux/html/sect_06_02.html
|
||||
[28]:http://majutsushi.github.io/tagbar/
|
||||
[29]:http://vi.stackexchange.com/questions/388/what-is-the-difference-between-the-vim-plugin-managers
|
||||
[30]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-vimrc.png
|
||||
[31]:http://www.vim.org/
|
||||
[32]:https://github.com/scrooloose/syntastic
|
||||
[33]:https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[34]:https://www.howtoforge.com/images/3337/big/syntastic-error-all-descr.png
|
||||
[35]:https://www.howtoforge.com/images/3337/big/syntastic-error-descr.png
|
||||
[36]:https://www.howtoforge.com/images/3337/big/syntastic-error-highlight.png
|
||||
[37]:https://github.com/scrooloose/syntastic
|
||||
[38]:http://www.vim.org/
|
||||
[39]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers/
|
||||
[40]:https://en.wikipedia.org/wiki/Trim_%28computing%29
|
||||
[41]:https://en.wikipedia.org/wiki/Sudo
|
||||
[42]:http://snapcraft.io/
|
||||
[43]:http://flatpak.org/
|
||||
[44]:https://en.wikipedia.org/wiki/Wine_%28software%29
|
||||
[45]:https://en.wikipedia.org/wiki/Live_CD
|
||||
[46]:http://distrowatch.com/
|
||||
[47]:http://www.internetnews.com/skerner/2009/10/white-house-goes-open-source-w.html
|
||||
[48]:https://www.whitehouse.gov/blog/2016/10/13/removing-barriers-constituent-conversations
|
||||
[49]:http://planetwatt.com/new/index.php/2016/09/23/microwatt-r10-released/
|
||||
[50]:http://midori-browser.org/
|
||||
[51]:http://surf.suckless.org/
|
||||
[52]:https://www.keepassx.org/
|
||||
[53]:http://lxde.org/
|
||||
[54]:https://www.linux.com/licenses/category/used-permission
|
||||
[55]:https://www.linux.com/files/images/wattosapng
|
||||
[56]:https://elementary.io/
|
||||
[57]:https://www.libreoffice.org/
|
||||
[58]:https://system76.com/desktops/leopard
|
||||
[59]:https://www.linux.com/licenses/category/used-permission
|
||||
[60]:http://planetwatt.com/new/index.php/2016/09/23/microwatt-r10-released/
|
||||
[61]:http://midori-browser.org/
|
||||
[62]:http://surf.suckless.org/
|
||||
[63]:https://www.keepassx.org/
|
||||
[64]:http://lxde.org/
|
||||
[65]:https://www.linux.com/licenses/category/used-permission
|
||||
[66]:https://www.linux.com/files/images/wattosapng
|
||||
[67]:https://elementary.io/
|
||||
[68]:https://www.libreoffice.org/
|
||||
[69]:https://system76.com/desktops/leopard
|
||||
[70]:https://www.linux.com/licenses/category/used-permission
|
||||
[71]:http://planetwatt.com/new/index.php/2016/09/23/microwatt-r10-released/
|
||||
[72]:http://midori-browser.org/
|
||||
[73]:http://surf.suckless.org/
|
||||
[74]:https://www.keepassx.org/
|
||||
[75]:http://lxde.org/
|
||||
[76]:https://www.linux.com/licenses/category/used-permission
|
||||
[77]:https://www.linux.com/files/images/wattosapng
|
||||
[78]:https://elementary.io/
|
||||
[79]:https://www.libreoffice.org/
|
||||
[80]:https://system76.com/desktops/leopard
|
||||
[81]:https://www.linux.com/licenses/category/used-permission]
|
@ -0,0 +1,122 @@
|
||||
GHLandy Translating
|
||||
|
||||
Useful Vim editor plugins for software developers - part 2: Syntastic
|
||||
============
|
||||
|
||||
There's no doubt that Vim is a capable programming editor out-of-the-box, but it's the editor's plugins that help you make the most out of it. In the [first part][39] of this article series, we discussed a couple of programing-related Vim plugins (Tagbar and delimitMate). Continuing on the same path, in this article, we will discuss another useful Vim plugin aimed at software developers - Syntastic.
|
||||
|
||||
Please note that all the examples, commands, and instructions mentioned in this tutorial have been tested on Ubuntu 16.04, and the Vim version we've used is 7.4.
|
||||
|
||||
### Syntastic
|
||||
|
||||
If your software development work involves working with languages like C and C++, it's needless to say that resolving compile time errors would be part of your daily work. Many a times, compilation errors arise due to incorrect syntax used in source code, as developers fail to observe them while just looking at the code.
|
||||
|
||||
What if I tell you there exists a Vim plugin that provides information about syntax errors without you having to compile your code? Yes, such a plugin exists, and it's name is Syntastic.
|
||||
|
||||
"Syntastic is a syntax checking plugin for [Vim][38] that runs files through external syntax checkers and displays any resulting errors to the user. This can be done on demand, or automatically as files are saved," the [official documentation][37] of the plugin says. "If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them."
|
||||
|
||||
Installation of this plugin is similar to the way we installed the ones that were discussed in the first part - all you need to do is to run the following commands:
|
||||
|
||||
```
|
||||
cd ~/.vim/bundle/
|
||||
|
||||
git clone https://github.com/scrooloose/syntastic.git
|
||||
```
|
||||
|
||||
Once the plugin is installed successfully (meaning the above commands are successful), you don't have to do anything else - it loads automatically when the Vim editor is launched.
|
||||
|
||||
Now, to use the plugin, open a source code file and save it using the :w Vim command. After a very brief pause, you'll observe that syntax errors - if any - in your code will be highlighted. For example, the following screenshot should give you an idea about how the plugin highlights the errors:
|
||||
|
||||
[][36]
|
||||
|
||||
The '>>' sign in the beginning of a line indicates that there's some problem with the code written in that line. To know what exactly the error is, or at-least get a rough idea about it, bring the cursor to that line - the error description will be displayed at the bottom of the Vim window.
|
||||
|
||||
[][35]
|
||||
|
||||
So this way, you can resolve most of the syntax-related errors without even compiling the code.
|
||||
|
||||
Moving on, if you run the :Errors command, description of all the syntax-related errors in the current source file will be displayed. For example, running the:Errors command in my case brought up the following information:
|
||||
|
||||
[][34]
|
||||
|
||||
Keep in mind that the information the :Errors command displays isn't auto-refreshed, meaning even after an error is resolved, it's description will be there at the bottom area until you run the :Errors command again.
|
||||
|
||||
It's worth mentioning that there are [many configuration options][33] that make Syntastic even more user-friendly. For example, you can put the following line in your .vimrc file if you want the :Errors command to automatically update its output each time an error is resolved:
|
||||
|
||||
```
|
||||
let g:syntastic_always_populate_loc_list = 1
|
||||
```
|
||||
|
||||
To make sure that Syntastic highlights the errors automatically when a file is opened, add the following line to your .vimrc file:
|
||||
|
||||
```
|
||||
let g:syntastic_check_on_open = 1
|
||||
let g:syntastic_auto_jump = 1
|
||||
```
|
||||
|
||||
"When set to 2 the cursor will jump to the first issue detected, but only if this issue is an error," and "when set to 3 the cursor will jump to the first error detected, if any. If all issues detected are warnings, the cursor won't jump."
|
||||
|
||||
The following information should also be useful to you:
|
||||
|
||||
"Use :SyntasticCheck to manually check" for errors. "Use :Errors to open the location-list window, and :lclose to close it. You can clear the error list with:SyntasticReset, and you can use :SyntasticToggleMode to switch between active (checking on writing the buffer) and passive (manual) checking."
|
||||
|
||||
Note: Syntastic isn't just limited to code written in C and C++. It supports a huge list of other programming languages as well - head [here][32] to learn more about it.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Undoubtedly, Syntastic is a very useful Vim plugin as it saves you from the hassle of frequent compilation at-least when it comes to syntax-related errors. And not to mention that a lot of your time gets saved as well.
|
||||
|
||||
As you would have observed, Syntastic becomes even more useful once you've configured some of its main options. To help you get started with this, the official documentation contains a 'Recommended settings' section - do go through that. There is a nice little FAQ section as well in case you face some errors or have some doubts or queries.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-2-syntastic/
|
||||
|
||||
作者:[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/vim-editor-plugins-for-software-developers-2-syntastic/
|
||||
[1]:https://www.youtube.com/channel/UCOfXyFkINXf_e9XNosTJZDw
|
||||
[2]:https://www.youtube.com/user/desainew
|
||||
[3]:https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w
|
||||
[4]:http://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[5]:http://twitter.com/intent/tweet/?text=Is+Open+Source+Design+a+Thing%3F&url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[6]:https://plus.google.com/share?url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[7]:https://atom.io/
|
||||
[8]:http://froont.com/
|
||||
[9]:https://webflow.com/
|
||||
[10]:https://gravit.io/
|
||||
[11]:http://getbootstrap.com/
|
||||
[12]:https://inkscape.org/en/
|
||||
[13]:https://www.gimp.org/
|
||||
[14]:https://en.wikipedia.org/wiki/Free_and_open-source_software
|
||||
[15]:https://medium.com/dawn-capital/why-leverage-the-power-of-open-source-to-build-a-successful-software-business-8aba6f665bc4#.ggmn2ojxp
|
||||
[16]:https://github.com/majutsushi/tagbar
|
||||
[17]:http://ctags.sourceforge.net/
|
||||
[18]:https://github.com/majutsushi/tagbar/zipball/70fix
|
||||
[19]:https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
[20]:http://www.vim.org/scripts/script.php?script_id=2332
|
||||
[21]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-2-syntastic/
|
||||
[22]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-delimitmate-help.png
|
||||
[23]:https://github.com/Raimondi/delimitMate
|
||||
[24]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-visibility.png
|
||||
[25]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-ex2.png
|
||||
[26]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-example.png
|
||||
[27]:http://www.tldp.org/LDP/intro-linux/html/sect_06_02.html
|
||||
[28]:http://majutsushi.github.io/tagbar/
|
||||
[29]:http://vi.stackexchange.com/questions/388/what-is-the-difference-between-the-vim-plugin-managers
|
||||
[30]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-vimrc.png
|
||||
[31]:http://www.vim.org/
|
||||
[32]:https://github.com/scrooloose/syntastic
|
||||
[33]:https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[34]:https://www.howtoforge.com/images/3337/big/syntastic-error-all-descr.png
|
||||
[35]:https://www.howtoforge.com/images/3337/big/syntastic-error-descr.png
|
||||
[36]:https://www.howtoforge.com/images/3337/big/syntastic-error-highlight.png
|
||||
[37]:https://github.com/scrooloose/syntastic
|
||||
[38]:http://www.vim.org/
|
||||
[39]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers/
|
76
sources/tech/20161017 White House Open-Sources Bot Code.md
Normal file
76
sources/tech/20161017 White House Open-Sources Bot Code.md
Normal file
@ -0,0 +1,76 @@
|
||||
White House Open-Sources Bot Code
|
||||
===================
|
||||
|
||||
|
||||
The race to build bots, that is automated chat technology that responds to user queries, has gone all the way to President Obama's home, The White House. The White House announced on October 14 that it is now open-sourcing its bot code in a bid to help enable more open collaboration and communication.
|
||||
|
||||

|
||||
|
||||
"To be specific, we are open-sourcing a Drupal module, complete with easy steps and boiler plate code," Jason Goldman, Chief Digital Officer of the White House wrote in a blog [post][48]. "This will enable Drupal 8 developers to quickly launch a Facebook Messenger bot."
|
||||
|
||||
The White House first [deployed ][47]its own website with the open-source Drupal Content Management System (CMS) back in 2009\. The White House has since been an active contributor to Drupal in many different ways, including releasing code used on the site as open-source. Among the items that the White House has previously release is the entire Drupal theme, known as 'fourtyfour' that is used on the WhiteHouse.gov site.
|
||||
|
||||
The full code for the new White House Facebook Messenger bot is now available on GitHub, including complete installation instructions as well as the project roadmap. Among the large items on the roadmap (listed under 'Enhancements and hopes') is to actually make the project into more of a standalone, modular effort by refactoring code such that it's usable outside of a Drupal CMS as well.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.internetnews.com/blog/skerner/white-house-open-sources-bot-code.html
|
||||
|
||||
作者:[Michael Kerner][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
|
||||
[a]: http://www.internetnews.com/blog/skerner/white-house-open-sources-bot-code.html
|
||||
[1]:https://www.youtube.com/channel/UCOfXyFkINXf_e9XNosTJZDw
|
||||
[2]:https://www.youtube.com/user/desainew
|
||||
[3]:https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w
|
||||
[4]:http://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[5]:http://twitter.com/intent/tweet/?text=Is+Open+Source+Design+a+Thing%3F&url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[6]:https://plus.google.com/share?url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[7]:https://atom.io/
|
||||
[8]:http://froont.com/
|
||||
[9]:https://webflow.com/
|
||||
[10]:https://gravit.io/
|
||||
[11]:http://getbootstrap.com/
|
||||
[12]:https://inkscape.org/en/
|
||||
[13]:https://www.gimp.org/
|
||||
[14]:https://en.wikipedia.org/wiki/Free_and_open-source_software
|
||||
[15]:https://medium.com/dawn-capital/why-leverage-the-power-of-open-source-to-build-a-successful-software-business-8aba6f665bc4#.ggmn2ojxp
|
||||
[16]:https://github.com/majutsushi/tagbar
|
||||
[17]:http://ctags.sourceforge.net/
|
||||
[18]:https://github.com/majutsushi/tagbar/zipball/70fix
|
||||
[19]:https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
[20]:http://www.vim.org/scripts/script.php?script_id=2332
|
||||
[21]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-2-syntastic/
|
||||
[22]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-delimitmate-help.png
|
||||
[23]:https://github.com/Raimondi/delimitMate
|
||||
[24]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-visibility.png
|
||||
[25]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-ex2.png
|
||||
[26]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-example.png
|
||||
[27]:http://www.tldp.org/LDP/intro-linux/html/sect_06_02.html
|
||||
[28]:http://majutsushi.github.io/tagbar/
|
||||
[29]:http://vi.stackexchange.com/questions/388/what-is-the-difference-between-the-vim-plugin-managers
|
||||
[30]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-vimrc.png
|
||||
[31]:http://www.vim.org/
|
||||
[32]:https://github.com/scrooloose/syntastic
|
||||
[33]:https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[34]:https://www.howtoforge.com/images/3337/big/syntastic-error-all-descr.png
|
||||
[35]:https://www.howtoforge.com/images/3337/big/syntastic-error-descr.png
|
||||
[36]:https://www.howtoforge.com/images/3337/big/syntastic-error-highlight.png
|
||||
[37]:https://github.com/scrooloose/syntastic
|
||||
[38]:http://www.vim.org/
|
||||
[39]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers/
|
||||
[40]:https://en.wikipedia.org/wiki/Trim_%28computing%29
|
||||
[41]:https://en.wikipedia.org/wiki/Sudo
|
||||
[42]:http://snapcraft.io/
|
||||
[43]:http://flatpak.org/
|
||||
[44]:https://en.wikipedia.org/wiki/Wine_%28software%29
|
||||
[45]:https://en.wikipedia.org/wiki/Live_CD
|
||||
[46]:http://distrowatch.com/
|
||||
[47]:http://www.internetnews.com/skerner/2009/10/white-house-goes-open-source-w.html
|
||||
[48]:https://www.whitehouse.gov/blog/2016/10/13/removing-barriers-constituent-conversations
|
@ -0,0 +1,313 @@
|
||||
translating by chao-zhi
|
||||
|
||||
An Everyday Linux User Review Of Xubuntu 16.10 - A Good Place To Start
|
||||
===============
|
||||
|
||||
### Introduction
|
||||
|
||||
[][36]
|
||||
|
||||
Xubuntu has always been one of my favourite distributions. It doesn't look as glamourous as some of the other Linux offerings out there and it certainly doesn't come with all the software you need pre-installed.
|
||||
|
||||
The thing that Xubuntu gives you is a great base to start from.
|
||||
|
||||
If you are the sort of person who likes to customise the look and feel of their desktop then XFCE is definitely the best desktop environment for this.
|
||||
|
||||
If you are low on system resources or you like to keep things nice and slick then XFCE is again a great option.
|
||||
|
||||
Xubuntu therefore has a head start on many of the other top Linux distributions because the XFCE desktop is installed by default.
|
||||
|
||||
There is no doubt that when it comes to hardware compatibility, ease of use, stability, ease of installation and a large community, Ubuntu is hard to beat.
|
||||
|
||||
Xubuntu is an official flavour of the Ubuntu Linux distribution so you get the best of Ubuntu but with the XFCE desktop installed instead of Unity.
|
||||
|
||||
If you want to be the one to choose the applications that come with your distribution then some other distributions come lots of applications pre-installed that you may not need.
|
||||
|
||||
Xubuntu comes with the bare essentials and beyond the small core of default inclusions it is up to you to find and install the rest.
|
||||
|
||||
This for me is why Xubuntu has always been a great distribution. Start with a simple base installation and customise it to be what you want it to be.
|
||||
|
||||
### How To Get Xubuntu
|
||||
|
||||
You can visit the Xubuntu website at
|
||||
|
||||
[http://xubuntu.org/][35]
|
||||
[][34]
|
||||
|
||||
The download page can be found at
|
||||
|
||||
[http://xubuntu.org/getxubuntu/][33]
|
||||
|
||||
There are two versions available. The LTS version is 16.04 and is the one most people will want to go for unless you like updating your operating system every 6 months.
|
||||
|
||||
The other version is the one I am reviewing today which is version 16.10.
|
||||
|
||||
You can either download a torrent in order to get the ISO file or you can visit one of the mirrors.
|
||||
|
||||
[][32]
|
||||
|
||||
If you choose to download from a mirror click on the appropriate ISO. For example click on the amd-64.iso file for 64-bit or i386.iso for 32-bit.
|
||||
|
||||
There are lots of guides for showing how to create bootable Linux USB drives:
|
||||
|
||||
* [This one shows how to create a Ubuntu one but it will work with Xubuntu][3]
|
||||
* [You can also try this one which is for Xubuntu][2]
|
||||
* [Or you can even try this one][1]
|
||||
|
||||
If all this seems too much trouble you can also
|
||||
|
||||
[buy one from here][31]
|
||||
|
||||
.
|
||||
|
||||
### Installation
|
||||
|
||||
[][30]
|
||||
|
||||
Installation of Xubuntu, as with other flavours of Ubuntu, is relatively straight forward.
|
||||
|
||||
If you have installed one, then you can generally install any of them.
|
||||
|
||||
Start off by choosing the installation language.
|
||||
|
||||
[][29]
|
||||
|
||||
You will be asked whether you want to update as you go and whether you wish to install the third party codecs and tools which enable you to play MP3 audio and use proprietary drivers.
|
||||
|
||||
You need to be connected to the internet in order to do either of these things.
|
||||
|
||||
Again It is relatively straight forward and covered later on in the review.
|
||||
|
||||
[][28]
|
||||
|
||||
If you have a spare unallocated disk partition and you have Windows installed you will see the option to install Xubuntu alongside Windows in a dual boot setup.
|
||||
|
||||
You also get the option to install Xubuntu as the sole operating system and you can also choose something else which lets you partition the way you want to.
|
||||
|
||||
[][27]
|
||||
|
||||
The next step is to choose where you live. This sets your time zone so that the clock is set up correctly.
|
||||
|
||||
[][26]
|
||||
|
||||
Two steps to go.
|
||||
|
||||
Choose your keyboard layout by choosing the language and keyboard configuration.
|
||||
|
||||
[][25]
|
||||
|
||||
Finally create a default user.
|
||||
|
||||
Enter your name, give your computer a name, set a username and then enter and repeat a password.
|
||||
|
||||
Xubuntu will now install and you should be good to go.
|
||||
|
||||
### First Impressions
|
||||
|
||||
[][24]
|
||||
|
||||
Xubuntu starts with a blue desktop with a single panel at the top. You will also see all of the drives that are available on your computer as icons on the desktop.
|
||||
|
||||
At the top of the screen is a single panel.
|
||||
|
||||
The left corner on the panel has a single icon (picture of a mouse) which when clicked brings up a stylish, lightweight but fully functional menu known as the Whisker menu.
|
||||
|
||||
The top right corner has icons for notifications, power settings, bluetooth settings, network settings, audio settings and a clock.
|
||||
|
||||
### Connecting To The Internet
|
||||
|
||||
[][23]
|
||||
|
||||
You can connect to the internet by clicking the network icon on the panel. A list of wireless networks will appear and you can connect to one by clicking on it and enter the password for the network.
|
||||
|
||||
I have installed Xubuntu on my Lenovo Ideapad Y700 which is quite modern. Many distributions have caused subtle issues with wireless connectivity which I have had to work around.
|
||||
|
||||
Xubuntu 16.10 works without having to make any modifications.
|
||||
|
||||
### Drivers
|
||||
|
||||
[][22]
|
||||
|
||||
It is worth looking for additional drivers which may be available for your computer.
|
||||
|
||||
Quite often the default option will be the open source drivers which are decent enough but if you have a good graphics card then it is worth installing the proprietary drivers.
|
||||
|
||||
You can find the additional drivers setup screen by opening the menu and searching for additional drivers.
|
||||
|
||||
If you see a driver appear for your graphics card and it says not working then I recommend sticking with the default graphics driver.
|
||||
|
||||
### Printers
|
||||
|
||||
[][21]
|
||||
|
||||
I have an Epson WF-2630 wireless printer. Xubuntu was able to find the printer straight away and installed the drivers relevant for the printer.
|
||||
|
||||
I printed test pages and the output was perfectly adequate.
|
||||
|
||||
### Network Attached Storage
|
||||
|
||||
[][20]
|
||||
|
||||
I have a WD MyCloud Storage device which is accessible over a wireless network.
|
||||
|
||||
You can access the device using the default file manager called Thunar. It is worth noting that when I clicked on Network to show devices the WD MyCloud device showed up but when I clicked on it I received an error.
|
||||
|
||||
However when I opened the Windows Network Folder the WD MyCloud device showed up again and I was able to access the folders on the drive.
|
||||
|
||||
### Software
|
||||
|
||||
[][19]
|
||||
|
||||
I mentioned at the beginning of the review that Xubuntu comes with a minimal set of applications. There is however almost everything you could need to get started.
|
||||
|
||||
Firefox is installed as the default web browser and Thunderbird is the default email client.
|
||||
|
||||
[][18]
|
||||
|
||||
You also get the full LibreOffice suite and the Parole media player which does the job.
|
||||
|
||||
There are a host of other tools such as an image viewer, calculator, disk burning software and a bittorrent client.
|
||||
|
||||
[][17]
|
||||
|
||||
I am glad that Abiword and Gnumeric have largely been omitted from most major distributions nowadays because they are both fairly irrelevant. Most people end up installing LibreOffice anyway.
|
||||
|
||||
The lack of a dedicated audio player is a little bit surprising and I have to say that I generally end up installing Google's Chrome browser as opposed to using Firefox.
|
||||
|
||||
The top picture in this section shows why. In that picture I am trying to watch Curb Your Enthusiam via the Google Play store but there were various DRM and other issues which prevented the video playing.
|
||||
|
||||
I can't be bothered jumping through hoops to bypass these issues when a simple download from the Google website sorts out the issue as shown below.
|
||||
|
||||
[][16]
|
||||
|
||||
### Installing Software
|
||||
|
||||
[][15]
|
||||
|
||||
The main issue that has plagued Ubuntu based distributions since the release of 16.04 is the fact that certain applications don't appear in the graphical software tool used to install software.
|
||||
|
||||
For instance you won't find Steam in the software manager.
|
||||
|
||||
[][14]
|
||||
|
||||
If you use the command line and type "sudo apt-cache search steam" you will see that the software is available to be installed.
|
||||
|
||||
[][13]
|
||||
|
||||
Steam isn't the only omission, other packages such as Skype are also not available via the graphical tool.
|
||||
|
||||
I would have expected this to have been resolved by now across all Ubuntu distributions.
|
||||
|
||||
I reviewed Kubuntu 16.04 recently and the software tool called Discover was completely inept. The search function didn't work at all.
|
||||
|
||||
Fortunately the software manager in Xubuntu generally works for most packages and I used it to search for and install the Quod Libet audio player.
|
||||
|
||||
[][12]
|
||||
|
||||
[][11]
|
||||
|
||||
Incidentally if you picked the option to install codecs whilst installing Xubuntu then MP3 audio will play without any issues.
|
||||
|
||||
If not then you should open a terminal emulator and install the Xubuntu Restricted Extras package.
|
||||
|
||||
### Customising Xubuntu
|
||||
|
||||
[][10]
|
||||
|
||||
There are so many things you can do to
|
||||
|
||||
[customise Xubuntu as shown here][9]
|
||||
|
||||
.
|
||||
|
||||
Xubuntu comes with a decent set of wallpapers as shown above and one of the first things you might like to do is change the wallpaper and add a new docking style panel with launchers to all of your favourite applications.
|
||||
|
||||
[][8]
|
||||
|
||||
A relatively new feature available for Xubuntu is the XFDashboard. This brings up a dashboard similar to the one supplied with the GNOME desktop. You can add a launcher and keyboard shortcut to make it appear.
|
||||
|
||||
[][7]
|
||||
|
||||
This view provides a nice way of choosing different workspaces and launching applications.
|
||||
|
||||
To be honest when it comes to customising Xubuntu the world is your oyster.
|
||||
|
||||
[][6]
|
||||
|
||||
### Issues
|
||||
|
||||
My biggest issue with Xubuntu (along with all of the Ubuntu distributions) is the lack of key software programs in the graphical software installer. Why omit Steam?
|
||||
|
||||
I received one crash whilst using Xubuntu and that was during the installation as shown by the following image:
|
||||
|
||||
[][5]
|
||||
|
||||
I have no idea what the problem was because it didn't actually have any side effects. The installation worked without a hitch.
|
||||
|
||||
### Summary
|
||||
|
||||
I don't review Xubuntu that often and it isn't because I don't like Xubuntu. In fact I am a big fan of Xubuntu and I have a heavily customised version on one of my other computers.
|
||||
|
||||
I use that computer when I want to get things done because lets face it there is nothing more annoying than seeing this:
|
||||
|
||||
[][4]
|
||||
|
||||
Seriously how can people say Windows just works when it seems that every other day the message "installing 1 of 285" appears and you lose your computer for an hour whilst it updates itself.
|
||||
|
||||
Xubuntu (as with every other distribution) updates without interrupting your day at all.
|
||||
|
||||
The truth is that nothing much really changes with Xubuntu. It is solid, steady and it doesn't need to change (except fot the software manager thing).
|
||||
|
||||
I would totally recommend Xubuntu.
|
||||
|
||||
I have to say that it is worth also checking out Peppermint OS, Linux Mint XFCE or Manjaro XFCE as well.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.everydaylinuxuser.com/2016/10/an-everyday-linux-user-review-of_15.html
|
||||
|
||||
作者:[Gary Newell][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.everydaylinuxuser.com/2016/10/an-everyday-linux-user-review-of_15.html
|
||||
[1]:http://www.everydaylinuxuser.com/2015/11/how-to-create-ubuntu-1510-usb-drive.html
|
||||
[2]:http://linux.about.com/od/howtos/ss/How-To-Create-A-Persistent-Bootable-Xubuntu-Linux-USB-Drive.htm
|
||||
[3]:http://linux.about.com/od/howtos/ss/How-To-Create-A-UEFI-Bootable-Ubuntu-USB-Drive-Using-Windows.htm#step2
|
||||
[4]:https://1.bp.blogspot.com/-GX3xYYXeTfY/WAKTRbvHv0I/AAAAAAAAM4Q/NzN8PfAOHGouj6z7-TPLyC18e_TXhCukACLcB/s1600/IMG_20161015_163354-min.jpg
|
||||
[5]:https://1.bp.blogspot.com/-saCiLJ-LXiU/WAKPh4EbsKI/AAAAAAAAM34/Cb28FoR-xZYeXd5lmbyOfbK1MuFIr_wmQCLcB/s1600/installproblem.png
|
||||
[6]:https://1.bp.blogspot.com/-lXhn0cuCoe8/WAKOmpBZc6I/AAAAAAAAM3w/1C3ljgPegr887xG5O5A0-0RBPAQlA3qHACLcB/s1600/finalcustomisation.png
|
||||
[7]:https://1.bp.blogspot.com/-ZCmwHtAahH0/WAKORXPnNFI/AAAAAAAAM3o/lKR4bnEbi-syQdMp_KoCb8xQAd4WTP5dgCLcB/s1600/xfdashboard.png
|
||||
[8]:https://2.bp.blogspot.com/-h_HRUcMTYu0/WAKN7J_0BJI/AAAAAAAAM3k/NKy7ybXZCEM23IK0Nkjp-TDo2PQ1ff4bQCLcB/s1600/newwallpaper.png
|
||||
[9]:http://linux.about.com/od/howtos/ss/Customise-The-XFCE-Desktop-Environment.htm
|
||||
[10]:https://1.bp.blogspot.com/-MlFCGvvjSe8/WAKNdG8i6SI/AAAAAAAAM3g/6g7WNJbmZX856kp4ezO56boIWbGLRLMdQCLcB/s1600/changewallpaper.png
|
||||
[11]:https://1.bp.blogspot.com/-erNT96pq67c/WAKM-331qKI/AAAAAAAAM3Y/jbnf5cZbFxgM9Q543XA3bFDqQ91MkmpJACLcB/s1600/music.png
|
||||
[12]:https://4.bp.blogspot.com/-l_INcXhflac/WAKMqz8mYtI/AAAAAAAAM3U/qBNl5YO8VOEMndpZm5IEMYOGYrih_Q4DQCLcB/s1600/quodlibet.png
|
||||
[13]:https://3.bp.blogspot.com/-rzTMI5a6EAE/WAKMFfDi-2I/AAAAAAAAM3Q/1-l612iZmSEYY188kfyzKo5s75nFWSz6ACLcB/s1600/steaminaptget.png
|
||||
[14]:https://3.bp.blogspot.com/-4e1ozcMoijU/WAKL2Gp5C1I/AAAAAAAAM3I/VY7XBvxOLCkiK-UdSvypfQFnrkfCtt3rwCLcB/s1600/steamnotinsoftware.png
|
||||
[15]:https://2.bp.blogspot.com/-6kjAgQV6Oss/WAKLhFbihcI/AAAAAAAAM3E/TLeK0xPexNEaxdzb_NkPn_BDDxOoTR2-gCLcB/s1600/software.png
|
||||
[16]:https://3.bp.blogspot.com/-_aqn8leBcuY/WAKLOAzAhnI/AAAAAAAAM3A/yruGYEG0PHc4WRAqRjeVoYxjhVlHiIfCwCLcB/s1600/Screenshot_2016-10-15_17-57-28.png
|
||||
[17]:https://2.bp.blogspot.com/-jDTpUNkQLYA/WAKKLPYyIEI/AAAAAAAAM24/0hcjRSnQonIdhnb1Knq1gMu_2i3bWo3ZQCLcB/s1600/imageviewer.png
|
||||
[18]:https://1.bp.blogspot.com/-Tw2PlooCqVU/WAKJznZu2DI/AAAAAAAAM20/E0RDAQKPxNY6l0TF10s2Yo9ge-LToZFtQCLcB/s1600/parole.png
|
||||
[19]:https://1.bp.blogspot.com/-nPqWKUsDVoI/WAKJTxLDxUI/AAAAAAAAM2w/8LoOvhNltV8IQtSoyN_oPWjjKyV1bTMyACLcB/s1600/whynotfirefox.png
|
||||
[20]:https://4.bp.blogspot.com/-hFDeZKOzZu4/WAKIWilPHoI/AAAAAAAAM2o/GhJBVIDfU0oPgc7Z8cvH4i4gbu_3tlOfgCLcB/s1600/wdmycloud.png
|
||||
[21]:https://1.bp.blogspot.com/-loH1k_rWYcA/WAKICKT7YUI/AAAAAAAAM2g/01rCedfYovgesf5Cf1RlcwFVfwPwhf2JACLcB/s1600/printer.png
|
||||
[22]:https://2.bp.blogspot.com/-bBGLZIp5J5k/WAKHG1w2RqI/AAAAAAAAM2c/nSISH5XFhQUfoIpXyuEUKlVqTieEi6_oACLcB/s1600/nvidia.png
|
||||
[23]:https://2.bp.blogspot.com/-nEvPMHkpTQ8/WAKG17nVliI/AAAAAAAAM2Y/2K6alEtBWAg9x9GS7hDEoJwprrwOqUQfwCLcB/s1600/internet.png
|
||||
[24]:https://1.bp.blogspot.com/-twtmUl3w008/WAKFtvOGMuI/AAAAAAAAM2Q/txM1lfCM7QkzhLDqEqacavmAMMg2DSr0ACLcB/s1600/fulldesktop.png
|
||||
[25]:https://3.bp.blogspot.com/-rnLEH6sBp7E/WAKFbgaxakI/AAAAAAAAM2M/-mG3lSxc41EKPQ2BnNbSmLRdgVeyT36jwCLcB/s1600/install6.png
|
||||
[26]:https://4.bp.blogspot.com/-cCNxMeLAE-Y/WAKFQjSZe2I/AAAAAAAAM2I/ZaTKZ8DAzFg-TOfS5BkNdN1-HYlRXweYwCLcB/s1600/install5.png
|
||||
[27]:https://4.bp.blogspot.com/-tcwOutnWJk8/WAKE5kGhPxI/AAAAAAAAM2A/9ZZrZRi6KR4renDxjwbRw8uoRqpAI8NzACLcB/s1600/install4.png
|
||||
[28]:https://1.bp.blogspot.com/-Pzt6YUVJbGY/WAKEf6QY2-I/AAAAAAAAM18/I41MoEvv_aguUX6Y9HkVLC_QnONpzyCVwCLcB/s1600/install3.png
|
||||
[29]:https://4.bp.blogspot.com/-0YgUIjeTb6I/WAKECFfeOwI/AAAAAAAAM14/lyUO2P7O9WYjLgCS0i-ARAbhnvGho_71ACLcB/s1600/install2.png
|
||||
[30]:https://4.bp.blogspot.com/-4GZVmSbI3nw/WAKDyLh8UdI/AAAAAAAAM10/BhSSR0e3GkYC-5fSrjyLmhNKpuQnogbdQCLcB/s1600/install1.png
|
||||
[31]:https://www.osdisc.com/products/xubuntu?affiliate=everydaylinuxuser
|
||||
[32]:https://3.bp.blogspot.com/-VBWH0CJsijM/WAKB3uDPvNI/AAAAAAAAM1k/cpigdxtjMEUQANxb6BF4efS9g7EZDFnZACLcB/s1600/mirrorlist.PNG
|
||||
[33]:http://xubuntu.org/getxubuntu/
|
||||
[34]:https://3.bp.blogspot.com/-GnYseQr9r3c/WAKA9R3hHPI/AAAAAAAAM1g/A3rvnr3W3Tk55apwsqmFs8nvr7zAMWnLACLcB/s1600/getxubuntu.PNG
|
||||
[35]:http://xubuntu.org/
|
||||
[36]:https://2.bp.blogspot.com/-i4QOIuRjyWA/WAJ9zWbjKeI/AAAAAAAAM1U/-t0-4KB6cFgdyk3LvYbNDNiuC0dB29vRACLcB/s1600/live1.png
|
@ -0,0 +1,67 @@
|
||||
OneNewLife translated
|
||||
|
||||
为何 Linux 之父 Linus Torvalds 选择 x86 芯片而不是 ARM 处理器
|
||||
=============
|
||||
|
||||
**Torvalds 因为 x86 的基础架构和生态系统而对其宠爱有加**
|
||||
|
||||

|
||||
|
||||
*Linus Torvalds 于 1999 年 8 月 10 日在加州圣何塞举行的 LinuxWorld 节目中给挤满礼堂的 Linux 发烧友作演讲。 ——出自:James Niccolai*
|
||||
|
||||
Linux 之父 Linus Torvalds 是一个直率的人——他总是心口如一。比方说最近在 Linux 内核 4.8 的 [事故][1] 中,他没有文过饰非,而是承认了自己的过失。
|
||||
|
||||
不过他在上周的 Linaro Connect 会议上倒是 [让人瞠目结舌][2]。当他被问到最喜欢的芯片架构的时候,他不假思索地说 x86,而不是 ARM。
|
||||
|
||||
或许是 x86 电脑悠久的历史让他得出这个答案。x86 没有多少碎片化的软件和硬件,它几乎仅仅是用来工作的。
|
||||
|
||||
Torvalds 说,人们总是痴迷于指令集和 CPU 核心,但事实是围绕架构的生态系统更为重要。
|
||||
|
||||
“重要的是围绕指令集的所有基础设施,而 x86 拥有大量的不同级别的基础设施”,Torvalds 说。“它在走一条与众不同的路。”
|
||||
|
||||
许多应用都是在英特尔或者 AMD 的 x86 机器上开发的。兼容性对于 x86 芯片和电脑来说是重要的,x86 平台有统一的硬件、开发模式以及其它的基础设施。
|
||||
|
||||
而 ARM 则迥然不同。从硬件供应商的角度来看,它引领着一个碎片化的市场,Torvalds 说。
|
||||
|
||||
“x86 的生态系统一向都秉承着兼容为先的理念,而 ARM 则不以为然,”Torvalds 在炉边与一位 ARM 开发者聊天时如是说。
|
||||
|
||||
|
||||
ARM 主导了移动设备的市场,有大量的安卓设备是基于 Linux 内核的。但是 ARM 的生态系统太过于碎片化了,这导致了很多支持和设备的问题。
|
||||
|
||||
有一个问题:由于硬件的配置不同,在所有移动设备上部署同一个版本的 Android 是不可能的。硬件制造商会调整 Android 系统以兼容他们设备的芯片组。不像 Windows 更新到 PC,一个 Android 更新无法推送到所有的移动设备。
|
||||
|
||||
英特尔尝试过将 x86 芯片放在智能手机上,但是现在已经放弃了。英特尔的其中一个目标就是推送可以在所有 x86 手机上下载并安装成功的 [安卓更新][3]
|
||||
|
||||
还有 ARM 服务器软件的开发问题。每个芯片组的架构、网络和 I/O 特性不同,必须编写软件才能利用这些特性。这大大减慢了服务器中采用 ARM 的速度。x86 不存在匹配的问题,它将继续主导服务器市场。
|
||||
|
||||
“我对于 ARM 作为一个硬件平台而不是一个指令集感到非常失望,虽然我也有我的问题,”Torvalds 说。“作为一个硬件平台,它始终不太好对付。”
|
||||
|
||||
Torvalds 长大后在一台装配 8 位的 6502 处理器的微机上编程,他很喜欢这种架构,因为它的指令是流式的,当时还没有其它硬件可以与之媲美。这种架构为芯片提供了更高的性能。
|
||||
|
||||
“我那时想升级的是一台 Acorn Archimedes,呃,给 ARM 命名的机器,“Torvalds说,“那曾经是我梦寐以求的机器。”
|
||||
|
||||
[Archimedes][4] 是第一台基于 Acorn 电脑公司的 ARM RISC 芯片的个人电脑。ARM 作为 Acorn 的一个分支而成立。
|
||||
|
||||
Torvalds 喜欢 Archimedes,因为它搭载了像 6502 一样的流式的 RAM 芯片以获得高性能。不尽人意的是,他找不到那台电脑。
|
||||
|
||||
他尝试过一台“古怪的英式电脑”,[Sinclair QL][5],这是一台比 Acorn Archimedes 还要失败的机器,Torvalds 说。
|
||||
|
||||
“那时的芬兰不是宇宙的中心,”Torvalds 说。“在那之后我吸取教训了——再也没有去买没有基础设施的机器。”
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
编译自: http://www.pcworld.com/article/3129300/linux/why-linux-pioneer-linus-torvalds-prefers-x86-over-arm.html
|
||||
|
||||
作者:[Agam Shah][a]
|
||||
译者:[OneNewLife](https://github.com/OneNewLife)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.pcworld.com/author/Agam-Shah/
|
||||
[1]: http://www.theregister.co.uk/2016/10/05/linus_torvalds_admits_buggy_crap_made_it_into_linux_48/
|
||||
[2]: https://www.youtube.com/watch?v=fuAebQvFnRI
|
||||
[3]: http://www.infoworld.com/article/2908072/android/google-and-intel-vow-to-speed-up-delivery-of-android-updates-to-devices.html
|
||||
[4]: http://www.pcworld.com/article/3097427/hardware/how-arm-set-itself-up-for-a-32-billion-acquisition.html
|
||||
[5]: http://oldcomputers.net/ql.html
|
@ -0,0 +1,195 @@
|
||||
Finish Translated
|
||||
|
||||
Linux vs. Windows 设备驱动模型:架构,APIs 和开发环境比较
|
||||
============================================================================================
|
||||
API Application Program Interface 应用程序接口
|
||||
ABI application binary interfaces 应用系统二进制接口
|
||||
|
||||
|
||||
|
||||
设备驱动是操作系统的一部分,他能够通过一些特定的编程接口提升硬件设备的使用,这样软件就可以控制并且运行那些设备了。因为每个驱动都对应不同的操作系统,所以你就需要不同的 Linux,Windows 或 Unix 设备驱动,以便能够在不同的计算机上使用你的设备。这就是当雇佣一个驱动开发者或者选择一个研发服务商提供者的时候,查看他们为各种操作系统平台开发驱动的经验是非常重要的。
|
||||
|
||||

|
||||
|
||||
驱动开发的第一步是理解每个操作系统处理它驱动的不同方式、底层驱动模型、它使用的架构、以及可用的开发工具。例如,Linux 驱动程序模型就与 Windows 非常不同。虽然 Windows 提倡驱动程序开发和操作系统开发分别进行,并通过一组 ABI 调用来结合驱动程序和操作系统,但是 Linux 设备驱动程序开发不依赖任何稳定的 ABI 或 API,所以它的驱动代码并没有被纳入内核中。每一个模型都有自己的优点和缺点,但是如果你想为你的设备提供全面支持,那么重要的是要全面的了解他们,。
|
||||
|
||||
在本文中,我们将比较 Windows 和 Linux 设备驱动程序,探索不同的架构,API,开发和分布,希望为您提供一个比较深入理解关于如何开始为每一个操作系统编写设备驱动程序。
|
||||
|
||||
### 1. 设备驱动架构
|
||||
|
||||
Windows 设备驱动程序的体系结构和 Linux 中使用的是不同,他们有自己的优点和缺点。差异主要受以下原因的影响:Windows 是闭源操作系统,而 Linux 是开源操作系统。比较 Linux 和 Windows 设备驱动程序架构将帮助我们理解 Windows 和 Linux 驱动程序背后的核心差异。
|
||||
|
||||
#### 1.1. Windows 驱动架构
|
||||
|
||||
虽然 Linux 内核由 Linux 驱动来分配,但 Windows 内核不包括设备驱动程序。相反的是,现代 Windows 设备驱动程序编写使用 Windows 驱动模型(WDM),这是一种完全支持即插即用和电源管理的模型,所以可以根据需要加载和卸载驱动程序。
|
||||
|
||||
处理来自应用的请求,是由 Windows 内核的一部分调用 I/O 管理器来完成的。I/O 管理器的作用是是转换这些请求到 I/O 请求数据包(IRPs),IRPs 可以被用来在驱动层识别请求并且传输数据。
|
||||
|
||||
Windows 驱动模型 WDM 提供三中驱动, 他们形成了三个层:
|
||||
|
||||
- 过滤驱动提供关于 IRPs 的可选附加处理。
|
||||
- 功能驱动是实现接口和每个设备通信的主要驱动。
|
||||
- 总线驱动服务不同的配适器和不同的总线控制器,来实现主机模式控制设备。
|
||||
|
||||
An IRP 通过这些层就像他们经过 I/O 管理器到达底层硬件那样。每个层能够独立的处理一个 IRP 并且把他们送回 I/O 管理器。在硬件底层中有硬件抽象层(HAL),它提供一个通用的接口到物理设备。
|
||||
|
||||
#### 1.2. Linux 驱动架构
|
||||
|
||||
相比于 Windows 设备驱动,Linux 设备驱动架构核心的不同就是 Linux 没有一个标准的驱动模型也没有一个干净独立的层。每一个设备驱动都被当做一个能够自动的从内核中加载和卸载模块来实现。Linux 为即插即用设备和电源管理设备提供一些方式,以便那些驱动可以使用它们来正确地管理这些设备,但这并不是必须的。
|
||||
|
||||
Linux 提供的外部模块和通信功能通过调用那些函数并且传送在随机数据结构中。来自用户应用的请求实际来自文件系统层或者网络层,它们被转化为需要的数据结构。模块能够被存储在层中,通过一些提供接口到一个设备群的模块处理一个一个的请求,例如 USB 设备。
|
||||
|
||||
Linux 设备驱动程序支持三种设备:
|
||||
|
||||
- 实现一个字节流接口的字符设备。
|
||||
- 主机文件系统和支持多字节块的数据展示的块设备。
|
||||
- 用于通过网络转换数据包的网络接口。
|
||||
|
||||
Linux 也有一个硬件抽象层(HAL),它像一个接口一样连接硬件和设备驱动。
|
||||
|
||||
### 2. 设备驱动 APIs
|
||||
|
||||
Linux 和 Windows 驱动 API 都属于事件驱动类型:只有当某些事件发生的时候,驱动代码才执行:当用户的应用程序希望从设备获取一些东西,或者当设备有某些请求需要告知操作系统。
|
||||
|
||||
#### 2.1. 初始化
|
||||
|
||||
在 Windows 上,驱动被表示为驱动对象结构,驱动对象结构在驱动入口函数的执行过程中被初始化。这些入口点也注册一些回调函数对设备的添加和移除、驱动卸载,和处理新进入的 IRP 做出回应。当一个设备连接的时候,Windows 创建一个设备对象,这个设备对象处理所有应用请求来代表设备驱动。
|
||||
|
||||
相比于 Windows,Linux 设备驱动生命周期由内核模块的 module_init 和 module_exit 函数负责管理,他们分别用于模块的加载和卸载。他们负责注册模块并通过使用内核接口来处理设备的请求。这个模块需要穿件一个设备文件(或者一个网络接口),说明一些它希望管理的数字识别器,和注册一些回调函数,当用户和设备文件交互的时候使用。
|
||||
|
||||
#### 2.2. 命名和声明设备
|
||||
|
||||
##### **在 Windows 上注册设备**
|
||||
|
||||
Windows 设备驱动是由回调函数 AddDevice 在新连接设备时被通知的。它接下来就超过去创建一个用于识别这种特殊驱动的设备对象。取决于驱动的类型,设备对象可以是物理设备对象(PDO),函数设备对象(FDO),或者过滤设备对象(FIDO)。设备对象能够使用PDO来存储在底层。
|
||||
|
||||
设备对象在这个设备连接在计算机的时候一直存在。设备扩展结构能够被用于使用一个设备对象来辅助全局设备。
|
||||
|
||||
设备对象可以有如下形式的名字 **\Device\DeviceName**, 这些被系统用来识别和定位他们。一个应用使用 CreateFile API 函数来打开一个有上述名字的文件,获得一个可以用于和设备交互的句柄。
|
||||
|
||||
然而,通常只有 PDO 有自己的名字。未命名的设备能够通过设备级结构来访问。设备驱动寄存器的一个或多个结构能够通过 128 位全局唯一标识符(GUIDs)来识别他们。用户应用能够使用全局唯一标识符来获取一个句柄。
|
||||
|
||||
##### **在 Linux 上注册设备**
|
||||
|
||||
在 Linux 平台上,用户应用通过位于 /dev 目录的文件系统入口访问设备。在模块初始化的时候,它通过调用内核函数 register_chrdev,创建了所有需要的入口。这个调用后来被发送到回调函数,这个回调函数(以及具有返回的描述符的进一步的系统调用,例如读、写或关闭)是通过模块安装在结构中,就像file_operations 或者 block_device_operations。
|
||||
|
||||
设备驱动模块负责分配和保持任何需要用于运行的数据结构。一个传送进入系统文件回调函数的文件结构有一个 private_data 字段,它可以被用来存放指向具体驱动数据的指针。块设备和网络接口 API 也提供类似的字段。
|
||||
|
||||
虽然其他系统的应用使用文件系统节点来定位设备,但是 Linux 使用一个主设备和次设备号的概念来识别设备和他们的内部驱动。主设备号被用来识别设备驱动,而次设备号由驱动使用来识别被它管理的设备。驱动为了去管理一个或多个固定的主设备号,必须首先注册自己或者让系统来分配未使用的设备号给它。
|
||||
|
||||
目前,Linux 为主次设备对使用一个32位的值,其中12位分配主设备号并允许多达4096个不同的设备。主次设备对对于字符设备和块设备是不同的,所以一个字符设备和一个块设备能使用相同的设备对而不导致冲突。网络接口是通过像 eth0 的标志名来识别,这些又是区别于主次设备的字符设备和块设备的。
|
||||
|
||||
#### 2.3. 交换数据
|
||||
|
||||
Linux 和 Windows 都支持在用户级应用程序和内核级驱动程序之间传输数据的三种方式:
|
||||
|
||||
- **缓冲型输入输出** 它使用由内核管理的缓冲区。对于写操作,内核从用户空间缓冲区中拷贝数据到内核分配缓冲区,并且把它传送到设备驱动中。读操作是一样的,由内核将数据从内核缓冲区中拷贝到应用提供的缓冲区中。
|
||||
- **直接型输入输出** 它不使用拷贝功能。代替它的是,内核在物理内存中引导用户分配缓冲区,这样他就能够保存这些数据,在数据传输过程中而不被换出。
|
||||
- **内存映射** 它也能够由内核管理,这样内核和用户空间应用就能够通过不同的地址访问同样的内存页。
|
||||
|
||||
##### **Windows 上的 I/O 模式**
|
||||
|
||||
支持缓冲型 I/O 是 WDM 的一种内置功能。缓冲区能够通过在 IRP 结构中的 AssociatedIrp.SystemBuffer 字符访问设备驱动。当需要和用户空间交流的时候,驱动只需从缓冲区中进行读写操作。
|
||||
|
||||
Windows 上的直接 I/O 由内存描述符列表(MDLs)介导。这种半透明的结构是通过在 IRP 中的 MdlAddress 字段来访问的。它们被用来定位由用户应用程序分配的缓冲区的物理地址,并在 I/O 请求的持续时间内固定。
|
||||
|
||||
在 Windows 上进行数据传输的第三个选项称为 METHOD_NEITHER。 在这种情况下,内核需要传送用户空间输入输出缓冲区的虚拟地址到驱动,而不需要确定他们有效或者保证他们映射到一个由设备驱动访问的物理储存器。设备驱动也负责处理数据传输的细节。
|
||||
|
||||
##### **Linux 上的驱动程序 I/O 模式**
|
||||
|
||||
Linux 提供许多函数例如,clear_user, copy_to_user, strncpy_from_user 和一些其他的用来在内核和用户内存之间展示缓冲区数据传输。这些函数保证了指向数据缓存区指针的有效,并且通过在存储器区域之间安全拷贝数据缓冲区来处理数据传输的所有细节。
|
||||
|
||||
然而,块设备的驱动对已知大小的整个数据块进行操作,它可以被快速移动在内核和用户地址区域之间而不需要拷贝他们。这些情况都是由 Linux 内核来自动处理所有的块设备驱动。块请求队列处理传送数据块而没有多余的拷贝,而 Linux 系统调用接口来转换文件系统请求到块请求中。
|
||||
|
||||
最终,设备驱动能够为内核地址区域分配一些存储页面(不可用于交换)并且使用 remap_pfn_range 函数来直接映射页面到用户进程的地址空间。然后应用能获取缓冲区的虚拟地址并且使用它来和设备驱动交流。
|
||||
|
||||
### 3. 设备驱动开发环境
|
||||
|
||||
#### 3.1. 设备驱动框架
|
||||
|
||||
##### **Windows 驱动程序工具包**
|
||||
|
||||
Windows 是一个闭源操作系统。Microsoft 提供 Windows 驱动程序工具包以方便非 Microsoft 供应商开发 Windows 设备驱动。工具包中包含开发,调试,检验和 Windows 设备驱动包等所需的所有内容。
|
||||
|
||||
Windows 驱动模型为设备驱动定义了一个干净的接口框架。Windows 保持这些接口的源和二进制兼容性。编译 WDM 驱动通常需要前向兼容性:也就是说,一个较旧的驱动能够在没有重新编译的情况下在较新的系统上运行,但是它当然不能够访问系统提供的新功能。但是,驱动不保证后向兼容性。
|
||||
|
||||
##### **Linux 源代码**
|
||||
|
||||
和 Windows 相对比,Linux 是一个开源操作系统,因此 Linux 的整个源代码是用于驱动开发的 SDK。没有驱动设备的正式框架,但是 Linux 内核包含许多如提供驱动注册的通用服务的子系统。这些子系统的接口被描述为内核头文件。
|
||||
|
||||
尽管 Linux 有定义接口,这些接口在设计上并不稳定。Linux 不提供有关前向和后向兼容的任何保证。设备驱动对于不同的内核版本需要重新编译。没有稳定性的保证允许 Linux 内核的快速开发,因为开发人员不必去支持旧的借口,并且能够使用最好的方法解决手头的这些问题。
|
||||
|
||||
当为 Linux 写树内驱动程序时,这种不断变化的环境不会造成任何问题,因为它们作为内核源代码的一部分,与内核本身同步更新。然而,闭源驱动必须单独开发,并且在树外,并且必须维护它们以支持不同的内核版本。因此,Linux 鼓励设备驱动程序开发人员来维持他们的树内驱动。
|
||||
|
||||
#### 3.2. 为设备驱动构建系统
|
||||
|
||||
Windows 驱动程序工具包为 Microsoft Visual Studio 添加了驱动开发支持,并包括用来构建驱动程序代码的编译器。开发 Windows 设备驱动程序与在 IDE 中开发用户空间应用程序没有太大的区别。Microsoft 提供了一个企业 Windows 驱动程序工具包,使其能够构建类似于 Linux 的命令行环境。
|
||||
|
||||
Linux 使用 Makefile 作为树内和树外系统设备驱动程序的构建系统。Linux 构建系统非常发达,通常是一个设备驱动程序只需要少数行就产生一个可工作的二进制代码。开发人员可以使用任何[IDE][5],只要它可以处理 Linux 源代码库和运行 make ,或者他们可以很容易地从终端手动编译驱动程序。
|
||||
|
||||
#### 3.3. 文档支持
|
||||
|
||||
Windows 具有对于驱动程序的开发的良好文档支持。Windows 驱动程序工具包包括文档和示例驱动程序代码,通过 MSDN 可获得关于内核接口的大量信息,并存在大量的有关驱动程序开发和 Windows 内部的参考和指南。
|
||||
|
||||
Linux 文档不是描述性的,但这缓解了整个 Linux 源代码可供驱动开发人员使用。源代码树中的文档目录记录了一些 Linux 的子系统,但是有更详尽的关于 Linux 设备驱动程序开发和 Linux 内核概述的[multiple books][4]。
|
||||
|
||||
Linux 不提供指定的设备驱动程序的样本,但现有生产驱动程序的源代码可用,可以用作开发新设备驱动程序的参考。
|
||||
|
||||
#### 3.4. 调试支持
|
||||
|
||||
Linux 和 Windows 都有可用于追踪调试驱动程序代码的日志记录工具。在 Windows 上将使用 DbgPrint 函数,而在 Linux 上使用的函数称为 printk。然而,并不是每个问题都可以通过只使用日志记录和源代码来解决。有时断点更有用,因为它们允许检查驱动代码的动态行为。交互式调试对于研究崩溃的原因也是必不可少的。
|
||||
|
||||
Windows 通过其内核级调试器 WinDbg 支持交互式调试。这需要通过一个串行端口连接两台机器:一台计算机运行调试内核,另一台运行调试器和控制被调试的操作系统。Windows 驱动程序工具包包括 Windows 内核的调试符号,因此 Windows 数据结构将在调试器中部分可见。
|
||||
|
||||
Linux 还支持通过 KDB 和 KGDB 进行的交互式调试。调试支持可以内置到内核,也可以在启动时同时启用。之后,可以直接通过物理键盘调试系统,或通过串行端口从另一台计算机连接到它。KDB 提供了一个简单的命令行界面,这是唯一的在同一台机器上来调试内核的方法。然而,KDB 缺乏源代码级调试支持。KGDB 通过串行端口提供了一个更复杂的接口。它允许使用像 GDB 这样的标准应用程序调试器来调试 Linux 内核,就像任何其他用户空间应用程序一样。
|
||||
|
||||
### 4. 设备驱动分配
|
||||
|
||||
##### 4.1. 安装设备驱动
|
||||
|
||||
在 Windows 上安装的驱动程序,是由被称为为 INF 的文本文件描述的,通常存储在 C:\Windows\INF 目录中。这些文件由驱动供应商提供,并且定义哪些是由驱动程序服务的设备,哪里可以找到驱动程序的二进制文件,和驱动程序的版本等。
|
||||
|
||||
当一个新设备插入计算机时,Windows 通过查看已经安装的驱动程序并且选择适当的一个加载。当设备被移除的时候,驱动会自动卸载它。
|
||||
|
||||
在 Linux 上,一些驱动被构建到内核中并且保持永久的加载。非必要的驱动被构建为内核模块,这通常是存储在/lib/modules/kernel-version 目录中。这个目录还包含各种配置文件,如 modules.dep,用于描述内核模块之间的依赖关系。
|
||||
|
||||
虽然 Linux 内核可以自身在启动时加载一些模块,但通常模块加载由用户空间应用程序监督。例如,init 进程可能在系统初始化期间加载一些模块,udev 守护程序负责跟踪新插入的设备并为它们加载适当的模块。
|
||||
|
||||
#### 4.2. 更新设备驱动
|
||||
|
||||
Windows 为设备驱动程序提供了稳定的二进制接口,因此在某些情况下,无需与系统一起更新驱动程序二进制文件。任何必要的更新由 Windows Update 服务处理,Windows 服务负责定位,下载和安装适用于最新版本系统的驱动程序。
|
||||
|
||||
然而,Linux 不提供稳定的二进制接口,因此有必要在每次内核更新时重新编译和更新所有必需的设备驱动程序。显然,内置在内核中的设备驱动程序会自动更新,但是树外模块会产生轻微的问题。 维护最新的模块二进制文件的任务通常用[DKMS] [3]来解决:一个当安装新的内核版本时自动重建所有注册的内核模块的服务。
|
||||
|
||||
|
||||
#### 4.3. 安全注意事项
|
||||
|
||||
所有 Windows 设备驱动程序必须在 Windows 加载它们之前进行数字签名。在开发期间可以使用自签名证书,但是分发给终端用户的驱动程序包必须使用 Microsoft 信任的有效证书进行签名。供应商可以从 Microsoft 授权的任何受信任的证书颁发机构获取软件出版商证书。然后,此证书由 Microsoft 交叉签名,并且生成的交叉证书用于在发行之前签署驱动程序包。
|
||||
|
||||
Linux 内核还可以配置为验证正在加载的内核模块的签名,并禁止不可信的内核模块。被内核所信任的公钥集在构建时是固定的,并且是完全可配置的。由内核执行的检查,它的严格性在构建时也是可配置的,范围从简单地为不可信模块发出警告,到拒绝加载任何可疑的有效性。
|
||||
|
||||
### 5. 结论
|
||||
|
||||
如上所示,Windows 和 Linux 设备驱动程序基础设施有一些共同点,例如调用 API 的方法,但更多的细节是相当不同的。最突出的差异源于 Windows 是由商业公司开发的封闭源操作系统这个事实。这是 Windows 上使变的非常好,文档化,稳定的驱动程序 ABI 和正式框架的一个要求,而在 Linux 上,更多的是到源代码的一个很好的补充。文档支持也在 Windows 环境中更加发达,因为 Microsoft 具有所需的资源来维护它。
|
||||
|
||||
另一方面,Linux 不会使用框架限制设备驱动程序开发人员,并且内核和生产设备驱动程序的源代码可以在需要的时候有所帮助。缺乏接口稳定性也有意义,因为它意味着最新的设备驱动程序总是使用最新的接口,内核本身承载较小的后向兼容性负担,这带来了更干净的代码。
|
||||
|
||||
了解这些差异以及每个系统的具体情况是为您的设备提供有效的驱动程序开发和支持的关键的第一步。我们希望这篇文章 Windows 和 Linux 设备驱动程序开发的对比,有助于您理解它们,并在设备驱动程序开发过程的研究中,将此作为一个伟大的起点。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/linux-vs-windows-device-driver-model.html
|
||||
|
||||
作者:[Dennis Turpitka][a]
|
||||
译者:[译者ID](https://github.com/FrankXinqi(&YangYang))
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://xmodulo.com/author/dennis
|
||||
[1]: http://xmodulo.com/linux-vs-windows-device-driver-model.html?format=pdf
|
||||
[2]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PBHS9R4MB9RX4
|
||||
[3]: http://xmodulo.com/build-kernel-module-dkms-linux.html
|
||||
[4]: http://xmodulo.com/go/linux_device_driver_books
|
||||
[5]: http://xmodulo.com/good-ide-for-c-cpp-linux.html
|
@ -0,0 +1,50 @@
|
||||
拥有开源项目部门的公司可以从四个方面获益
|
||||
====
|
||||
|
||||

|
||||
|
||||
在我的第一篇关于开源项目部门的系列文章中,我深入剖析了[什么是开源项目部门,为什么你的公司需要一个开源项目部门][1]。接着我又说到了[谷歌是如何创建一个新的开源项目部门的][2]。而这篇文章,我将阐述拥有一个开源项目部门的好处。
|
||||
|
||||
乍一看,非软件开发公司会更加热情的去拥抱开源项目部门的一个重要原因是他们并没有什么损失。毕竟,他们并不需要依靠这些软件产品来获得收益。比如,Facebook 可以很轻易的释放出一个 “分布式键值数据存储” 作为开源项目,是因为他们并没有售卖一个叫做 “分布式键值数据存储” 的产品。这回答了关于风险的问题,但是并没有回答他们如何通过向开源生态共献代码而获益的问题。让我们逐个来推测和探讨其中可能的原因。你会发现开源项目供应商的许多动机都是相同的,但是也有些许不同。
|
||||
|
||||
### 招聘
|
||||
|
||||
招聘可能是一个最容易的方法将一个开源项目售卖给上层管理部门。向他们展示与招聘相关的成本,以及投资回报率,然后解释如何与天才工程师发展关系,从而与那些对这些项目感兴趣并且十分乐意在其中工作的天才开发者们建立联系。不需要我多说了,你懂的!
|
||||
|
||||
### 技术影响
|
||||
|
||||
曾几何时,那些没有专门从事软件销售的公司难以直接影响他们软件供应商的开发周期,尤其是他们并不是一个大客户时。开源完全改变了这一点,它将用户与供应商放在了一个更公平的竞争环境中。随着开源开发的兴起,任何人,假如他们愿意投入时间和资源的话,都可以将技术推向一个选定的方向。但是这些公司发现,虽然将投资用于开发上会带来丰硕的成果,但是总体战略的努力却更加有效——试想 bug 的修复 VS 软件的构建——大多数公司都将 bug 的修复推给上游的开源部门,但是一些公司开始认识到通过更深层次的回报承诺和更快的功能开发来协调持久的工作,将会更有利于业务。通过一个开源项目部门的模型,公司的职员能够从开源社区中准确嗅出战略重心,然后投入开发资源。
|
||||
|
||||
对于快速增长的公司,如 Google 和 Facebook,其对现有的开源项目提供的领导力仍然不足以满足业务的膨胀。面对激烈的增长和建立超大规模系统所带来的挑战,许多大型企业开始为软件构建仅供内部使用的高度定制的栈。除非他们能说服别人在一些基础设施项目上达成合作?因此,虽然他们保持在诸如 Linux 内核,Apache 和其他现有项目领域的投资,他们也开始推出自己的大型项目。Facebook 发布了 Cassandra,Twitter 创造了 Mesos,并且甚至谷歌也创建了 Kubernetes 项目。这些项目已成为行业创新的主要平台,证实该举措是相关公司引人注目的成功。(请注意,Facebook 内部停止使用 Cassandra 后,它需要创造一个新软件项目来解决更大规模的问题,但是,这时 Cassandra 已经变得流行,而 DataStax 已经开始承担开发任务)。所有这些项目已经促使了开发商、相关的项目、以及最终用户来供应加速的增长和发展的整个生态。
|
||||
|
||||
开源项目部门和公司战略举措是不可能不协调的。没有这种努力,每个所提到的公司依然在试图单独地和更慢解决这些问题。不仅拥有这些项目可以帮助解决内部业务问题,它们也帮助这些公司逐渐成为行业巨头。当然,谷歌当了好多年行业巨头,但是 Kubernetes 的发展确保了软件的质量,并且在容器技术未来的发展方向上有着直接的话语权,并且远超之前就有的话语权。这些公司目前还是闻名于他们超大规模的基础设施和硅谷的中坚份子。鲜为人知,但是更为重要的是它们与技术生产人员的亲密度。开源项目办公室凭借技术建议和与有影响力的开发者的关系,再加上在社区治理和人员管理方面深厚的专业知识来引领这些工作,并最大限度地发挥其影响力,
|
||||
|
||||
### 市场营销能力
|
||||
|
||||
与技术的影响齐头并进的是每个公司谈论如何开源的努力。通过推敲这些项目和社区周围的消息,一个开源项目部门能够通过有针对性的营销活动来提供最大的影响。营销在开放源码领域一直是一个肮脏的词汇,因为每个人都有一个由企业营销造成的糟糕的经历。在开源社区中,营销呈现出一种与传统方法截然不同的形式,他会更注重于我们的社区已经在战略方向上做了什么。因此,一个开源项目部门不可能去宣传一些根本还没有发布任何代码的项目,但是他们会讨论他们创造什么软件和参与了其他什么举措。基本上,不会有“雾件”。
|
||||
|
||||
想想谷歌的开源项目办公室作出的第一份工作。他们不只是简单的贡献代码给 Linux 内核或其他项目,他们更多的是谈论它,并经常在开源会议主题演讲。他们不仅仅是把钱给写开源的代码的学生,他们还创建了一个全球计划——“Google Summer of Code”,现在已经成为一种开源发展的文化试金石。这些市场营销的作用在 Kubernetes 开发完成之前就奠定了谷歌在开源世界巨头的地位。最终使得,谷歌在创建 GPLv3 授权协议期间拥有重要影响力,并且在科技活动中公司的发言人和开源项目部门代表人成为主要人物。开源项目部门是协调这些工作的最好的实体,并可以为母公司提供真正的价值。
|
||||
|
||||
###改善内部流程
|
||||
|
||||
改善内部流程听起来不像一个大好处,但克服混乱的内部流程对于每一个开源项目部门都是一个挑战,不论是软件开发商还是驱动开发公司。而软件供应商必须确保他们的流程不与他们发布的产品重叠(例如,不小心开源了他们的专业软件),用户更关心的是侵犯了知识产权(IP)法:专利、版权和商标。没有人想只是因为释放软件而被起诉。没有一个活跃的开源项目部门去管理和协调这些许可和其他法律问题,大公司在开源流程和管理上面临着巨大的困难。为什么这个很重要呢?如果不同的组释放的软件是在不兼容的许可证下,那么这不仅是一个坑爹的尴尬,它还将对实现最基本的目标改良协作产生巨大的障碍。
|
||||
|
||||
考虑到还有许多这样的公司仍在飞快的增长,如果无法建立基本流程规则的话,将可以预见到它们将会遇到阻力。我见过一个巨大的电子表格罗列着批准、未经批准的许可证,以及指导如何(或如何不)创建开源社区而遵守法律限制。关键是当开发者需要做出决定时要有一个可以依据的东西,并且每次当开发人员想要为一个开源社区贡献代码时,可以不产生大量的法律开销,和效率低下的知识产权检查。
|
||||
|
||||
有一个活跃的开放源码项目部门,负责维护许可规则和源的贡献,以及建立培训项目工程师,有助于避免潜在的法律缺陷和昂贵的诉讼。毕竟,良好的开源项目合作可以减少由于某人没有看许可证而导致公司赔钱这样的事件。好消息是,公司已经不用担心关于专有的知识产权与软件供应商冲突的事。坏消息是,它们的法律问题不够复杂,尤其是当他们直接需要软件供应商提供法律阻力时。
|
||||
|
||||
你的组织是如何受益于拥有一个开源项目部门的?可以在评论中与我们分享。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/business/16/9/4-big-ways-companies-benefit-having-open-source-program-offices
|
||||
|
||||
作者:[John Mark Walker][a]
|
||||
译者:[chao-zhi](https://github.com/chao-zhi)
|
||||
校对:[校对者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/business/16/5/whats-open-source-program-office
|
||||
[2]: https://opensource.com/business/16/8/google-open-source-program-office
|
@ -0,0 +1,58 @@
|
||||
解决 Linux 内核代码审查人员短缺问题
|
||||
====
|
||||
|
||||
操作系统的安全性能是 [第一要务](http://www.infoworld.com/article/3124432/linux/is-the-linux-kernel-a-security-problem.html),而 Linux 则是该要务的一大组成部分。首先要解决的问题就是:我们如何确定提交到上游的补丁已经进行了代码审核?
|
||||
|
||||
Wolfram Sang 从 2008 年开始成为一名 Linux 内核开发者,他经常在各地召开的 Linux 峰会上发表讲话,比如在 [2016 年柏林 Linux 峰会](https://linuxconcontainerconeurope2016.sched.org/event/7oA4/kernel-development-i-still-think-we-have-a-scaling-problem-wolfram-sang-consultant),他提出了如何提高内核开发实践的想法。
|
||||
|
||||
让我们来看看他的观点。
|
||||
|
||||

|
||||
|
||||
### 在 2013 年的时候,你曾在爱丁堡(Edinburgh)提醒 ELCE 委员会,如果不作出改变,那么子系统的潜在问题和其他争议问题将会逐渐扩大。他们做出改变了吗?你所提及的那些事件发生了吗?
|
||||
|
||||
是的,在某些程度上来说。当然了,Linux 内核是一个很多部分组成的项目,所以给以 Linux 各个子系统更多关注应该放在一个更重要的位置。然而,有太多的子系统“只是一块拼图”,所以通常来说,这些子系统的潜在问题还未被解决。
|
||||
|
||||
### 你曾指出代码审核人数是一个大问题。为何你觉得 Linux 内核开发社区没有足够的代码审核人员呢?
|
||||
|
||||
理由之一就是,大多数开发者实际上只是编写代码,但没有再次去通读之前写的代码。这本是没有什么错,但却说明了并非每个人都是代码审核人员,所以我们挣得应该鼓励每个人都进行代码审核。
|
||||
|
||||
我所看到另一件事就是,但我们要请人员加入我们的社区时,最重要的考核就是补丁贡献数量。我个人认为这是很正常的,并且在初期总贡献量少的时候是非常好的做法。但是随着越来越多的人员,特别是大型公司的加入,我们就碰到源码审核的问题。但是别误解了,有着数量可观的贡献是很棒的。但目前需要指出的是,参与社区意味着更多,比方说如何为下一步发展负责。有些部分在慢慢改善,有一些部分现在则不宜扩张。
|
||||
|
||||
### 你认为跟多的代码审核人员或者审核激励措施是否会有帮助?
|
||||
|
||||
我最主要的观点就是要指出,现今仍存在问题。是的,目前为止我们还没有做到最好,但不意味着所以都没做好。关于这个可伸缩性争议,我们还存在其他的问题。让人民了解事实,是希望能够让一些团体对此感兴趣并参与区中。我并不认为我们需要特殊的训练,我所熟悉的一些代码审核人员都非常棒或者很有天赋,只是这类人太少或者他们的空闲时间太少。
|
||||
|
||||
首先就是需要有这种内在动力,至于这个另一种其他的,边做边学就非常好了。这又是我想要之处的优势之一:审核补丁能够使你成为更出色的代码开发者。
|
||||
|
||||
### 依你之见,是否与那么一个受欢迎的大项目在扩张这方面做的好又可以让我们借鉴的?
|
||||
|
||||
我还真不知道有这么一个项目,如果有的话随时借鉴。
|
||||
|
||||
我很专注于 Linux 内核,所以可能会存在一些偏见。然而在我看来,Linux 内核项目在规模大小、贡献数量和多样性方面真的很特别。所以当我想要找另一个项目来寻找灵感以便改善工作流是很正常的想法,目前我们的可伸缩性问题真的比较特别。而且我发现,跟踪请其他子系统在内核中做了什么是一个很有的方法。
|
||||
|
||||
### 你曾说安全问题是我们每个人都该想到的事情,那用户应该做些什么来避免或者改善安全问题的危险?
|
||||
|
||||
在今年(2016年)柏林 Linux 峰会我就说过,这是开发层面的问题,安全隐患可能存在于没有正确审核的补丁中。我并希望需要用户亲自解决这种问题,我更希望这些安全问题永远不会出现。当然这是不可能的,但这仍然是处理问题所喜欢用的方法。
|
||||
|
||||
### 我很好奇这个庞大社区如何改善这些问题。是否有某些类型的错误报告(bug report)用户定期以文件形式提交?需要定期检查的区域却因为某些原因没有注意到的?
|
||||
|
||||
我们并不缺少错误报告。我所担心的是:由于代码审核人员的短缺造成补丁不完整从而导致更多的错误报告。所以,到时候不仅需要处理大量的贡献,还需要处理更多错误或者进行版本回退。
|
||||
|
||||
### 你是否还有什么事情希望我们读者知道,以了解你所在的努力?
|
||||
|
||||
Linux 内核中所有的特殊项目常常让我牢记着最底层的事情,那就是代码。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/business/16/10/linux-kernel-review
|
||||
|
||||
作者:[Deb Nicholson][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/eximious
|
@ -1,32 +0,0 @@
|
||||
简览最有前景的下代 Linux 软件更新机制
|
||||
====
|
||||
|
||||

|
||||
|
||||
随着像 APT 和 Yum 等传统包管理解决方案仅仅老去,并且不适用于类 Unix IoT 等新领域,新一代的基于原子 Linux 软件升级方案应运而生。Konsulko 团队的 Matt Porter 将在本周的 2016 年欧洲嵌入式 Linux 峰会(LCTT 译注:于 2016 年 10 月 11-13 日在德国柏林召开)为大家对比这些新技术的不同点。
|
||||
|
||||
目前已有多个 Linux 软件商使用增量原子更新方式来传输更可靠的发行版更新,可以实现小体积的二进制文件续传,假如出现意外状况也运行回退。这些新的发行版升级机制包含了 SWUpdate、Mender、OSTree 和 swupd。但有趣的是,幻灯片之中并没有提及 Ubuntu 的 Snappy。
|
||||
|
||||
SWUpdate 一种单/双镜像的模块化升级框架,支持镜像签名、可以使用 Kconfig 来进行配置、能够处理本地或者远程升级等。[SWUpdate](https://github.com/sbabic/swupdate) 简直就是为嵌入式系统设计的。
|
||||
|
||||
而 [Mender](https://github.com/mendersoftware/mender) 则是以无线传输进行升级位目标的升级方案。它是用 Go 编程语言编写的双镜像升级框架。
|
||||
|
||||
[OSTree](https://github.com/ostreedev/ostree) 是此次增量原子升级方案演示中最有名气,它类似于 Git。Fedora 和 RedHat 都有它的身影,甚至 Gnome 的 Flatpak 容器系统有是用了 OSTree。
|
||||
|
||||
Swupd 是最后展示的一个升级系统,是 Intel 的带头部队——Clear Linux 发行版所使用的升级方案。它自身托管在 [GitHub](https://github.com/clearlinux/swupd-client),而它的客户端和服务端则由 Clear Linux 托管。Swupd 与 OSTree 相似,但它不必重启就可以启用更新。
|
||||
|
||||
而本次在柏林召开的欧洲嵌入式 Linux 峰会中没有提及的升级机制,你也可以访问 [these PDF slides](http://events.linuxfoundation.org/sites/events/files/slides/Comparison%20of%20Linux%20Software%20Update%20Technologies.pdf) 来了解它们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://phoronix.com/scan.php?page=news_item&px=ELC2016-Software-Updates
|
||||
|
||||
作者:[Michael Larabel][a]
|
||||
|
||||
译者:[GHLandy](https://github.com/GHLandy)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.michaellarabel.com/
|
@ -0,0 +1,149 @@
|
||||
开发者的实用 Vim 插件——第一部分
|
||||
============
|
||||
作为 Vi 的升级版,[Vim][31] 毫无争议是 Linux 中最受欢迎的命令行编辑器之一。除了是一个多功能编辑器外,世界各地的软件开发者将 Vim 当做 IDE(Integrated Development Environment,集成开发环境)来使用。
|
||||
|
||||
事实上,是 Vim 可以通过插件来扩展其自身功能才使得它如此功能强大。不用说,肯定有那么几个 Vim 插件是指在提高用户的编程体验的。
|
||||
|
||||
特别是对于刚刚使用 Vim 或者使用 Vim 做开发的的软件开发者来说,我们将在本教程中讨论一些非常有用的 Vim 插件,具体请看例示。
|
||||
|
||||
请注意:本教程中列举的所有例示、命令和说明都是在 Ubuntu 16.04 环境下进行测试的,并且,我们使用的 Vim 版本是 7.4。
|
||||
|
||||
### 插件安装设置
|
||||
|
||||
这是为新用户准备的,假设他们不知道如何安装 Vim 插件。所以,首先,就是给出一些完成安装设置的步骤。
|
||||
|
||||
* 在家目录下创建 .vim 目录,并在其中创建子目录 autoload 和 bundle。
|
||||
* 然后,在 autoload 放置 [pathogen.vim][20] 文件,这个文件可以从 [此处][19] 下载。
|
||||
* 最后,在家目录创建 .vimrc 文件,并添加一下内容。
|
||||
|
||||
```
|
||||
call pathogen#infect()
|
||||
```
|
||||
|
||||
[][30]
|
||||
|
||||
至此,你已完成了 Vim 插件安装的准备工作。
|
||||
|
||||
注意:我们已经讨论了使用 Pathogen 管理 Vim 插件。当然还有其他的插件管理工具——欲了解,请访问 [此处][29]。
|
||||
|
||||
现在已经全部设置完毕,就让我们来讨论两个好用的 Vim 插件吧。
|
||||
|
||||
### Vim 标签侧边栏(Tagbar)插件
|
||||
|
||||
首先就是标签侧边栏(Tagbar)插件。该插件能够让你浏览源文件包含的标签,从而提供该源文件的就够简览。[官网的插件说明][28] 是这样说的:“它通过创建侧边栏,然后以一定顺序展示从当前文件提取的标签(tags)来完成这一功能。这意味着,比如,C++ 中的方法将展示在其自身所定义在的类里边。”
|
||||
|
||||
听起来很酷,不是吗?让我们来看看该怎么安装它。
|
||||
|
||||
标签侧边栏(Tagbar)的安装过程是相当容易的——你只需要运行下列命令:
|
||||
|
||||
```
|
||||
cd ~/.vim/bundle/
|
||||
|
||||
git clone git://github.com/majutsushi/tagbar
|
||||
```
|
||||
|
||||
安装完之后就可以使用了,你可以在 Vim 中打开一个 .cpp 文件来测试它:进入[命令模式][27],然后运行 :TagbarOpen 命令。以下是运行 :TagbarOpen 命令之后出现侧边栏(右侧) 的效果图。
|
||||
|
||||
[][26]
|
||||
|
||||
使用 :TagbarClose 可以关闭侧边栏。值得一提的是,可以使用 :TagbarOpen fj 命令打开侧边栏,和是使用 shift 键控制侧边栏的效果一样。也就是说,你可以很方便的浏览当前文件包含的标签(tags)——在对应的标签(tags)上按下 Enter 键(使用 shift 键控制)跳转到左边源码的对应位置。
|
||||
|
||||
[][25]
|
||||
|
||||
假如你想要反复地开关侧边栏,你可以使用 :TagbarToggle 命令,而不用交替的使用 :TagbarOpen 和 :TagbarClose 命令。
|
||||
|
||||
如果你觉得输入这些命令很费时间,你可以为 :TagbarToggle 命令创建快捷键。比如,添加一下内容到 .vimrc 文件中:
|
||||
|
||||
```
|
||||
nmap <F8> :TagbarToggle<CR>
|
||||
```
|
||||
|
||||
再往下说,有时候你可能会注意到某个标签(tags)前边有一个 +、- 或者 # 符号。比如,一下截图(取自该插件的官网)展示了一些前边有 + 号的标签(tags)。
|
||||
|
||||
[][24]
|
||||
|
||||
这些符号基本是用来表名一个特殊标签的可视化信息。特别是 + 表示该类是 public 的,而 - 表示一个 private 类。# 则是是表示一个 protected 类。
|
||||
|
||||
以下是使用标签侧边栏(Tagbar)的一些注意事项:
|
||||
|
||||
* 该插件的官网早就有说明:“标签侧边栏(Tagbar)并非是管理标签(tags)文件而设计,它只是在动态内存中创建所需的标签,而非创建任何文件。标签(tags)文件的管理有其他插件提供支持。”
|
||||
* 低于 7.0.167 版本的 Vim 和标签侧边栏(Tagbar)插件存在着一个兼容性问题。根据官网:“如果你受到此问题的影响,请使用体代替版:[下载 zip 压缩包][18]。这是 2.2 版本的标准,但由于依赖变更的数量,它可能不会再升级。”
|
||||
* 如果你再加载该插件是遇到这样的错误:未找到足够的样式!(Exuberant ctags not found!)。你可以从 [此处][17] 下载并安装 ctags 来修复错误。
|
||||
* 获取更多信息请访问 [这里][16]。
|
||||
|
||||
### Vim 符号自动补齐(delimitMate)插件
|
||||
|
||||
下一个要介绍的插件就是符号自动补齐(delimitMate)。该插件在 Vim 插入模式下提供引号、圆括号和方括号等符号自动补齐功能。
|
||||
|
||||
[该插件官网][23]:“它同时也提供一些相关的特性让你在输入模式下变得更加辩解,比如语法纠错(在注释区或者其他的可配置区不会自动插入界限符)、扩展名识别(默认关闭)等。”
|
||||
|
||||
安装步骤与之前介绍的相似:
|
||||
|
||||
```
|
||||
cd ~/.vim/bundle/
|
||||
|
||||
git clone git://github.com/Raimondi/delimitMate.git
|
||||
```
|
||||
|
||||
一旦你成功安装这个插件(即上述命令执行成功),你就不需要进行任何配置了——当 Vim 启动时会自动加载这个插件。
|
||||
|
||||
至此,在你使用 Vim 的任何时候,只要你输入一个双引号、单引号、单号、圆括号、方括号,它们都会自动补齐。
|
||||
|
||||
你可以自己配置 符号自动补齐(delimitMate)。比如,你可以添加需要自动补齐的符号列表,阻止自动加载插件,对指定类型文件关闭插件等。想来接如何配置这些(或者其他更多的配置),请阅读该插件的详细文档——运行 :help delimitMate 即可。
|
||||
|
||||
上述命令会将你的 Vim 窗口水平分割成两个,上边一个包含我们所说的文档。
|
||||
|
||||
[][22]
|
||||
|
||||
### 结论
|
||||
|
||||
本文之中提到的两个插件,Tagbar 需要花费较多时间来适应——你应该会同样这个说法。但只要正确设置好它(这意味着你像是有了快捷键一样方便),就容易使用了。至于 delimitMate,不需要任何要求就可以上手。
|
||||
|
||||
本教程就是向你展示 Vim 如何高效能的想法。除了本文中提及的,仍然还有许多开发者可用的插件,我们将在下一个部分进行讨论。假如你正在使用一个关于开发的 Vim 插件,并希望广为人知,请在下方留下评论。
|
||||
|
||||
我们将在本教程的第二部分讲到 [语法高亮插件:Syntastic][21]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers/
|
||||
|
||||
作者:[Ansh][a]
|
||||
|
||||
译者:[GHLandy](https://github.com/GHLandy)
|
||||
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers/
|
||||
[1]:https://www.youtube.com/channel/UCOfXyFkINXf_e9XNosTJZDw
|
||||
[2]:https://www.youtube.com/user/desainew
|
||||
[3]:https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w
|
||||
[4]:http://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[5]:http://twitter.com/intent/tweet/?text=Is+Open+Source+Design+a+Thing%3F&url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[6]:https://plus.google.com/share?url=https%3A%2F%2Ffreedompenguin.com%2Farticles%2Fopinion%2Fopen-source-design-thing%2F
|
||||
[7]:https://atom.io/
|
||||
[8]:http://froont.com/
|
||||
[9]:https://webflow.com/
|
||||
[10]:https://gravit.io/
|
||||
[11]:http://getbootstrap.com/
|
||||
[12]:https://inkscape.org/en/
|
||||
[13]:https://www.gimp.org/
|
||||
[14]:https://en.wikipedia.org/wiki/Free_and_open-source_software
|
||||
[15]:https://medium.com/dawn-capital/why-leverage-the-power-of-open-source-to-build-a-successful-software-business-8aba6f665bc4#.ggmn2ojxp
|
||||
[16]:https://github.com/majutsushi/tagbar
|
||||
[17]:http://ctags.sourceforge.net/
|
||||
[18]:https://github.com/majutsushi/tagbar/zipball/70fix
|
||||
[19]:https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
|
||||
[20]:http://www.vim.org/scripts/script.php?script_id=2332
|
||||
[21]:https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-2-syntastic/
|
||||
[22]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-delimitmate-help.png
|
||||
[23]:https://github.com/Raimondi/delimitMate
|
||||
[24]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-visibility.png
|
||||
[25]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-ex2.png
|
||||
[26]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-tagbar-example.png
|
||||
[27]:http://www.tldp.org/LDP/intro-linux/html/sect_06_02.html
|
||||
[28]:http://majutsushi.github.io/tagbar/
|
||||
[29]:http://vi.stackexchange.com/questions/388/what-is-the-difference-between-the-vim-plugin-managers
|
||||
[30]:https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers/big/vimplugins-vimrc.png
|
||||
[31]:http://www.vim.org/
|
@ -19,6 +19,59 @@ Windows的Linux子系统测试在上周刚刚完成所有测试,并放出升
|
||||
|
||||
这次Ubuntu/Bash on Windows和原生Ubuntu对比测试,采用开源软件Phoronix测试套件,完全自动化并可重复测试。
|
||||
|
||||

|
||||
|
||||
First up was the SQLite embedded database benchmark. The out-of-the-box Ubuntu/Bash on Windows performance was quite slow, but when switching that 14.04 environment to 16.04 LTS, the performance was much faster. However, for this disk-heavy workload the native Ubuntu Linux installations were almost twice as fast as relying upon the Windows Subsystem for Linux.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
The CompileBench test profile as additional disk-focused workloads show that this is the particular subsystem really straining the Ubuntu performance atop Windows 10 with it being up to multiple times slower.
|
||||
|
||||
Next up were some basic system memory speed tests with Stream.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Strangely, the Stream memory benchmarks show better performance with Ubuntu on Windows than Ubuntu itself! This happened on both the 14.04 and 16.04 based environments that the Windows results came out faster.
|
||||
|
||||
Next are more of the CPU-heavy tests,
|
||||
|
||||

|
||||
|
||||
With the Dolfyn scientific test, the performance between Ubuntu on Windows and Ubuntu installed bare metal was actually quite close. With Ubuntu 16.04 the performance is slower on both platforms due to the newer GCC compiler regressing the performance.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Fhourstones and John The Ripper show that the performance of Ubuntu running on Windows via the Windows Subsystem for Linux can be incredibly close to the bare metal Ubuntu Linux performance!
|
||||
|
||||

|
||||
|
||||
The x264 results were another strange case similar to Stream where the best performance was actually with Ubuntu on Windows 10 via WSL!
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
The timed compilation benchmarks were heavily in favor of the bare metal Ubuntu Linux installations outside of Windows. This is likely due to these large program compilations requiring plenty of disk reads and from the earlier disk-focused benchmarks showing that is the big area where the Windows Subsystem for Linux is slow.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Many of our other common open-source benchmarks show that for the strictly CPU-focused tests, the Windows Subsystem for Linux is close -- or even matches -- the native Ubuntu Linux performance running on the actual hardware.
|
||||
|
||||
These latest Windows Subsystem for Linux results are actually rather impressive. The big letdown is just the continued slow disk/file-system performance, but for CPU-bound workloads the results are very compelling. There's also the rare cases with x264 and Stream where the performance of the Ubuntu user-space on Windows appears to clearly outperform that of Ubuntu Linux running on the hardware by itself.
|
||||
|
||||
Overall the experience was actually quite pleasant and haven't run into any other bugs or annoyances while running with Ubuntu/Bash on Windows. If you're interested in more Windows vs. Linux benchmarks, please consider voicing yourself as a Phoronix Premium subscriber.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.phoronix.com/scan.php?page=article&item=windows10-anv-wsl&num=1
|
||||
|
Loading…
Reference in New Issue
Block a user