Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating

This commit is contained in:
geekpi 2020-04-07 08:32:39 +08:00
commit 75645fe8e3
35 changed files with 2589 additions and 1119 deletions

View File

@ -0,0 +1,125 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12070-1.html)
[#]: subject: (What is GraphQL?)
[#]: via: (https://opensource.com/article/19/6/what-is-graphql)
[#]: author: (Zach Lendon https://opensource.com/users/zachlendon)
什么是 GraphQL
======
> GraphQL 是一种查询语言、一个执行引擎,也是一种规范,它让开发人员重新思考如何构建客户端和 API 应用。
![](https://img.linux.net.cn/data/attachment/album/202004/04/112938odz6sbw6hzwsh7f6.jpg)
GraphQL 是当今软件技术中最大的流行语之一。但它*究竟*是什么?是像 [SQL][2] 一样的查询语言吗?是像 [JVM][3] 这样的执行引擎?还是像 [XML][4] 这样的规范?
如果你回答上面这些都是,那么你是对的![GraphQL][5] 是一种查询语言的语法、是一种编程语言无关的执行引擎,也是一种不断发展的规范。
让我们深入了解一下 GraphQL 如何成为所有这些东西的,并了解一下人们为什么对它感到兴奋。
### 查询语言
GraphQL 作为查询语言似乎是合理的 —— 毕竟 “QL” 似乎重要到出现在名称中。但是我们查询什么呢?看一个示例查询请求和相应的响应可能会有所帮助。
以下的用户查询:
```
{
user(id: 4) {
    name
    email
    phoneNumber
  }
}
```
可能会返回下面的 JSON 结果:
```
{
  "user": {
    "name": "Zach Lendon"
    “email”: “zach@hydrate.io”
    “phoneNumber”: “867-5309”
  }
}
```
想象一下客户端应用查询用户详细信息、获取结果并使用它填充配置屏幕。作为查询语言GraphQL 的核心优势之一是客户端应用可以*只请求它需要*的数据,并期望以一致的方式返回这些数据。
那么 GraphQL 响应返回的*什么*呢?这就是执行引擎发挥的作用,通常是以 GraphQL 服务器的形式出现。
### 执行引擎
![GraphQL execution engine][7]
GraphQL 执行引擎负责处理 GraphQL 查询并返回 JSON 响应。所有 GraphQL 服务器由两个核心组件组成,分别定义了执行引擎的结构和行为:模式和解析器。
GraphQL 模式是一种自定义类型语言,它公开哪些查询既允许(有效),又由 GraphQL 服务器实现处理。上面用户示例查询的模式可能如下所示:
```
type User {
name: String
    email: String
    phoneNumber: String
}
type Query {
    user: User
}
```
此模式定义了一个返回用户的用户查询。客户端可以通过用户查询请求用户上的任何字段,并且 GraphQL 服务器将仅返回请求的字段。通过使用强类型模式GraphQL 服务器可以根据定义的模式验证传入的查询,以确保是有效的。
确定查询有效后,就会由 GraphQL 服务器的解析器处理。解析器函数支持每个 GraphQL 类型的每个字段。我们的这个用户查询的示例解析器可能如下所示:
```
Query: {
user(obj, args, context, info) {
return context.db.loadUserById(args.id).then(
userData => new User(userData)
)
}
}
```
虽然上面的例子是用 JavaScript 编写的,但 GraphQL 服务器可以用任意语言编写。这是因为 GraphQL 也是*也是*一种规范!
### 规范
GraphQL 规范定义了 GraphQL 实现必须遵循的功能和特性。作为一个在开放网络基金会的最终规范协议([OWFa 1.0][8])下提供的开放规范,技术社区可以审查 GraphQL 实现必须符合规范的要求,并帮助制定 GraphQL 的未来。
虽然该规范对 GraphQL 的语法,什么是有效查询以及模式的工作方式进行了非常具体的说明,但它没有提供有关如何存储数据或 GraphQL 服务器应使用哪种编程语言实现的指导。这在软件领域是非常强大的,也是相对独特的。它允许以各种编程语言创建 GraphQL 服务器并且由于它们符合规范因此客户端会确切知道它们的工作方式。GraphQL 服务器已经有多种语言实现,人们不仅可以期望像 JavaScript、Java和 C# 这样的语言,还可以使用 Go、Elixir 和 Haskell 等。服务器实现所使用的语言不会成为采用过程的障碍。它不仅存在多种语言实现,而且它们都是开源的。如果没有你选择的语言的实现,那么可以自己实现。
### 总结
GraphQL 是开源 API 领域中一个令人兴奋的、相对较新的参与者。它将查询语言、执行引擎与开源规范结合在一起,它定义了 GraphQL 实现的外观和功能。
GraphQL 已经开始改变企业对构建客户端和 API 应用的看法。通过将 GraphQL 作为技术栈的一部分,前端开发人员可以自由地查询所需的数据,而后端开发人员可以将客户端应用需求与后端系统架构分离。通常,公司在使用 GraphQL 的过程中,首先会在其现有的后端服务之上构建一个 GraphQL API “层”。这使得客户端应用开始获得他们所追求的性能和运营效率,同时使后端团队有机会确定他们可能需要在 GraphQL 层后面的“幕后”进行哪些更改。通常,这些更改都是为了优化,这些优化有助于确保使用 GraphQL 的应用可以尽可能高效地运行。由于 GraphQL 提供了抽象性,因此系统团队可以进行更改的同时继续在其 GraphQL API 级别上遵守 GraphQL 的“合约”。
由于 GraphQL 相对较新因此开发人员仍在寻找新颖而激动人心的方法来利用它构建更好的软件解决方案。GraphQL 将如何改变你构建应用的方式,它是否对得起众望所归?只有一种方法可以找到答案 —— 用 GraphQL 构建一些东西!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/6/what-is-graphql
作者:[Zach Lendon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/zachlendon
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs)
[2]: https://opensource.com/article/18/2/getting-started-sql
[3]: https://www.cubrid.org/blog/understanding-jvm-internals/
[4]: https://www.w3.org/TR/xml/
[5]: http://graphql.org/
[6]: mailto:zach@hydrate.io
[7]: https://opensource.com/sites/default/files/pictures/graphql-execution-engine.png (GraphQL execution engine)
[8]: http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0---patent-only

View File

@ -0,0 +1,91 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12075-1.html)
[#]: subject: (Why use GraphQL?)
[#]: via: (https://opensource.com/article/19/6/why-use-graphql)
[#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley)
为什么使用 GraphQL
======
> 以下是 GraphQL 在标准 REST API 技术上获得发展的原因。
[](https://img.linux.net.cn/data/attachment/album/202004/05/105820rdnjrppprjdjddfd.jpg)
正如我[以前][3]所写,[GraphQL][2] 是一种下一代 API 技术,它正在改变客户端应用程序与后端系统的通信方式以及后端系统的设计方式。
由于一开始就从创建它的组织 Facebook 获得了支持,并得到了其他技术巨头(如 Github、Twitter 和 AirBnB的支持因此 GraphQL 作为应用程序系统的关键技术的地位似乎是稳固的 —— 无论现在还是将来。
### GraphQL 的崛起
移动应用程序性能和组织敏捷性重要性的提高为 GraphQL 登上现代企业体系结构的顶端提供了助推器。
鉴于 [REST][4] 是一种非常流行的体系结构风格,早已提供了数据交互机制,与 [REST][4] 相比GraphQL 这项新技术具有哪些优势呢GraphQL 中的 “QL” 代表着查询语言,而这是一个很好的起点。
借助 GraphQL组织内的不同客户端应用程序可以轻松地仅查询所需数据这一点超越了其它 REST 方法,并带来了实际应用程序性能的提高。使用传统的 [REST][4] API 端点,客户端应用程序将详询服务器资源,并接受包含了与请求匹配的所有数据的响应。如果来自 [REST][4] API 端点的成功响应返回 35 个字段,那么客户端应用程序就会收到 35 个字段。
### 获取的问题
传统上,[REST][4] API 没有为客户端应用程序提供简便的方法来仅检索或只更新它们关心的数据。这通常被描述为“<ruby>过度获取<rt>over-fetching</rt></ruby>”的问题。随着移动应用程序在人们的日常生活中的普遍使用,过度获取问题会给现实世界带来不良后果。移动应用程序发出的每个请求、每一个字节的接受和发送,对终端用户的性能影响越来越大。数据连接速度较慢的用户尤其会受到不太好的 API 设计方案的影响。使用移动应用程序而性能体验不佳的客户更有可能不购买产品或不使用服务。低效的 API 设计只会浪费企业的钱。
并非只有“过度获取”是问题,“欠缺获取”同样也是问题。默认情况下,端点只返回客户端实际需要的部分数据,这需要客户端进行额外的调用以满足其数据需求,这就产生了额外的 HTTP 请求。由于过度和欠缺的获取问题及其对客户端应用程序性能的影响,促进有效获取的 API 技术才有机会在市场上引起轰动 —— GraphQL 大胆地介入并填补了这一空白。
### REST 的应对
[REST][4] API 设计师不甘心不战而退,他们试图通过以下几种方式来应对移动应用程序性能问题:
* “包含”和“排除”查询参数,允许客户端应用程序通过可能较长的查询格式来指定所需的字段。
* “复合”服务,将多个端点组合在一起,以使客户端应用程序在其发出的请求数量和接收到的数据方面更高效。
  
尽管这些模式是 [REST][4] API 社区为解决移动客户端所面临的挑战而做出的英勇尝试,但它们在以下几个关键方面仍存在不足:
* 包含和排除查询键/值对很快就会变得混乱,特别是对于需要用嵌套“点表示法”语法(或类似方法)以对目标数据进行包含和排除的深层对象图而言,更是如此。此外,在此模型中调试查询字符串的问题通常需要手动分解 URL。
* 包含和排除查询的服务器的实现往往是自定义的,因为基于服务器的应用程序没有标准的方式来处理包含和排除查询的使用,就像没有定义包含和排除查询的标准方式一样。
* 复合服务的兴起形成了更加紧密耦合的后端和前端系统,这就需要加强协调以交付项目,并且将曾经的敏捷项目转回瀑布式开发。这种协调和耦合还有一个痛苦的副作用,那就是减宦了组织的敏捷性。此外,顾名思义,组合服务不是 RESTful。
  
### GraphQL 的起源
对于 Facebook 来说,从其 2011-2012 年基于 HTML5 版本的旗舰移动应用程序中感受到的痛点和体验,才造就了 GraphQL。Facebook 工程师意识到提高性能至关重要,因此意识到他们需要一种新的 API 设计来确保最佳性能。可能考虑到上述 [REST][4] 的局限性,并且需要支持许多 API 客户端的不同需求,因此人们可以理解是什么导致其共同创建者 Lee Byron 和 Dan Schaeffer那时尚是 Facebook 员工)创建了后来被称之为 GraphQL 的技术的早期种子。
通过 GraphQL 查询语言,客户端(通常是单个 GraphQL 端点)应用程序通常可以显著减少所需的网络调用数量,并确保仅检索所需的数据。在许多方面,这可以追溯到早期的 Web 编程模型,在该模型中,客户端应用程序代码会直接查询后端系统 —— 比如说,有些人可能还记得 10 到 15 年前在 JSP 上用 JSTL 编写 SQL 查询的情形吧!
现在最大的区别是使用 GraphQL我们有了一个跨多种客户端和服务器语言和库实现的规范。借助 GraphQL 这样一种 API 技术,我们通过引入 GraphQL 应用程序中间层来解耦后端和前端应用程序系统,该层提供了一种机制,以与组织的业务领域相一致的方式来访问组织数据。
除了解决软件工程团队遇到的技术挑战之外GraphQL 还促进了组织敏捷性的提高,特别是在企业中。启用 GraphQL 的组织敏捷性通常归因于以下因素:
* GraphQL API 设计人员和开发人员无需在客户端需要一个或多个新字段时创建新的端点,而是能够将这些字段包含在现有的图实现中,从而以较少的开发工作量和跨应用程序系统的较少更改的方式展示出新功能。
* 通过鼓励 API 设计团队将更多的精力放在定义对象图上,而不是在专注于客户端应用程序交付上,前端和后端软件团队为客户交付解决方案的速度日益解耦。
  
### 采纳之前的注意事项
尽管 GraphQL 具有引人注目的优势,但 GraphQL 并非没有实施挑战。一些例子包括:
* 为 [REST][4] API 建立的缓存机制更加成熟。
* 使用 [REST][4] 来构建 API 的模式更加完善。
* 尽管工程师可能更喜欢 GraphQL 等新技术,但与 GraphQL 相比,市场上的人才库更多是从事于构建基于 [REST][4] 的解决方案。
### 结论
通过同时提高性能和组织敏捷性GraphQL 在过去几年中被企业采纳的数量激增。但是,与 API 设计的 RESTful 生态系统相比,它确实还需要更成熟一些。
GraphQL 的一大优点是,它并不是作为替代 API 解决方案的批发替代品而设计的。相反GraphQL 可以用来补充或增强现有的 API。因此鼓励企业探索在 GraphQL 对其最有意义的地方逐步采用 GraphQL —— 在他们发现它对应用程序性能和组织敏捷性具有最大的积极影响的地方。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/6/why-use-graphql
作者:[Zach Lendon][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D
[2]: https://graphql.org/
[3]: https://linux.cn/article-12070-1.html
[4]: https://en.wikipedia.org/wiki/Representational_state_transfer

View File

@ -0,0 +1,185 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12068-1.html)
[#]: subject: (How the Linux desktop has grown)
[#]: via: (https://opensource.com/article/19/8/how-linux-desktop-grown)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
Linux 桌面史话
======
> 自 20 世纪 90 年代初以来Linux 桌面已从一个简单的窗口管理器发展为一个完整的桌面。让我们一起来回顾一下 Linux 桌面的历史。
![](https://img.linux.net.cn/data/attachment/album/202004/03/142430kei55auvvv254aka.jpg)
我第一次安装 Linux 是在 1993 年。那时,安装这种操作系统没有太多的选择。早期,许多人只是从别人那里复制一个运行中的镜像。然后有人有了一个很好的想法,创建一个 Linux 的“发行版”,让你可以自定义要安装的软件。这就是 Softlanding Linux 系统SLS也是我首次接触 Linux。
当时我的 386 PC 虽然内存不多但已经足够了。SLS 1.03 需要 2MB 的内存才能运行,如果要编译程序,则需要 4MB 的内存。如果要运行 X 窗口系统,则需要多达 8MB 的内存!而我的电脑正好有足够的内存来运行 X 窗口系统。
因为我是在命令行中成长的,所以图形化的用户界面对我来说并不重要,但它确实很方便,我可以在不同的窗口中运行应用程序,并在任务间轻松切换。
从我第一次尝试 Linux 开始,我就迷上了它。从那以后,我一直在台式机上使用 Linux。和许多人一样我也曾有一段时间以双引导配置运行 Linux这样我就可以跳回到 MS-DOS 和 Windows 来运行某些程序。直到 1998 年,我终于冒了个险,全面投身于 Linux 之中。
在过去的 26 年中,我看着 Linux 桌面逐渐成熟。在这段时间里,我还尝试了各种有趣的桌面环境,下面我来分享一下 Linux 桌面的历史。
### X 和窗口管理器
Linux 上的第一个“桌面”还不是桌面。相反,它们是运行在 X 窗口系统上的“<ruby>窗口管理器<rt>window manager</rt></ruby>WM。X 提供了图形用户界面的基本构件比如在屏幕上创建窗口并提供键盘和鼠标输入。就其本身而言X 的用处并不大。为了使 X 图形环境变得有用,你需要一种方法来管理会话中的所有窗口。这就出现了<ruby>窗口管理器<rt>window manager</rt></ruby>。运行 xterm 或 xclock 之类的 X 程序就会在一个窗口中打开该程序。窗口管理器可以跟踪窗口并进行基本的内部管理,例如让你可以来回移动窗口并将其最小化。其余的事情取决于你自己。你可以通过将程序名列在 `~/.xinitrc` 文件中以在 X 开始时启动这些程序,但是通常,你会从 xterm 中运行新程序。
在 1993 年,最常见的窗口管理器是 TWM它的历史可以追溯到 1988 年。TWM 相当简单,仅仅提供了基本的窗口管理功能。
![TWM on SLS 1.05][2]
*SLS 1.05 上的 TWM显示了 xterm、xclock 和 Emacs 编辑器*
另一个早期的窗口管理器是 OpenLook 虚拟窗口管理器OLVWM。OpenLook 是 Sun 微系统公司在 20世纪 80 年代开发的图形用户界面,后来被移植到其它 Unix 平台。作为一个*虚拟*窗口管理器OLVWM 支持多个工作区。
![OLVWM on SLS 1.05][3]
*SLS 1.05 上的 OLVWM显示了 xterm 和虚拟工作区选择器*
当 Linux 开始流行起来的时候,没多久就有人创建出性能更流畅、界面更好的新窗口管理器。这些新的窗口管理器中首先出现的是虚拟窗口管理器 FVWM。FVWM 比 TWM 或 OLVWM 更具现代感。但是,我们仍然没有桌面。
![FVWM on SLS 1.05][4]
*SLS 1.05 上的 FVWM显示了 xterm 和文件管理器*
以现代的眼光来看TWM 和 FVWM 可能看起来很朴素。但重要的是要想想当时其它图形环境是什么样子。 Windows 当时的版本看起来也相当简单。Windows 版本 1 到版本 3 使用了一个称为“程序管理器”的普通启动器。
![Windows 3.11][5]
*Windows 3.11,显示程序管理器和记事本编辑器*
1995 年 8 月,微软发布了 Windows 95改变了现代 PC 桌面的格局。当然,我当时对此印象很深刻。我曾觉得 Windows 3.x 笨拙而丑陋,但 Windows 95 却流畅而漂亮。更重要的是,我们现在将 Windows 95 视为“**桌面**”。新的“桌面”隐喻是一个巨大的进步。你可以在桌面上放置图标——事实上Windows 95 提供了两个默认的桌面图标,分别是“我的电脑”(用于打开文件管理器)和“回收站”(用于放置以后要删除的文件)。
但是更重要的是Windows 95 桌面的意味着*整合*。程序管理器不见了,取而代之的是屏幕底部的任务栏,可让你使用更简单的“开始”菜单启动新程序。任务栏是多功能的,还通过一系列的按钮显示了你正在运行的程序,而托盘显示了时间、扬声器音量和其它简单的控件。你可以在这个新桌面上右键单击任何对象, Windows 95 会为你提供一个上下文相关的菜单,其中又你可以执行的操作。
![Windows 95][6]
*Windows 95显示了记事本编辑器*
与以前版本的 Windows 甚至其它 Linux 窗口管理器相比Windows 95 的界面更加流畅并且易于使用。值得一提的是Linux 开发人员创建了一个模仿 Windows 95 界面的 FVWM 的新版本。名为 FVWM95 的新窗口管理器仍然不是桌面,但它看起来非常漂亮。新的任务栏让你可以使用“开始”菜单启动新的 X 程序。任务栏还可以使用类似于 Windows 95 的按钮显示了正在运行的程序。
![FVWM95 on Red Hat Linux 5.2][7]
*在 Red Hat Linux 5.2 上的 FVWM95显示了 xterm 和一个带有 xterm 图标、文件管理器和其他程序的快速访问程序启动器*
虽然 FVWM95 和其他窗口管理器都在改进但核心问题仍然存在Linux 并没有真正的桌面。它具有一堆窗口管理器,仅此而已。使用图形用户界面的 Linux 应用程序(基本上意味着它们是 X 应用程序)看起来形态各异且工作方式也不同。除了 X 窗口系统提供的简单的纯文本复制/粘贴功能外你不能从一个应用程序复制和粘贴到另一个应用程序里。Linux 真正需要的是在其图形用户界面中进行彻底的重新打造,以创建它的第一个桌面。
### Linux 桌面之初啼
在 1996 年Matthias Ettrich 有感于 X 之下 Linux 应用程序体验不一致的困扰。他想使找个更易于使用的图形环境,而且更重要的是,他想让所有东西都“集成”在一起,就像真正的桌面一样。
Matthias 开始了<ruby>K 桌面环境<rt>K Desktop Environment</rt></ruby>KDE的工作。那个 K 代表着 “Kool”LCTT 译注:即 Cool。但是 KDE 这个名字也意味着可以类似<ruby>通用桌面环境<rt>Common Desktop Environment</rt></ruby>CDE的做法而 CDE 是“大 Unix”世界的标准。尽管到了 1996 年CDE 看起来已经有点过时了。CDE 基于 Motif 部件集,这也是 FVWM 所模仿的设计。KDE 1.0 于 1998 年 7 月完成,与 FVWM95 等普通窗口管理器相比,它有了明显改进。
![KDE 1.0][8]
*K 桌面环境KDE版本 1.0。图片来源Paul Brown / KDE*
KDE 是 Linux 向前迈出的一大步。最终Linux 有了一个真正的桌面集成了应用程序和更多现代的桌面图标。KDE 的设计与 Windows 95 并无不同。屏幕底部有一个任务栏,它提供了相当于 Windows 95 的“开始”菜单以及一些应用程序的快捷键。KDE 还支持虚拟桌面,这些桌面被巧妙地标记为 “One”、“ Two”、“Three” 和 “Four”。正在运行的应用程序通过位于屏幕顶部单独的任务栏的按钮表示。
但并不是每个人都对 KDE 感到满意。为了将 GUI 从系统中抽象出来KDE 使用了 Trolltech 的 Qt 工具套件库。不幸的是Qt 并不是以自由软件的许可证进行分发的。Trolltech 允许 Qt 在自由软件应用程序中免费使用,但在商业或专有应用程序中要收取使用费。而且这种二分法与自由软件不符。这给 Linux 发行版带来了问题:它们应该包括 KDE 吗?还是默认使用 FVWM 这样老式但属于自由软件的图形用户界面?
面对这种情况Miguel de Icaza 和 Federico Mena 于 1997 年开始开发新的 Linux 桌面上。这个新项目被称为 GNOME<ruby>GNU 网络对象模型环境<rt>GNU Network Object Model Environment</rt></ruby>的缩写。GNOME 旨在成为一个完全自由的软件,并使用了一个不同的工具套件库 —— 来自 GIMP 图像编辑器的 GTK。GTK 从字面上的意思 <ruby>GIMP 工具套件<rt>GIMP Tool Kit</rt></ruby>。当 GNOME 1.0 终于在 1999 年发布时Linux 又多了一个现代化的桌面环境。
![GNOME 1.0][9]
*GNOME 1.0 版。图片来源GNOME 文档项目*
有两个 Linux 桌面环境固然很棒但“KDE 与 GNOME”之争仍持续了一段时间。到了 1999 年Trolltech 以新的公共许可证 <ruby>Q 公共许可证<rt>Q Public License</rt></ruby>QPL重新发布了 Qt 库。但是,新许可证有其自身的包袱—-QPL 仅适用于 Qt 在开源软件项目中的使用,而不适用于商业项目。因此,<ruby>自由软件基金会<rt>Free Software Foundation</rt></ruby>FSF认为 QPL 与 <ruby>GNU 通用公共许可证<rt>GNU General Public License</rt></ruby>GNU GPL[不兼容][10]。这个许可证问题一直持续到 2000 年 Trolltech 在 GNU GPL v2 下重新发布 Qt 库。
### 随着时间的发展
Linux 桌面继续走向成熟。KDE 和 GNOME 进行了一场友好的竞争,促使双方都在增加了新的功能,还互相交流了思想和观念。到了 2004 年GNOME 和 KDE 都取得了长足的进步,但只是给用户界面带来了渐进式的变化。
KDE 2 和 3 继续依赖屏幕底部的任务栏概念但并入了用于运行应用程序的按钮。KDE 最明显的变化之一是添加了 Konqueror 浏览器,该浏览器首次出现在 KDE 2 中。
![KDE 2.2.2 \(2001\) showing the Konqueror browser][11]
*KDE 2.2.22001显示了 Konqueror 浏览器。图片来源Paul Brown / KDE*
![KDE 3.2.2][12]
*Fedora Core 2 上的 KDE 3.2.22004显示了 Konqueror 文件管理器(使用 Fedora Core 2 主题)*
GNOME 2 也使用了任务栏概念但将任务栏一分为二屏幕顶部的任务栏用于启动应用程序并响应桌面提示屏幕底部的任务栏用于显示正在运行的应用程序。我把这两个任务栏称之为“你可以做的事情”顶部和“你正在做的事情”底部。除了精简的用户界面外GNOME 还添加了由 Eazel 开发的更新过的文件管理器,名为 Nautilus。
![GNOME 2.6.0][13]
*Fedora Core 2 上的 GNOME 2.6.02004显示了 Nautilus 文件管理器(使用 Fedora Core 2 主题)*
随着时间的流逝KDE 和 GNOME 走了不同的道路。两者都提供了功能丰富、健壮且现代化的桌面环境但是却具有不同的用户界面目标。2011 年GNOME 和 KDE 在桌面界面上出现了很大的偏差。KDE 4.62011 年 1 月)和 KDE 4.72011 年 7 月提供了更传统的桌面感受同时继续根植于许多用户熟悉的任务栏概念。当然KDE 的底层发生很多变化,但是它仍然保留了熟悉的外观。
![KDE 4.6][14]
*KDE 4.6,显示 Gwenview 图像查看器。图片来源KDE*
2011 年GNOME 以一个新的桌面概念彻底改变了走向。GNOME 3 旨在创建一个更简单、更精简的桌面体验,使用户能够专注于自己的工作。任务栏消失了,取而代之的是屏幕顶部的黑色状态栏,其中包括音量和网络控件,显示了时间和电池状态,并允许用户通过重新设计过的菜单启动新程序。
菜单的变化最具最戏剧性。单击“活动”菜单或将鼠标移到“活动”的“热角”,所有打开的应用程序会显示为单独的窗口。用户还可以从“概述”中单击“应用程序”选项卡以启动新程序。“概述”还提供了一个内部集成的搜索功能。
![GNOME 3.0][15]
*GNOME 3.0,显示 GNOME 图片应用程序。图片来源GNOME*
![GNOME 3.0][16]
*GNOME 3.0显示活动概述。图片来源GNOME*
### 你的桌面之选
拥有两个 Linux 桌面意味着用户有很大的选择余地。有些人喜欢 KDE而另一些人喜欢 GNOME。没关系选择最适合你的桌面就行。
可以肯定的是KDE 和 GNOME 都有拥护者和批评者。例如GNOME 因为放弃任务栏而改成“活动概述”而受到了不少批评。也许最著名的批评者是 Linus Torvalds他在 2011 年[大声斥责并抛弃了][17]新的 GNOME将其视为“邪恶的烂摊子”然后在两年后又[回到了][18] GNOME。
其他人也对 GNOME 3 提出了类似的批评,以至于一些开发人员复刻 GNOME 2 的源代码创建了 MATE 桌面。MATE<ruby>MATE 高级传统环境<rt>MATE Advanced Traditional Environment</rt></ruby>的递归缩写)延续了 GNOME 2 的传统任务栏界面。
无论如何,毫无疑问当今两个最受欢迎的 Linux 桌面是 KDE 和 GNOME。它们的当前版本非常成熟功能也很丰富。KDE 5.162019和 GNOME 3.322019都试图简化和精简 Linux 桌面体验但是方式有所不同。GNOME 3.32 继续致力于极简外观删除所有分散用户注意力的用户界面元素以便用户可以专注于其应用程序和工作。KDE 5.16 采用了更为熟悉的任务栏方法,但也增加了其他视觉上的改进和亮点,尤其是改进的小部件处理和图标。
![KDE 5.16 Plasma][19]
*KDE 5.16 Plasma。图片来源KDE*
![GNOME 3.32][20]
*GNOME 3.32。图片来源GNOME*
同时,你也不会完全失去它们之间的兼容性。每个主要的 Linux 发行版都提供了兼容性库,因此你可以在运行 GNOME 的同时来运行 KDE 应用程序。当你真正想使用的应用程序是为其他桌面环境编写的,这一点非常有用。你可以在 GNOME 上运行 KDE 应用程序,反之亦然。
我认为这种态势不会很快改变这是一件好事。KDE 和 GNOME 之间的良性竞争使这两个阵营的开发人员可以避免故步自封。无论你使用 KDE 还是 GNOME你都将拥有一个集成度很高的现代化桌面。而最重要的是这意味着 Linux 拥有自由软件最好的特点:选择。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/8/how-linux-desktop-grown
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hallhttps://opensource.com/users/jason-bakerhttps://opensource.com/users/jlacroixhttps://opensource.com/users/doni08521059https://opensource.com/users/etc-eterahttps://opensource.com/users/marcobravohttps://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer)
[2]: https://opensource.com/sites/default/files/uploads/twm-sls105.png (TWM on SLS 1.05)
[3]: https://opensource.com/sites/default/files/uploads/olvwm-sls105.png (OLVWM on SLS 1.05)
[4]: https://opensource.com/sites/default/files/uploads/fvwm-sls105.png (FVWM on SLS 1.05)
[5]: https://opensource.com/sites/default/files/uploads/win311.png (Windows 3.11)
[6]: https://opensource.com/sites/default/files/uploads/win95.png (Windows 95)
[7]: https://opensource.com/sites/default/files/uploads/fvwm95-rh52.png (FVWM95 on Red Hat Linux 5.2)
[8]: https://opensource.com/sites/default/files/uploads/kde1.png (KDE 1.0)
[9]: https://opensource.com/sites/default/files/uploads/gnome10.png (GNOME 1.0)
[10]: https://www.linuxtoday.com/developer/2000090500121OPLFKE
[11]: https://opensource.com/sites/default/files/uploads/kde_2.2.2.png (KDE 2.2.2 (2001) showing the Konqueror browser)
[12]: https://opensource.com/sites/default/files/uploads/kde322-fc2.png (KDE 3.2.2)
[13]: https://opensource.com/sites/default/files/uploads/gnome26-fc2.png (GNOME 2.6.0)
[14]: https://opensource.com/sites/default/files/uploads/kde46.png (KDE 4.6)
[15]: https://opensource.com/sites/default/files/uploads/gnome30.png (GNOME 3.0)
[16]: https://opensource.com/sites/default/files/uploads/gnome30-overview.png (GNOME 3.0)
[17]: https://www.theregister.co.uk/2011/08/05/linus_slams_gnome_three/
[18]: https://www.phoronix.com/scan.php?page=news_item&px=MTMxNjc
[19]: https://opensource.com/sites/default/files/uploads/kde516.png (KDE 5.16 Plasma)
[20]: https://opensource.com/sites/default/files/uploads/gnome332.png (GNOME 3.32)

View File

@ -1,45 +1,39 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12069-1.html)
[#]: subject: (Fish A Friendly Interactive Shell)
[#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/)
[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/)
Fish 一个友好的交互式 Shell
Fish一个友好的交互式 Shell
======
![Fish — A Friendly Interactive Shell][1]
你是否正在寻找 bash 的替代品?你是否在寻找更人性化的东西?再往前看看,因为你刚发现了 fish
你是否正在寻找 bash 的替代品?你是否在寻找更人性化的东西?不用再看了,因为你刚发现了 fish
Fish友好的交互式 shell是一个智能且用户友好的命令行 shell可在 Linux、MacOS 和其他操作系统上运行。将其用于终端的日常工作和脚本编写。用 fish 编写的脚本比相同的 bash 版本具有更少的神秘性。
Fish友好的交互式 shell是一个智能且用户友好的命令行 shell可在 Linux、MacOS 和其他操作系统上运行。可以将其用于终端的日常工作和脚本编写。用 fish 编写的脚本比相同的 bash 版本具有更少的神秘性。
### Fish 的用户友好功能
* **建议**
Fish 会建议你之前写过的命令。当经常输入相同命令时,这可以提高生产率。
* **健全的脚本**
Fish 避免使用隐秘字符。这提供了更清晰和更友好的语法。
* **基于手册页的补全**
Fish 会根据命令的手册页自动补全参数。
* **语法高亮**
Fish 会高亮显示命令语法以使其在视觉上友好。
* **建议**Fish 会提示你之前写过的命令。当经常输入相同命令时,这样可以提高生产率。
* **健全的脚本能力**Fish 避免使用那些隐秘字符。这提供了更清晰和更友好的语法。
* **基于手册页的补全**Fish 会根据命令的手册页自动补全参数。
* **语法高亮**Fish 会高亮显示命令语法以使其在视觉上友好。
### 安装
#### Fedora 工作站
使用 _dnf_ 命令安装 fish
使用 `dnf` 命令安装 fish
```
$ sudo dnf install fish
```
安装 _util-linux-user_ 包,然后使用适当的参数运行 _chsh_(更改 shell 程序)命令,将 fish 设置为默认 shell 程序:
安装 `util-linux-user` 包,然后使用适当的参数运行 `chsh`(更改 shell 程序)命令,将 fish 设置为默认 shell 程序:
```
$ sudo dnf install util-linux-user
@ -50,7 +44,7 @@ $ chsh -s /usr/bin/fish
#### Fedora Silverblue
由于它不是 GUI 应用,因此你需要使用 _rpm-ostree_ 安装。使用以下命令在 Fedora Silverblue 上安装 fish
由于它不是 GUI 应用,因此你需要使用 `rpm-ostree` 将其加到层内。使用以下命令在 Fedora Silverblue 上安装 fish
```
$ rpm-ostree install fish
@ -58,35 +52,31 @@ $ rpm-ostree install fish
在 Fedora Silverblue 上,你需要重启 PC 才能切换到新的 ostree 镜像。
如果你想在 Fedora Silverblue 用 fish 作为主要 shell最简单的方法是更新 _/etc/passwd_ 文件。找到你的用户,并将 _/bin/bash_ 更改为 _/usr/bin/fish_
如果你想在 Fedora Silverblue 用 fish 作为主要 shell最简单的方法是更新 `/etc/passwd` 文件。找到你的用户,并将 `/bin/bash` 更改为 `/usr/bin/fish`
、你需要 [root 权限][2]来编辑 _/etc/passwd_ 文件。另外,你需要注销并重新登录才能使更改生效。
你需要 [root 权限][2]来编辑 `/etc/passwd` 文件。另外,你需要注销并重新登录才能使更改生效。
### 配置
fish 的用户配置文件在 _~/.config/fish/config.fish_。要更改所有用户的配置,请编辑 _/etc/fish/config.fish_
fish 的用户配置文件在 `~/.config/fish/config.fish`。要更改所有用户的配置,请编辑 `/etc/fish/config.fish`
每个用户配置文件必须手动创建。安装脚本不会创建 _〜/ .config / fish / config.fish_
用户配置文件必须手动创建。安装脚本不会创建 `~/.config/fish/config.fish`
以下是个配置示例以及它们的 bash 等效项,以帮助你入门:
以下是两个个配置示例以及它们的 bash 等效项,以帮助你入门:
#### 创建别名
* _~/.bashrc_: alias ll='ls -lh'
* _~/.config/fish/config.fish_: alias ll='ls -lh'
* `~/.bashrc``alias ll='ls -lh'`
* `~/.config/fish/config.fish`: `alias ll='ls -lh'`
#### 设置环境变量
* _~/.bashrc_: export PATH=$PATH:~/bin
* _~/.config/fish/config.fish_: set -gx PATH $PATH ~/bin
* `~/.bashrc``export PATH=$PATH:~/bin`
* `~/.config/fish/config.fish``set -gx PATH $PATH ~/bin`
### 使用 fish 工作
将 fish 配置为默认 shell 程序后,命令提示符将类似于下图所示。如果尚未将 fish 配置为默认 shell只需运行 _fish_ 命令以在当前终端会话中启动。
将 fish 配置为默认 shell 程序后,命令提示符将类似于下图所示。如果尚未将 fish 配置为默认 shell只需运行 `fish` 命令以在当前终端会话中启动。
![][3]
@ -100,37 +90,37 @@ fish 的用户配置文件在 _~/.config/fish/config.fish_。要更改所有用
![][5]
注意输入时出现的灰色文本。灰色文本显示建议之前编写的命令。要自动补全,只需按 **CTRL+F**
注意输入时出现的灰色文本。灰色文本显示建议之前编写的命令。要自动补全,只需按 `CTRL+F`
通过输入连接号(****)然后使用 **TAB** 键,它会根据前面命令的手册页获取参数建议:
通过输入连接号(``)然后使用 `TAB` 键,它会根据前面命令的手册页获取参数建议:
![][6]
如果你按一次 **TAB**,它将显示前几个建议(或所有建议,如果只有少量参数可用)。如果再次按 **TAB**,它将显示所有建议。如果连续三次按 **TAB**,它将切换到交互模式,你可以使用箭头键选择一个参数。
如果你按一次 `TAB`,它将显示前几个建议(或所有建议,如果只有少量参数可用)。如果再次按 `TAB`,它将显示所有建议。如果连续三次按 `TAB`,它将切换到交互模式,你可以使用箭头键选择一个参数。
除此之外fish 的工作与大多数其他 shell 相似。其他差异已经写在文档中。因此,找到你可能感兴趣的其他功能应该不难。
### 让 fish 变得更强大
使用 [powerline][7] 使 fish 变得更强大。Powerline 命令执行时间、彩色化 git 状态、当前 git 分支等添加到了 fish 的界面中
使用 [powerline][7] 使 fish 变得更强大。Powerline 可以为 fish 的界面添加命令执行时间、彩色化 git 状态、当前 git 分支等。
在安装 powerline 之前,你必须先安装 [Oh My Fish][8]。Oh My Fish 扩展了 fish 的核心基础架构,以支持安装其他插件。安装 Oh My Fish 的最简单方法是使用 _curl_ 命令:
在安装 powerline 之前,你必须先安装 [Oh My Fish][8]。Oh My Fish 扩展了 fish 的核心基础架构,以支持安装其他插件。安装 Oh My Fish 的最简单方法是使用 `curl` 命令:
```
> curl -L https://get.oh-my.fish | fish
```
如果你不想直接将安装命令管道传给 _fish_,请参见 Oh My Fish 的 [README][9] 的安装部分,以了解其他安装方法。
如果你不想直接将安装命令管道传给 `fish`,请参见 Oh My Fish 的 [README][9] 的安装部分,以了解其他安装方法。
Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-fonts_ 包。
Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 `powerline-fonts` 包。
**在Fedora工作站上**
Fedora 工作站上:
```
> sudo dnf install powerline-fonts
```
**在 Fedora Silverblue 上**
在 Fedora Silverblue 上:
```
> rpm-ostree install powerline-fonts
@ -138,7 +128,7 @@ Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-font
在 Fedora Silverblue 上,你必须重启以完成字体的安装。
安装 _powerline-fonts_ 之后,安装 _bobthefish_
安装 `powerline-fonts` 之后,安装 `bobthefish`
```
> omf install bobthefish
@ -148,7 +138,7 @@ Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-font
![][10]
### 额外的资源
### 更多资源
查看这些网页,了解更多 fish 内容:
@ -161,7 +151,6 @@ Fish 的 powerline 插件是 [bobthefish][7]。Bobthefish 需要 _powerline-font
* [GitHub][17]
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/
@ -169,7 +158,7 @@ via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/
作者:[Michal Konečný][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,92 +1,89 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12067-1.html)
[#]: subject: (Don't love diff? Use Meld instead)
[#]: via: (https://opensource.com/article/20/3/meld)
[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall)
不喜欢 diff 么?试试 Meld 吧
======
Meld 是一个可视化 diff 工具它可让你轻松比较和合并文件、目录、Git 仓库等的更改。
![Person drinking a hat drink at the computer][1]
Meld 是我处理代码和数据文件的基本工具之一。它是一个图形化的 diff 工具,因此,如果你曾经使用过 **diff** 命令并难以理解输出,那么 [Meld][2] 可以为你提供帮助。
> Meld 是一个可视化 diff 工具它可让你轻松比较和合并文件、目录、Git 仓库等的更改。
![](https://img.linux.net.cn/data/attachment/album/202004/03/122428dkagz1qtgh9f2g10.jpg)
Meld 是我处理代码和数据文件的基本工具之一。它是一个图形化的 diff 工具,因此,如果你曾经使用过 `diff` 命令并难以理解输出,那么 [Meld][2] 可以为你提供帮助。
这是该项目网站的精彩描述:
>“ Meld 是面向开发人员的可视化 diff 和合并工具。Meld 帮助你比较文件、目录和版本控制的项目。它提供文件和目录的双向和三向比较,并支持许多流行的版本控制系统。“
>“Meld 是面向开发人员的可视化 diff 和合并工具。Meld 可以帮助你比较文件、目录和版本控制的项目。它提供文件和目录的双向和三向比较,并支持许多流行的版本控制系统。
>
>“ Meld 帮助你检查代码更改并了解补丁。它甚至可以帮助你弄清你一直在避免的合并中发生了什么。”
>“Meld 可以帮助你检查代码更改并了解补丁。它甚至可以帮助你弄清你一直在避免的合并中发生了什么。”
你可以使用以下命令在 Debian/Ubuntu 系统(包括 Raspbian上安装 Meld
```
`$ sudo apt install meld`
$ sudo apt install meld
```
在 Fedora 或类似产品上,是:
在 Fedora 或类似产品上:
```
`$ sudo dnf install meld`
$ sudo dnf install meld
```
Meld 是跨平台的,它有一个使用 [Chocolately][4] 包管理器的 [Windows 安装包][3]。尽管它在 macOS 上不受官方支持,但有[可用于 Mac 的版本][5],你可以使用 Homebrew 安装:
```
`$ brew cask install meld`
$ brew cask install meld
```
有关[其他系统][2],请参见 Meld 的主页。
### Meld 对比 diff 命令
如果你有两个相似的文件(也许一个是另一个的修改版本),并想要查看它们之间的更改,那么可以在终端中运行 **diff** 命令查看它们的区别:
如果你有两个相似的文件(也许一个是另一个的修改版本),并想要查看它们之间的更改,那么可以在终端中运行 `diff` 命令查看它们的区别:
![diff output][6]
此例显示了 **conway1.py****conway2.py** 之间的区别。表明我:
此例显示了 `conway1.py``conway2.py` 之间的区别。表明我:
* 删除了 [shebang][7] 和第二行
  * 从类声明中删除了 **(object)**
  * 为类添加了 docstring
  * 在方法中交换了 **alive** 和 **neighbours == 2** 的顺序
这是使用 **meld** 命令的相同例子。你可以在命令行中运行以下命令进行相同的比较:
* 删除了[释伴][7]和第二行
* 从类声明中删除了 `(object)`
* 为类添加了 docstring
* 在方法中交换了 `alive``neighbours == 2` 的顺序
这是使用 `meld` 命令的相同例子。你可以在命令行中运行以下命令进行相同的比较:
```
`$ meld conway1.py conway2.py`
$ meld conway1.py conway2.py
```
![Meld output][8]
Meld 更清晰!
你可以单击箭头(上下都行)轻松查看并合并文件之间的更改。你甚至可以实时编辑文件在输入时Meld 可以用作具有实时比较功能的简单文本编辑器)—仅在关闭窗口之前一定要保存。
你可以轻松查看并单击箭头(左右都行)合并文件之间的更改。你甚至可以实时编辑文件在输入时Meld 可以用作具有实时比较功能的简单文本编辑器)—只是要记得在关闭窗口之前保存。
你甚至可以比较和编辑三个不同的文件:
![Comparing three files in Meld][9]
### Meld 的 Git
### Meld 的 Git
希望你正在使用 [Git][10] 之类的版本控制系统。如果是这样,那么你的比较不是在两个不同文件之间进行,而是要查找当前文件与 Git 历史文件之间的差异。Meld 理解这一点,因此,如果你运行 **meld conway.py**Git 中有 **conway.py**),它将显示自上次 Git 提交以来所做的更改:
希望你正在使用 [Git][10] 之类的版本控制系统。如果是这样,那么你的比较不是在两个不同文件之间进行,而是要查找当前文件与 Git 历史文件之间的差异。Meld 理解这一点,因此,如果你运行 `meld conway.py``conway.py` 在 Git 中),它将显示自上次 Git 提交以来所做的更改:
![Comparing Git files in Meld][11]
你可以看到当前版本(右侧)和仓库版本(左侧)之间的更改。你可以看到,自上次提交以来,我删除了一个方法,并添加了一个参数和一个循环。
如果你运行 **meld .**,你将看到当前目录(如果位于根目录,就是整个仓库)中的所有更改:
如果你运行 `meld .`,你将看到当前目录(如果位于仓库的根目录,就是整个仓库)中的所有更改:
![Meld . output][12]
你会看到一个文件被修改,另一个文件未加入版本控制(这意味着它对 Git 是新的,因此在比较之前,我需要 **git add** 该文件),以及许多其他未修改的文件。顶部的图标提供了各种显示选项。
你会看到一个文件被修改,另一个文件未加入版本控制(这意味着它对 Git 是新的,因此在比较之前,我需要 `git add` 添加该文件),以及许多其他未修改的文件。顶部的图标提供了各种显示选项。
你还可以比较两个目录,这有时很方便:
@ -98,7 +95,7 @@ Meld 更清晰!
* * *
_本文最初发表在 Ben Nuttall 的 [Tooling blog][14] 上并经允许重新使用。_
*本文最初发表在 Ben Nuttall 的 [Tooling blog][14] 上,并经允许重新使用。*
--------------------------------------------------------------------------------
@ -107,7 +104,7 @@ via: https://opensource.com/article/20/3/meld
作者:[Ben Nuttall][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,24 +1,24 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12079-1.html)
[#]: subject: (Linux firewall basics with ufw)
[#]: via: (https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
Linux firewall basics with ufw
Linux 防火墙 ufw 简介
======
We take a look at ufw - the uncomplicated firewall - on Linux, providing some insights and commands for making changes.
Vertigo3D / Getty Images
The **ufw** (uncomplicated firewall) represents a serious simplification to [iptables][1] and, in the years that its been available, has become the default firewall on systems such as Ubuntu and Debian. And, yes, **ufw** is surprisingly uncomplicated a boon for newer admins who might otherwise have to invest a lot of time to get up to speed on firewall management.
> 我们来研究下 Linux 上的 ufw简单防火墙为你更改防火墙提供一些见解和命令。
GUIs are available for **ufw** (like **gufw**), but **ufw** commands are generally issued on the command line. This post examines some commands for using **ufw** and looks into how it works.
![][0]
First, one quick way to see how **ufw** is configured is to look at its configuration file **/etc/default/ufw**. In the command below, we display the settings, using **grep** to suppress the display of both blank lines and comments (line starting with #).
`ufw`<ruby>简单防火墙<rt>Uncomplicated FireWall</rt></ruby>)真正地简化了 [iptables][1],它从出现的这几年,已经成为 Ubuntu 和 Debian 等系统上的默认防火墙。而且 `ufw` 出乎意料的简单,这对新管理员来说是一个福音,否则他们可能需要投入大量时间来学习防火墙管理。
[RELATED: Linux hardening: a 15-step checklist for a secure Linux server][2]
`ufw` 也有 GUI 客户端(例如 `gufw`),但是 `ufw` 命令通常在命令行上执行的。本文介绍了一些使用 `ufw` 的命令,并研究了它的工作方式。
首先,快速查看 `ufw` 配置的方法是查看其配置文件 —— `/etc/default/ufw`。使用下面的命令可以查看其配置,使用 `grep` 来抑制了空行和注释(以 # 开头的行)的显示。
```
$ grep -v '^#\|^$' /etc/default/ufw
@ -32,19 +32,17 @@ IPT_SYSCTL=/etc/ufw/sysctl.conf
IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_netbios_ns"
```
As you can see, the default policy is to drop input and allow output. Additional rules that allow the connections that you specifically want to be accept are configured separately.
正如你所看到的,默认策略是丢弃输入但允许输出。允许你接受特定的连接的其它规则是需要单独配置的。
The basic syntax for ufw commands might look like thee below, though this synopsis is not meant to imply that typing only “ufw” will get you further than a quick error telling you that arguments are required.
`ufw` 命令的基本语法如下所示,但是这个概要并不意味着你只需要输入 `ufw` 就行,而是一个告诉你需要哪些参数的快速提示。
```
ufw [--dry-run] [options] [rule syntax]
```
The **\--dry-run** option means that **ufw** wont run the command you specify, but will show you the results that you would see if it did. It will, however, display the entire set of rules as they would exist if the change were made, so be prepared for more than a few lines of output.
`--dry-run` 选项意味着 `ufw` 不会运行你指定的命令,但会显示给你如果执行后的结果。但是它会显示假如更改后的整个规则集,因此你要做有好多行输出的准备。
To check the status of **ufw**, run a command like the following. Note that even this command requires use of **sudo** or use of the root account.
[][3]
要检查 `ufw` 的状态,请运行以下命令。注意,即使是这个命令也需要使用 `sudo` 或 root 账户。
```
$ sudo ufw status
@ -57,14 +55,14 @@ To Action From
9090 (v6) ALLOW Anywhere (v6)
```
Otherwise, you will see something like this:
否则,你会看到以下内容:
```
$ ufw status
ERROR: You need to be root to run this script
```
Adding "verbose" provides a few additional details:
加上 `verbose` 选项会提供一些其它细节:
```
$ sudo ufw status verbose
@ -80,14 +78,14 @@ To Action From
9090 (v6) ALLOW IN Anywhere (v6)
```
You can easily allow and deny connections by port number with commands like these:
你可以使用以下命令轻松地通过端口号允许和拒绝连接:
```
$ sudo ufw allow 80 <== allow http access
$ sudo ufw deny 25 <== deny smtp access
$ sudo ufw allow 80 <== 允许 http 访问
$ sudo ufw deny 25 <== 拒绝 smtp 访问
```
You can check out the **/etc/services** file to find the connections between port numbers and service names.
你可以查看 `/etc/services` 文件来找到端口号和服务名称之间的联系。
```
$ grep 80/ /etc/services
@ -101,7 +99,7 @@ amanda 10080/udp
canna 5680/tcp # cannaserver
```
Alternately, you can use service names like in these commands.
或者,你可以命令中直接使用服务的名称。
```
$ sudo ufw allow http
@ -112,7 +110,7 @@ Rule added
Rule added (v6)
```
After making changes, you should check the status again to see that those changes have been made:
进行更改后,你应该再次检查状态来查看是否生效:
```
$ sudo ufw status
@ -129,7 +127,7 @@ To Action From
443/tcp (v6) ALLOW Anywhere (v6) <==
```
The rules that **ufw** follows are stored in the **/etc/ufw** directory. Note that you need root access to view these files and that each contains a large number of rules.
`ufw` 遵循的规则存储在 `/etc/ufw` 目录中。注意,你需要 root 用户访问权限才能查看这些文件,每个文件都包含大量规则。
```
$ ls -ltr /etc/ufw
@ -147,7 +145,7 @@ drwxr-xr-x 3 root root 4096 Nov 12 08:21 applications.d
-rw-r----- 1 root root 1530 Mar 19 10:42 user6.rules
```
The changes made earlier in this post (the addition of port **80** for **http** access and **443** for **https** (encrypted http) access will look like this in the **user.rules** and **user6.rules** files:
本文前面所作的更改,为 `http` 访问添加了端口 `80` 和为 `https` 访问添加了端口 `443`,在 `user.rules``user6.rules` 文件中看起来像这样:
```
# grep " 80 " user*.rules
@ -163,14 +161,14 @@ user.rules:### tuple ### allow tcp 443 0.0.0.0/0 any 0.0.0.0/0 in
user.rules:-A ufw-user-input -p tcp --dport 443 -j ACCEPT
```
With **ufw**, you can also easily block connections from a system using a command like this:
使用 `ufw`,你还可以使用以下命令轻松地阻止来自一个 IP 地址的连接:
```
$ sudo ufw deny from 208.176.0.50
Rule added
```
The status command will show the change:
`status` 命令将显示更改:
```
$ sudo ufw status verbose
@ -191,9 +189,7 @@ Anywhere DENY IN 208.176.0.50 <== new
443/tcp (v6) ALLOW IN Anywhere (v6)
```
All in all, **ufw** is both easy to configure and easy to understand.
Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind.
总而言之,`ufw` 不仅容易配置,而且且容易理解。
--------------------------------------------------------------------------------
@ -201,13 +197,15 @@ via: https://www.networkworld.com/article/3533551/linux-firewall-basics-with-ufw
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[MjSeven](https://github.com/MjSeven)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[0]: https://images.idgesg.net/images/article/2019/06/cso_network_security_encryption_automation_by_vertigo3d_gettyimages-597931354_2400x1600-100798880-large.jpg
[1]: https://www.networkworld.com/article/2716098/working-with-iptables.html
[2]: https://www.networkworld.com/article/3143050/linux/linux-hardening-a-15-step-checklist-for-a-secure-linux-server.html#tk.nww-fsb
[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)

View File

@ -1,24 +1,26 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12072-1.html)
[#]: subject: (3 open source tools for sticking to a budget)
[#]: via: (https://opensource.com/article/20/3/open-source-budget)
[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett)
3 个控制预算的开源工具
======
在这篇开源预算工具汇总中找到适合你的解决方案。另外学习有关开源税收准备软件。
![A dollar sign in a network][1]
鉴于目前世界上许多国家/地区的经济形势都在变化,你可能会想修改或改善财务状况和你对它的了解。或者,也许你的新年决心之一是开始预算?你不是一个人。
> 在这篇开源预算工具汇总中找到适合你的解决方案。另外学习有关开源的备税务软件。
![](https://img.linux.net.cn/data/attachment/album/202004/05/092735ni323vgji9sbigq9.jpg)
鉴于目前世界上许多国家/地区的经济形势都在变化,你可能会想改造或改善财务状况和你对它的了解。或者,也许你的新年决心之一是开始预算?你并不孤单。
坚持该决心的最佳方法是定期跟踪你的支出和收入。问题是,许多流行的个人理财应用都是专有的。你是否正在寻找 Quicken、Mint 或 You Need a Budget 的开源替代方案?无论你是开源软件新手,还是预算新手,这些工具之一都将满足你的需求和舒适度。
### LibreOffice Calc
建议希望做预算的任何开源新手使用 LibreOffice Calc。如果你使用过 Google Sheets 或 Microsoft Excel 等专有电子表格,那么 LibreOffice Calc 模板将非常熟悉。在此[预算教程][2]中,作者 Jess Weichler 已经为你提供了方便、可下载的模板。该模板已经有费用类别,例如水电费、杂货、外出就餐等,但是你可以自由地根据自己的生活方式对其进行自定义。在第二篇文章中,她向你展示了如何[创建自己的模板][3]。
向希望做预算的任何开源新手推荐使用 LibreOffice Calc。如果你使用过 Google Sheets 或 Microsoft Excel 等专有电子表格,那么 LibreOffice Calc 模板将非常熟悉。在此[预算教程][2]中,作者 Jess Weichler 已经为你提供了方便、可下载的模板。该模板已经有费用类别,例如水电费、杂货、外出就餐等,但是你可以自由地根据自己的生活方式对其进行自定义。在第二篇文章中,她向你展示了如何[创建自己的模板][3]。
### HomeBank
@ -28,9 +30,9 @@
就像这里提到的其他预算工具一样GnuCash 可以在 Windows、macOS 和 Linux 上使用。它提供了大量文档,但 Don Watkins 会在[此教程][5]中指导你在 Linux 上设置 GnuCash。GnuCash 不仅是控制个人财务的绝佳选择,而且还有开发票等功能来帮助你管理小型企业。
### 额外一个OpenTaxSolver
### 赠品OpenTaxSolver
对许多美国人来说,可怕的税收季可能是一个压力大的时期。许多人购买 TurboTax 或请会计师或税务服务来缴税。与普遍的看法相反,存在开源的税务准备软件!作者 Jessica Cherry 在[本文][6]中做了研究,并向读者介绍 OpenTaxSolver。要正确使用 OpenTaxSolver你需要特别注意细节但是你不必担心进行复杂的数学运算。
对许多美国人来说,可怕的税收季可能是一个压力大的时期。许多人购买 TurboTax 或请会计师或税务服务来缴税。与普遍的看法相反,开源的税务软件是存在的!作者 Jessica Cherry 在[本文][6]中做了研究,并向读者介绍 OpenTaxSolver。要正确使用 OpenTaxSolver你需要特别注意细节但是你不必担心进行复杂的数学运算。
你会尝试使用哪个开源预算应用?你是否有我在此列表中未提及的最喜欢的工具?请在评论区分享你的观点。
@ -41,7 +43,7 @@ via: https://opensource.com/article/20/3/open-source-budget
作者:[Lauren Pritchett][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,107 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12074-1.html)
[#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions)
[#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/itsfoss/)
如何在基于 Ubuntu 的发行版上安装微软 TrueType 字体
======
如果你在 Linux 上用 LibreOffice 打开一些微软文档,你会发现字体看起来有一点不同。你也将注意到有些常用字体找不到,如 [Times New Roman][1]、Arial 等等。
不用担心。我将向你展示如何在 Ubuntu 上和其它基于 Ubuntu 的 Linux 发行版上安装这些字体。但是在此之前,让我告诉你为什么这些字体没有被默认安装。
### 为什么微软字体不被默认安装在 Linux 中?
![][2]
Times New Roman、Arial 等字体都是微软的,并且这些字体不是开源的。很多 Linux 发行版默认不提供专有软件,以避免授权问题。
这就是为什么在默认情况下 Ubuntu 和其它 Linux 发行版使用开源字体 “Liberation” 字体来替代微软字体的原因。[Red Hat][4] 创建 [Liberation 字体][3] 来代替 Arial、Arial Narrow、 Times New Roman 和 Courier New因为这些字体的宽度一样。当你打开一个使用 Times New Roman 字体书写的文档时,会使用对应的 Liberation 字体来保持文档不被破坏。
不过Liberation 字体与微软的字体并不是完全相同的,在一些情况下,你可能需要使用 Arial 或 Times New Roman。一个非常常见的情况是在学校、大学和其他公共或私人机构中微软的字体是唯一的选择。他们要求你使用这些字体之一来提交文档。
好在,你可以在 Ubuntu 和其它发行版上很容易地安装微软字体。以这种方式,你将增强 LibreOffice 的兼容性,并可以自由选择开源办公软件。
### 在基于 Ubuntu 的 Linux 发行版上安装微软字体
你可以自行下载字体,并[在 Ubuntu 中安装新的字体][5]。但是由于微软字体非常受欢迎(并且是免费提供的),所以 Ubuntu 提供了一种简单的方法来安装它们。
要知道尽管微软已经免费发布了其核心字体,在其它操作系统中使用该字体依然是受到限制的。在 Ubuntu 中安装微软字体前,你必须阅读并接受 EULA (最终用户许可协议) 。
这些字体 [可在 multiverse 存储库中获得,首先要确保启用它][6]
```
sudo add-apt-repository multiverse
```
在此之后,你可以更新你的 Ubuntu 存储库缓存,并像这样安装微软字体:
```
sudo apt update && sudo apt install ttf-mscorefonts-installer
```
当微软的最终用户协议出现时,按 `tab` 键来选择 “OK” ,并按回车键。
![按 tab 键来高亮选择][7]
单击 “Yes” 来接受微软的协议:
![使用 tab 键来作出选择,并按回车键][8]
当安装完成后,你应该使用下面的命令来更新字体缓存:
```
sudo fc-cache -f -v
```
![][9]
如果你现在打开 LibreOffice ,你将看到微软 [TrueType 字体][10] 。
![][11]
如果意外地拒绝了许可协议,你可以使用这个命令来重新安装安装程序:
```
sudo apt install reinstall ttf-mscorefonts-installer
```
微软的 TrueType 字体也可以通过 [Ubuntu Restricted Extras package][12] 获得,其包含用来播放 MP3 等文件的其它专有的多媒体编解码器。
> 不要轻视专有字体。
>
> 你可能认为字体有什么大不了的呢?毕竟,它只是一款字体,而不是软件的一个关键部分,对吧?但是你知道,这些年来 [Netflix 为其使用的专有字体支付了数百万美元][13]吗?最后,他们创建了自己的自定义字体,这为他们节省了一大笔钱。
希望这个快速教程有用。更多的生产力教程即将上线,请在下面留下你的评论,了解更多信息请订阅我们的社交媒体!
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-microsoft-fonts-ubuntu/
作者:[Dimitrios Savvopoulos][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Times_New_Roman
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-fonts-ubuntu.png?ssl=1
[3]: https://en.wikipedia.org/wiki/Liberation_fonts
[4]: https://en.wikipedia.org/wiki/Red_Hat
[5]: https://itsfoss.com/install-fonts-ubuntu/
[6]: https://itsfoss.com/ubuntu-repositories/
[7]: https://i1.wp.com/i.imgur.com/JoEJp5w.png?ssl=1
[8]: https://i0.wp.com/i.imgur.com/M8zTc7f.png?ssl=1
[9]: https://i0.wp.com/i.imgur.com/Cshle6S.png?ssl=1
[10]: https://en.wikipedia.org/wiki/TrueType
[11]: https://i1.wp.com/i.imgur.com/9oIu3oj.png?ssl=1
[12]: https://itsfoss.com/install-media-codecs-ubuntu/
[13]: https://thehustle.co/nextflix-sans-custom-font/
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1

View File

@ -1,39 +1,37 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12076-1.html)
[#]: subject: (Oracle Announces Java 14! How to Install it on Ubuntu Linux)
[#]: via: (https://itsfoss.com/java-14-ubuntu/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Oracle 发布 Java 14如何在 Ubuntu Linux 上安装
如何在 Ubuntu Linux 上安装 Oracle Java 14
======
最近Oracle 宣布 Java 14或 Oracle JDK 14正式开放。如果你想进行最新的实验或者开发的话那么你可以试试在 Linux 系统上安装 Java 14。
![](https://img.linux.net.cn/data/attachment/album/202004/05/205313e188lsbrbgz9932d.jpg)
Oracle JDK 14或简称 Java 14[发行版][1]包含几个新功能,如果你想预览它们的话。我已添加了链接:
最近Oracle 宣布 Java 14或 Oracle JDK 14公开可用。如果你想进行最新的实验或者开发的话那么你可以试试在 Linux 系统上安装 Java 14。
Oracle JDK 14或简称 Java 14[发布版][1]包含几个新功能,如果你想预览它们的话。我已添加了链接:
* [instanceof 的模式匹配][2]
* [Records][3]
* [Text Blocks][4]
除预览功能外,它还包含一些改进和补充。在新闻中,他们还提到了其他改进:
>此外,最新的 Java 版本增加了 Java 语言对 switch 表达式的支持,新增了用于持续监控 JDK Flight Recorder 数据的新 API将低延迟 zgc 扩展到了 macOS 和 Windows并添加在 incubator 模块中,独立的 Java 应用打包和为了安全的新的外部内存访问 API 来有效地访问 Java 堆外部的内存
> 此外,最新的 Java 版本增加了 Java 语言对 switch 表达式的支持,新增了用于持续监控 JDK Flight Recorder 数据的新 API将低延迟 zgc 扩展到了 macOS 和 Windows并添加在 incubator 模块中,独立的 Java 应用打包,以及为了安全、有效地访问 Java 堆外部内存的新的外部内存访问 API
当然,如果你想详细了解细节,那么你应查看[官方公告][1]。
当然,如果你想深入了解细节,那么你应查看[官方公告][1]。
在本教程中,我将向你展示在 Ubuntu 系统上安装 Java 14 的简便方法。继续阅读。
在本教程中,我将向你展示在 Ubuntu 系统上安装 Java 14 的简便方法。继续阅读。
**注意:**如果你选择 Oracle Java 11 或更高版本,那么应该了解新的 [Oracle 技术网络许可协议][5],以了解它如何影响个人用户、开发人员和商业组织。通常,它们可以免费用于开发和测试,但不能用于生产。
**注意:**如果你选择使用 Oracle Java 11 或更高版本,那么应该了解新的 [Oracle 技术网络许可协议][5],以了解它如何影响个人用户、开发人员和商业组织。通常,它们可以免费用于开发和测试,但不能用于生产环境
### 如何在 Ubuntu Linux 上安装 Java 14
![][6]
作为参考,我已成功在默认安装 **OpenJDK 11****Pop!_OS 19.10** 上成功安装了它。
这里,我们将使用 [Linux Uprising][7] 的 Java 14 安装程序(最初基于 WebUpd8 Java 软件包)。
@ -56,7 +54,7 @@ sudo apt install oracle-java14-set-default
### 总结
当然,这些是最新的特性,如果你不想破环环境,你或许会希望继续使用 Java11。如果你想在了解风险的情况下进行试验请继续尝试
当然,这些会带来最新的特性,如果你不想破环原有环境,你或许会希望继续使用 Java 11。如果你想在了解风险的情况下进行试验请继续尝试
欢迎在下面的评论中让我知道你对 Java 14 的想法。
@ -67,7 +65,7 @@ via: https://itsfoss.com/java-14-ubuntu/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,156 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12077-1.html)
[#]: subject: (5 ways to level up your Vim skills)
[#]: via: (https://opensource.com/article/20/3/vim-skills)
[#]: author: (Detlef Johnson https://opensource.com/users/deckart)
提升你的 Vim 技能的 5 个方法
======
> 通过一些有趣的小技巧使你的文本编辑器更上一层楼。
![](https://img.linux.net.cn/data/attachment/album/202004/05/232434x1hnzlnhcnm3nrc7.jpg)
Vim 是最受欢迎的文本编辑器之一,因此绝对值得你花时间去学习如何使用它。就算你只是学习使用这个无处不在的 [Vi(m)][2] 命令行文本编辑器打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,你都会受益匪浅。
你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh比如
```
$ ssh user@hostname.provider.com
```
并在虚拟专用服务器VPS或本地虚拟化容器中工作那么就可以从这些强大的 Vim 技能中受益匪浅。
### 将 Vim 设置为默认的文本编辑器
几乎所有的现代 Linux或 BSD发行版中都可以在终端仿真器的 shell 命令提示符下使用 Vim。一旦在你的用户 shell 程序中将 Vim 定义为默认编辑器后,那么就可以使用熟悉的 Vim 键绑定来在内置的实用程序(例如 `man`)中导航。我将说明如何使用 Bash 和 Z shellzsh来实现此目的zsh 现在是 macOS 用户的默认 shell自 Catalina 起)。
#### 在 Bash 中将 Vim 设置为默认
Bash 通过点文件的组合来管理设置。最常见的的做法将你的编辑器添加到主目录中的 `.bashrc` 文件中,但也可以将其添加到 `.bash_profile` 中。(请阅读 [GNU Bash 文档][3]了解两者的不同之处)。
通过在 `~/.bashrc` 中添加以下内容,将 Vim 设置为默认编辑器:
```
# set default editor to Vim
export EDITOR=vim
```
`#` 开头的行是可选的注释,这是一个好方法,可以提醒自己该命令的作用。
#### 在 zsh 中将 Vim 设置为默认
zsh 是一种越来越流行的终端仿真器,尤其是在苹果公司的基于 FreeBSD 的 Darwin 系统最近从 Bash 转向 zsh 以来。
zsh 点文件与 Bash 的文件相当,因此你可以在 `~/.zshrc``~/.zprofile` 之间进行选择。有关何时使用哪一个的详细信息,请参见 [zsh文档][4]。
将其设置为默认:
```
# set default editor to Vim
export EDITOR=vim
```
### 优化 Vim 配置
Vim 像是终端仿真器 shell 一样,也使用点文件来设置个人偏好。如果你发现了这种模式,则可能已经猜到它是 `~/.vimrc`
你可能要更改的第一个设置是将对传统的 Vi 兼容模式切换为“关闭”。由于 Vim 是 Vi 的超集,因此 Vi 中的所有功能在 Vim 中都是可用的,并且在 Vim 中得到了很大的改进你可以获得许多高级功能。最新版本8.2)允许你在分割的窗口中以子进程 shell 的方式打开一个终端。
顺便说一句,明确关闭对传统的 Vi 的兼容性看起来没有什么作用([事实上,可能并没有什么作用][5])。当 Vim 遇到 `.vimrc` 文件时,它会暗暗地自动将兼容模式切换到关闭。但有时将其明确关闭仍然很重要。缩写 `nocp``nocompatible` 的同义词,作用是一样的。[条条大道通罗马][6],切换首选项有很多方式。
`.vimrc` 语法中, 以 `"` 开头的行是注释(就像 `.bashrc` 文件中的 `#` 一样),这些注释可以帮助你记住诸如为何选择了一个隐晦的设置名称之类的内容。
要关闭 Vi 兼容性,请将以下内容添加到 `~/.vimrc` 文件中:
```
" ensure that legacy compatibility mode is off
" documentation: <http://vimdoc.sourceforge.net/htmldoc/options.html\#'compatible>'
set nocp
```
### 理解模式
Vim 的 “模式”概念是非常重要的,尤其是“普通模式”和“插入模式”之间的区别。对模式的混淆是大多数新用户的困扰。模式并不是 Vim 所独有的,甚至也不是 Vi 所引入的。命令模式是如此的古老,以至于它比 70 年代发明的[复制和粘贴][7]功能还要早。
#### 重要的模式
Vim 依赖于不同的模式来定义键盘的敲击行为。需要了解的重要模式有:
* 普通模式:默认模式,主要用于导航和打开文件。
* 插入模式(包括替换):这种模式下 Vim 允许将文本输入到打开的文件中。
* 可视模式Vim 的行为类似于基于鼠标的输入方式,如复制、编辑、替换等。
* 命令模式包括行模式、Ex 命令模式和末行模式):是在 Vim 中做更多事情的强大方法。
每种模式都有很多值得探索的地方。使用 [Vimtutor][8]`vimtutor`)可以交互式地学习移动光标、模式和在末行模式下运行 Ex 命令。一些不可缺少的生产力操作符包括:
操作符 | 说明
--- | ---
`:E` | 打开资源管理器,用于定位文件和目录。
`.` | 重复上次的编辑操作。
`;` | 向前重复上一次的动作或移动
`,` | 向后重复上一次的动作或移动。
`/` | 向前搜索文档。
`?` | 向后搜索文档。
`*` | 查找光标所在处的单词的下一个出现的地方。
`#` | 查找光标所在处的单词的上一次出现的地方。
`~` | 切换大小写。
`%` | 在 `()`、`[]` 和 `{}` 的开闭符号之间切换;对编码非常有用。
`z=` | 提出拼写建议。
### 像钢琴一样弹奏 Vim
尽管把 Vim 的操作符“语言”记在记忆中是很重要的,但要想掌握它,难点在于学会像音乐家一样思考,把操作符和动作组合成“和弦”,这样你就可以像弹钢琴一样弹奏 Vim。这就是 Vim 的文本操作能力可以与另一个著名的命令行编辑器 Emacs 相媲美的地方。(虽然其中一个编辑器会让磨损掉你的 `Esc` 键,而另一个编辑器会让你的 `Ctrl` 键磨损掉。)
在描述键“和弦”时Vim 中的传统做法是用大写字母 C 后面加上一个连字符(`C-`)来指代 `Ctrl` 键。这并不是通用的,但我将从这里开始遵循这一惯例,并在有可能引起混淆的时候加以说明。
如果你在 Vim 中键入长行,你会想把它设置成可以换行。想要根据你的工作方式对 Vim 进行个性化设置,请考虑一下这个设置:默认情况下,你希望 Vim 启动时如何处理文本换行?开还是关?我喜欢将其关闭,并将其留在运行命令文件之外。当我想让文本自动换行时,我只需在命令行模式下用 `:set wrap` 设置即可。
让 Vim 设置为默认情况下自动换行并没有错,这只是一个偏好问题 —— 它可能随着时间的推移而改变。同样你也可以控制粘贴、代码语言缩进语法和 `Tab` 键的设置(制表符还是空格?多少个空格?可也在[这里][9]深入研究这些选项)。所有这些默认行为的选项都是完全可配置和可更改的,并且在你使用命令行模式操作时可以实时更改。
你会在社区论坛、Vim 维基和文章(比如这篇文章)中找到很多关于设置 Vim 默认设置的建议。你应该很熟悉为你的个人计算环境设置首选项Vim 也不例外。我强烈建议你从对设置进行很小的更改开始,慢慢地进行其它更改,以便你可以轻松地恢复设置。这样一来,你就可以好多年避免使用插件或完全不用插件。
### Vim 8.2 中的分割、标签和终端
有两种方法可以将你正在处理的文件分割成不同的视图:它们可以并排显示,也可以使用应用程序标签页在全屏(窗口)中切换。这些对应用程序窗口的更改是从命令模式启动的,这需要使用冒号(`:`)来调起提示符。
每个分割的窗口可以容纳一个文件进行编辑,你可以通过标签页在更多的文件之间随意切换。分割的屏幕空间有限,所以当你想分割更多的屏幕时,标签页是很方便的。想要如何设置,纯属个人喜好的问题。要水平分割一个窗口,使用 `:sp`,垂直分割时使用 `:vs`
从 [Vim 8.2][10] 开始,你可以用 `:vert term` 打开一个垂直分割的终端 shell 子进程,以在你的代码旁边的命令行上进行操作。你需要键入 `exit` 来关闭你的终端进程,就像你结束一个 shell 会话一样,但你关闭这个分割的窗口和标签页的方式和关闭任何普通的 Vim 窗口一样,要用 `:q` 来关闭。
要初始化一个标签页,请使用一个特殊的编辑命令:`:tabedit`,它会自动切换到新打开的标签页。如果你给该命令一个文件名作为参数,会打开该文件并进行编辑。如果你忽略了给它一个文件名作为参数,可以在命令行模式下的使用编辑命令 `:e filename.txt`,就像在任何一个普通的 Vim 窗口中一样。可以使用下一个(`:tabn`)和上一个(`:tabp`)命令在标签页间导航。
要使用分割,你需要知道如何使用组合键 `C-w` 和你想要移动的方向的移动键,例如左(`h`)、下(`j`)、左(`k`)、右(`l`)。如果你想学习更多的组合键,请阅读 Vim 手册中的 `:help split``:help tabpage`
### 获取帮助
虽然可以在 Vimtutor 中打开参考 Vim 手册,但用 `:help` 打开 Vim 帮助,可以让你自己把时间花在编辑器上,不用完全依赖像这样的文章,就能获得更多的成果。经验是掌握 Vim 的关键。经验有助于提高你的整体计算直觉,因为 Vim 中的很多东西都是从 Unix 宇宙中汲取的。
祝你在探索 Vim 之美的过程中玩得开心,有什么问题可以在评论中分享。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/vim-skills
作者:[Detlef Johnson][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/deckart
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing)
[2]: https://www.vim.org/
[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
[4]: http://zsh.sourceforge.net/Intro/intro_3.html
[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default
[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it
[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions
[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor
[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse
[10]: https://www.vim.org/vim-8.2-released.php

View File

@ -0,0 +1,65 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Ansible streaming video series, open source security tools, and more industry trends)
[#]: via: (https://opensource.com/article/20/4/ansible-security-more-industry-trends)
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
Ansible streaming video series, open source security tools, and more industry trends
======
A weekly look at open source community and industry trends.
![Person standing in front of a giant computer screen with numbers, data][1]
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
## [Ansible 101 by Jeff Geerling: a YouTube streaming series][2]
> After the incredible response I got from [making my Ansible books free for the rest of March][3] to help people learn new automation skills, I tried to think of some other things I could do to help developers who may be experiencing hardship during the coronavirus pandemic and market upheaval.
**The impact**: Not everyone is a frontline worker in this crisis, but then not every problem it has created needs one. This is a great example of someone using their resources to help in a unique way.
## [Open source security tools for cloud and container applications][4]
> Open-source security tools play an important role in securing your container-based infrastructure. Tools such as Anchore can be used for strong governance capabilities, while on the other hand, Dagda can be used to perform static analysis of known vulnerabilities. Two other tools, OpenSCAP and Clair, also provide good capabilities for vulnerability scanning and compliance management. So, depending upon your business requirements and priorities, you can select the right tool to secure your container investments.
**The impact**: Containers are Linux, and container security is open source as well.
## [Cloud cover: Clearing up some misunderstandings about data centres][5]
> The [carbon footprint of data][6] is becoming more and more of a concern, but there appears to be little economic interest in decreasing the amount of data flowing around the world to mitigate this. In that scenario, finding the most energy-efficient and carbon-neutral ways to run purpose-built data centres could be the only answer.
**The impact**: I was talking to a colleague who manages a team of virtualization engineers about this very problem. He seemed optimistic about the amount of headway his team could make on improving the energy consumption of things like KVM at the kernel level; though at the moment customers aren't asking for it. I'd guess that if, for example, the price of carbon emissions were to go up for some reason, that situation would change pretty quickly.
## [Business culture is key in OpenStack network requirements][7]
> The main question is: What is your [culture][8]? Do you go to a vendor and say, 'Give me your design, tell me what to buy and how to support it'? Starting out, you evaluate systems. What are your options?
>
> If you have siloed folks that work on a particular model of equipment, then OpenStack is probably not for you. If you have people that function at a higher level with some fundamental understanding about the underlying architecture that makes things work, then OpenStack can be very useful for you, and you're much less restricted.
**The impact:** Not every organization can adopt a given technology. Certainly not without a willingness to change at a fundamental level.
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/ansible-security-more-industry-trends
作者:[Tim Hildred][a]
选题:[lujun9972][b]
译者:[译者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/thildred
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://www.jeffgeerling.com/blog/2020/ansible-101-jeff-geerling-youtube-streaming-series
[3]: https://www.jeffgeerling.com/blog/2020/you-can-get-my-devops-books-free-rest-month
[4]: http://techgenix.com/open-source-security-tools/
[5]: https://www.siliconrepublic.com/enterprise/data-centres-seamus-dunne-interxion
[6]: https://www.siliconrepublic.com/machines/data-carbon-footprint
[7]: https://searchnetworking.techtarget.com/feature/Business-culture-is-key-in-OpenStack-network-requirements
[8]: https://whatis.techtarget.com/definition/corporate-culture

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,101 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (When debugging, your attitude matters)
[#]: via: (https://jvns.ca/blog/debugging-attitude-matters/)
[#]: author: (Julia Evans https://jvns.ca/)
When debugging, your attitude matters
======
A while back I wrote [What does debugging a program look like?][1] on what to do when debugging (change one thing at a time! check your assumptions!).
But I was debugging some CSS last week, and I think that post is missing something important: **your attitude**.
Now Im not a very good CSS developer yet. Ive never written CSS professionally and I dont understand a lot of basic CSS concepts (I think I finally understood for the first time recently how `position: absolute` works). And last week I was working on the most complicated CSS project Id ever attempted.
While I was debugging my CSS, I noticed myself doing some bad things that I normally would not! I was:
* making random changes to my code in the hopes that it would work
* googling a lot of things and trying them without understanding what they did
* if something broke, reverting my changes and starting again
This strategy was exactly as effective as you might imagine (not very effective!), and it was because of my attitude about CSS! I had this unusual-for-me belief that CSS was Too Hard and impossible for me to understand. So lets talk about that attitude a bit!
### the problem attitude: “this is too hard for me to understand”
One specific problem I was having was I had 2 divs stacked on top of one another, and I wanted Div A to be on top of Div B. My model of CSS stacking order at the start of this was basically “if you want Thing A to be on top of Thing B, change the z-index to make it work”. So I changed the z-index of Div A to be 5 or something.
But it didnt work! In Firefox, div A was on top, but in Chrome, Div B was on top. Argh! Why? CSS is impossible!!!
I googled a bit, and I found out that a possible reason z-index might not work was because Div A and Div B were actually in different “stacking contexts”. If that was true, even if I set the z-index of Div A to 999999 it would still not put it on top of Div B. ([heres a small example of what this z-index problem looks like, though I think my specific bug had some extra complications][2])
I thought “man, this stacking context thing seems really complicated, why is it different between Firefox and Chrome, Im not going to be able to figure this out”. So I tried a bunch of random things a bunch of blog posts suggested, which as usual did not work.
Finally I gave up this “change random things and pray” strategy and thought “well, what if I just read the documentation on stacking order, maybe its not that bad”.
So I read the [MDN page on stacking order][3], which says:
> When the z-index property is not specified on any element, elements are stacked in the following order (from bottom to top):
> 1\. The background and borders of the root element
> 2\. Descendant non-positioned blocks, in order of appearance in the HTML
> 3\. Descendant positioned elements, in order of appearance in the HTML
This is SO SIMPLE! It just depends on the order in the HTML! I put Div A after Div B in the HTML (as a sibling) and it made everything work in both browsers.
### better attitude: “lets learn the basics and see if that helps”
This whole stacking problem turned out to really not be that complicated all I needed to do was read a very short and simple documentation page to understand how stacking works!
Of course, computer things are not always this simple (and even in this specific case the [rules about what creates a new stacking context][4] are pretty complicated.). But I did not need to understand those more complicated rules in order to put Div A on top of Div B! I only needed to know the much simpler 3 rules above.
So calm down for a second, learn a few of the basics, and see if that helps.
### watching people who know what theyre doing is inspiring
Another area of CSS that I thought was “too hard” for me to understand was this whole `position: absolute` and `position: relative` business. I kept seeing (and sometimes using!) examples where people made complicated CSS things with `position: absolute` but I didnt understand how they worked. Doesnt `position: absolute` mean that the element is always in the same place on the screen? Why are these `position: absolute` things moving when I scroll like the rest of the document? (spoiler: no, thats `position: fixed`.)
But last week, I paired with someone whos a lot better at CSS than me on some code, and I saw that they were just typing in `position: absolute` and `position: relative` confidently into their code without seeming confused about it!! Could that be me?
I looked up the [documentation on MDN][5] on `position: absolute`, and it said:
> The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to its closest positioned ancestor… Its final position is determined by the values of top, right, bottom, and left.
So things with `position: absolute` are positioned relative to their closest positioned ancestor! And you just use `top/bottom/right/left` to pick where! Thats so simple!
### documentation that you can trust makes a big difference
I think another big source of my frustration with CSS is that I didnt have the best grasp of where to find accurate information &amp; advice. I knew that MDN was a reliable reference, but MDN doesnt really help answer questions like “ok but seriously how do I center a div???” and I found myself reading a lot of random Stack Overflow answers/blog posts that I wasnt 100% sure were correct.
This week I learned about [CSS Tricks][6] which has a lot of GREAT articles like [Centering in CSS: A Complete Guide][7] which seems very reputable and is written in a super clear way.
### thats all!
I dont really know why I started to believe that it was “impossible” to understand basic CSS concepts since I dont believe that about computers in general. Maybe because Ive been writing CSS at a beginner level for a very long time but hadnt ever really tried to do a more involved CSS project than “lets arrange some divs in a grid with flexbox”!
But this attitude really got in the way of me writing the CSS I wanted to write! And once I let go of it and used my normal debugging techniques I was able to get a lot more things to work the way I wanted.
--------------------------------------------------------------------------------
via: https://jvns.ca/blog/debugging-attitude-matters/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://jvns.ca/
[b]: https://github.com/lujun9972
[1]: https://jvns.ca/blog/2019/06/23/a-few-debugging-resources/
[2]: https://codepen.io/jvns-css-fun/pen/YzXMMdQ
[3]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/Stacking_without_z-index
[4]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
[5]: https://developer.mozilla.org/en-US/docs/Web/CSS/position
[6]: https://css-tricks.com
[7]: https://css-tricks.com/centering-css-complete-guide/

View File

@ -0,0 +1,106 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Book review: Nine Lies About Work)
[#]: via: (https://opensource.com/open-organization/20/4/book-review-nine-lies-about-work)
[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland)
Book review: Nine Lies About Work
======
An examination of common work misconceptions and how open organizations
are often ahead of the curve.
![Carrot on a stick][1]
In _Nine Lies About Work_, authors Marcus Buckingham and Ashley Goodall examine what we might consider "common theories" about aspects of contemporary organizational life—and they debunk those theories. The book's so-called "lies" are, therefore, not really lies but rather common beliefs about work that simply aren't accurate in actual working environments today.
In this review, I'll outline all nine of those misconceptions and explain what the authors believe is really true in the case of each one. But then I'll focus more on explaining the misconceptions that are especially relevant to [open organizations][2].
### Liar, liar
Buckingham and Goodall address the following nine "lies" about work.
Lie #1—People care about which company they work for. The authors believe that people really care about which team they're directly working on. That is where we [find engagement][3].
Lie #2—The best plan wins. The authors believe that the best front-line intelligence and feedback wins. In this rapidly changing world, [plans only tell you where you are now][4] and where you may be in the very near future (that is, in a few weeks or months).
Lie #3—The best companies cascade goals. The authors believe that the best companies [disseminate downward meaning][5] (that is, public purpose) to their staff.
Lie #4—The best people are well-rounded. The authors believe that the best people are good only at specific tasks (and not _necessarily_ other tasks).
Lie #5—People need feedback. The authors believe that people need nonjudgmental, uncritical attention, and to be recognized; they don't need criticism.
Lie #6—People can reliably rate other people. The authors believe that people can reliably rate their own experience and [evaluate their own performance][6] often better than others can.
Lie #7—People have potential. The authors believe that every person possesses individual needs and individual feelings of forward momentum and progress. Therefore, their potential cannot be determined.
Lie #8—Work-life balance matters most. The authors believe that love-in-work matters most. Companies should promote each individual finding the [love of what they do at work][7], then expand on that love. Companies should promote having fun at work, but they rarely do.
Lie #9—Leadership is a thing. The authors believe that [we each follow people with a vision][8] in which we believe. To say a person is "a good leader" is, therefore, only situational according to individual followers. No universal criteria, rule, or model for effective leadership exists.
### Teams over companies
Now let's take a hard look at Lie #1. The authors believe that someone seeking a job will care about the quality of a company, their status inside that company, and their pay, but as soon as work begins, team engagement becomes far more important to them. That's because teams focus on what we do on a daily basis. Those teams might even be unofficial groups inside an organization—"[internal communities][9]," we might call them. Buckingham and Goodall provide eight characteristics of great teams, and these characteristics would ring equally true in [open organization communities][2]. The authors present them separated into two categories—"We"-related and "Me"-related):
* The members are enthusiastic about the team mission ("We").
* Each is surrounded by people who share the same values ("We").
* Their teammates will stand behind them when needed ("We")
* The members feel confident regarding the future of the company ("We").
* Each member understands what is expected ("Me").
* Everyone feels they have a chance to use their particular strengths ("Me"). According to a 2018 study from ADP Research Institute, cited in the book's appendix, if we can use our strengths that bring us joy and energizes us 20% of the time at work, total work engagement skyrockets.
* All members can be recognized for excellent work ("Me").
* The members are challenged to grow ("Me").
All these characteristics describe a healthy culture in an open organization community.
According to the authors, a company should explore what [informal, unofficial teams][10] it has and learn what they're involved in. Usually, they say, the average person is on five teams, each with different purposes. Ask people if they have these types of teams (or a single mentor) with whom they can consult inside the company. Larger, more formal groups are less important.
More important, however, are lunch meetings between informal team members or chats in corners discussing how they can help each other. When I was providing sales seminars, for example, I would walk around the company cafeteria and have these discussions with global sales departments. By doing this, I developed strong communities over a 20-year period. The quality and quantities of these teams are directly connected to employee engagement and are extremely important to the success of a company, according to the authors. An organizational leader's primary job is to create an environment where these teams can grow and thrive.
### Forget planning
Next, let's turn to Lie #2: the best plan wins. Buckingham and Goodall believe the best front-line intelligence wins. Open organizations [rely a great deal on bottom-up management techniques][11], which fits nicely into what the authors are saying here. All the action is on the front-line, and real-time reporting to management on situational developments is extremely important, according to the authors. Conditions are changing so fast that [by the time some plans are introduced, they are already out-of-date][12]. That is why open organizations strongly believe in cultivating ground-level decision-making practices. People closest to the issues know what's happening.
Regarding [open organization principles][2], we might note the emphasis on getting front-line information in real-time and broadly distributing it as much as possible (inclusivity, transparency, broader community), as well as encouraging and reporting front-line suggestions (collaboration, adaptability). Communication is two-way. To share information efficiently and understand when it's needed, Buckingham and Goodall believe that many small, short, frequent meetings are always more productive than large, long, infrequent ones.
### Don't judge
Next, let's examine Lie #5: People need feedback. The authors do recognize people's need for nonjudgmental, uncritical attention, and their desire to be recognized. A leader's level of uncritical attention is directly connected to the level of staff engagement. Just asking, "[How are you doing in your work?][13]" and "Well, how can I help?" is all that is needed.
The authors believe that the worst managers are those that ignore people. Average managers don't ignore people, but they give negative feedback, which weakens their teams' feelings of engagement. The best managers, team leaders, or community leaders don't ignore and don't judge. At least weekly, they simply ask questions and provide help if needed. A high degree of managerial attention directly improves front-line engagement. The authors believe that it makes members feel connected, supported, and understood.
Buckingham and Goodall believe that looking at a staff's negative qualities is a natural tendency. Therefore, leaders and managers must make strong efforts to avoid doing so. This effort is worth it, the authors argue, as it results in greater performance, engagement, and growth. For example, when I was giving sales manager training, I frequently needed to address the situation of handling sales staff coming to the manager to help them with a customer problem. I recommended that the manager just ask the sales staff a simple question: "What did you do and say when you met the customer, and what would you do differently if you could visit the customer all over again?" This forced salespeople to come up with their own advice.
### Concluding thoughts
_Nine Lies about Work_ has much to teach anyone interested in open organizations. Buckingham is a global researcher in human strengths development and performance; Goodall is a senior VP in leadership and team intelligence at Cisco. It is amazing how closely their beliefs align with open organization principles. The ways they articulate those beliefs in this book are enlightening.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/20/4/book-review-nine-lies-about-work
作者:[Ron McFarland][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ron-mcfarland
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_pink2.png?itok=I5Wgct6V (Carrot on a stick)
[2]: https://opensource.com/open-organization/resources/open-org-definition
[3]: https://opensource.com/open-organization/18/10/understanding-engagement-empowerment
[4]: https://opensource.com/open-organization/19/5/planning-future-unknowable
[5]: https://opensource.com/open-organization/18/7/culture-of-experimentation-in-4-steps
[6]: https://opensource.com/open-organization/15/5/measuring-performance-open-source-way
[7]: https://opensource.com/open-organization/15/11/reigniting-employee-passion
[8]: https://opensource.com/open-organization/18/12/what-is-open-leadership
[9]: https://opensource.com/open-organization/19/11/what-is-community-practice
[10]: https://opensource.com/open-organization/20/1/why-build-community-of-practice
[11]: https://opensource.com/open-organization/17/3/making-better-open-decisions
[12]: https://opensource.com/open-organization/18/3/try-learn-modify
[13]: https://opensource.com/open-organization/16/10/how-ask-why-without-upsetting-anyone

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (chunibyo-wly)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,164 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use the Fluxbox Linux desktop as your window manager)
[#]: via: (https://opensource.com/article/19/12/fluxbox-linux-desktop)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Use the Fluxbox Linux desktop as your window manager
======
This article is part of a special series of 24 days of Linux desktops.
Fluxbox is very light on system resources, yet it has vital Linux
desktop features to make your user experience easy, blazingly efficient,
and unduly fast.
![Text editor on a browser, in blue][1]
The concept of a desktop may differ from one computer user to another. Many people see the desktop as a home base, or a comfy living room, or even a literal desktop where they place frequently used notepads, their best pens and pencils, and their favorite coffee mug. KDE, GNOME, Pantheon (and so on) provide that kind of comfort on Linux.
But for some users, the desktop is just empty monitor space, a side effect of not yet having any free-floating application windows projected directly onto their retina. For these users, the desktop is a void over which they can run applications—whether big office and graphic suites, or a simple terminal window, or docked applets—to manage services. This model of operating a [POSIX][2] computer has a long history, and one branch of that family tree is the *box window managers: Blackbox, Fluxbox, and Openbox.
[Fluxbox][3] is a window manager for X11 systems that's based on an older project called Blackbox. Blackbox development was waning when I discovered Linux, so I fell into Fluxbox, and I've used it ever since on at least one of my active systems. It is written in C++ and is licensed under the MIT open source license.
### Installing Fluxbox
You are likely to find Fluxbox included in the software repository of your Linux distribution, but you can also find it on [Fluxbox.org][4]. If you're already running a different desktop, it's safe to install Fluxbox on the same system because Fluxbox doesn't predetermine any configuration or accompanying applications.
After installing Fluxbox, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in.
To override the desktop with GDM:
![Select your desktop session in GDM][5]
Or with KDM:
![Select your desktop session with KDM][6]
### Configuring the Fluxbox desktop
When you first log in, the screen is mostly empty because all Fluxbox provides are panels (for a taskbar, system tray, and so on) and window decoration for application windows.
![Default Fluxbox configuration on CentOS 7][7]
If your distribution delivers a plain Fluxbox desktop, you can set a background for your desktop using the **feh** command (you may need to install it from your distribution's repository). This command has a few options for setting the background, including **\--bg-fill** to fill the screen with your wallpaper of choice, **\--bg-scale** to scale it to fit, and so on.
```
`$ feh --bg-fill ~/photo/oamaru/leaf-spiral.jpg`
```
![Fluxbox with a theme applied][8]
By default, Fluxbox auto-generates a menu, available with a right-click anywhere on the desktop, that gives you access to applications. Depending on your distribution, this menu may be very minimal, or it may list all the launchers in your **/usr/share/applications** directory.
Fluxbox configuration is set in text files, and those text files are contained in the **$HOME/.fluxbox** directory. You can:
* Set keyboard shortcuts in **keys**
* Set startup services and applications in **startup**
* Set desktop preferences (such as the number of workspaces, locations of panels, and so on) in **init**
* Set menu items in **menu**
The text configuration files are easy to reverse-engineer, but you also can (and should) read the Fluxbox [documentation][9].
For example, this is my typical menu (or at least the basic structure of it):
```
# to use your own menu, copy this to ~/.fluxbox/menu, then edit
# ~/.fluxbox/init and change the session.menuFile path to ~/.fluxbox/menu
[begin] (fluxkbox)
 [submenu] (apps) {}
  [submenu] (txt) {}
   [exec] (Emacs 23 (text\\)) { x-terminal-emulator -T "Emacs (text)" -e /usr/bin/emacs -nw} &lt;&gt;
   [exec] (Emacs (X11\\)) {/usr/bin/emacs} &lt;&gt;
   [exec] (LibreOffice) {/usr/bin/libreoffice}
  [end]
  [submenu] (code) {}
   [exec] (qtCreator) {/usr/bin/qtcreator}
   [exec] (eclipse) {/usr/bin/eclipse}
  [end]
  [submenu] (graphics) {}
   [exec] (ksnapshot) {/usr/bin/ksnapshot}
   [exec] (gimp) {/usr/bin/gimp}
   [exec] (blender) {/usr/bin/blender}
  [end]
  [submenu] (files) {}
   [exec] (dolphin) {/usr/bin/dolphin}
   [exec] (konqueror) { /usr/bin/kfmclient openURL $HOME }
  [end]
  [submenu] (network) {}
   [exec] (firefox) {/usr/bin/firefox}
   [exec] (konqueror) {/usr/bin/konqueror}
  [end]
 [end]
## change window manager or work env
[submenu] (environments) {}
 [restart] (flux)  {/usr/bin/startfluxbox}
 [restart] (ratpoison)  {/usr/bin/ratpoison}
 [exec] (openIndiana) {/home/kenlon/qemu/startSolaris.sh}
[end]
[config] (config)
 [submenu] (styles) {}
  [stylesdir] (/usr/share/fluxbox/styles)
  [stylesdir] (~/.fluxbox/styles)
 [end]
[workspaces] (workspaces)
[reconfig] (reconfigure)
[restart] (restart)
[exit] (exeunt)
[end]
```
The menu also provides a few preference settings, such as the ability to pick a theme and restart or log out from your Fluxbox session.
I launch most applications using keyboard shortcuts, which are entered into the **keys** configuration file. Here are some examples (the **Mod4** key is the Super key, which I use to designate global shortcuts):
```
# open apps
Mod4 t :Exec konsole
Mod4 k :Exec konqueror
Mod4 z :Exec fbrun
Mod4 e :Exec emacs
Mod4 f :Exec firefox
Mod4 x :Exec urxvt
Mod4 d :Exec dolphin
Mod4 q :Exec xscreensaver-command -activate
Mod4 3 :Exec ksnapshot
```
Between these shortcuts and an open terminal, I have little use for a mouse during most of my workday, so there's no wasted time switching from one controller to another. And because Fluxbox stays well out of the way, there's little distraction.
### Why you should use Fluxbox
Fluxbox is very light on system resources, yet it has vital features to make your user experience easy, blazingly efficient, and unduly fast. It's simple to customize, and it allows you to define your own workflow. You don't have to use Fluxbox's panels, because there are other excellent panels out there. You can even middle-click and drag two separate application windows into one another so that they become one window, each in its own tab.
The possibilities are endless, so try the steady simplicity that is Fluxbox on your Linux box today!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/fluxbox-linux-desktop
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
[3]: http://fluxbox.org
[4]: http://fluxbox.org/download/
[5]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM)
[6]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM)
[7]: https://opensource.com/sites/default/files/advent-fluxbox-default.jpg (Default Fluxbox configuration on CentOS 7)
[8]: https://opensource.com/sites/default/files/advent-fluxbox-green.jpg (Fluxbox with a theme applied)
[9]: http://fluxbox.org/features/

View File

@ -1,114 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to install Microsoft TrueType Fonts on Ubuntu-based Distributions)
[#]: via: (https://itsfoss.com/install-microsoft-fonts-ubuntu/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
How to install Microsoft TrueType Fonts on Ubuntu-based Distributions
======
If you open some Microsoft documents in LibreOffice on Linux, youll notice that the fonts look a bit different. Youll also notice that you cannot find common fonts like [Times New Roman][1], Arial etc.
Dont worry. Ill show you how to install these fonts in Ubuntu and other Ubuntu-based Linux distributions. But before that, let me tell you why these fonts are not available by default.
### Why Microsoft fonts are not installed by default in Linux?
![][2]
Times New Roman, Arial and other such fonts are owned by Microsoft and they are not open source. Many Linux distributions dont provide proprietary software by default to avoid licensing issue.
This is why Ubuntu and other Linux distributions use an open source fonts “Liberation fonts” to substitute Microsoft fonts by default. The [Liberation Fonts][3] were created by [Red Hat][4] to substitute Arial, Arial Narrow, Times New Roman and Courier New as their width is the same. When you open a document written in Times New Roman, the equivalent Liberation Font will be used to keep the document uninterrupted.
However Liberation fonts are not identical to Microsofts fonts and in some cases you may need to use Arial or Times New Roman. A very common scenario is that Microsofts fonts are the only option is in schools, universities and other public and private organizations. They require you to submit the documents in one of those fonts.
Good thing is that you can install the Microsoft fonts on Ubuntu and other distributions easily. This way, you will be able to increase compatibility of LibreOffice and have the freedom to choose an open source office software.
### Installing Microsoft fonts on Ubuntu-based Linux distributions
You can [install new fonts in Ubuntu][5] by downloading them on your own. But since Microsoft fonts are very popular (and is provided free of cost), Ubuntu provides an easy way of installing it.
Be aware that despite Microsoft has released its core fonts for free of charge, the usage of the fonts is restricted in other operating systems. Youll have to read and accept EULA (End User License Agreement) before installing Microsoft fonts in Ubuntu.
These fonts are [available in the multiverse repositories so make sure to enable it][6] first:
```
sudo add-apt-repository multiverse
```
After that, you can update your Ubuntu repository cache and install the Microsoft fonts like this:
```
sudo apt update && sudo apt install ttf-mscorefonts-installer
```
Press tab to select **OK** and the press enter when the Microsofts End user agreement appears.
![Press tab to highlight the selection][7]
Click **Yes** to accept the Microsofts agreement:
![Use tab key to make a selection and then press enter][8]
When the installation is done, you should update the font cache using the command below:
```
sudo fc-cache -f -v
```
![][9]
If you open the LibreOffice now, youll see the Microsoft [TrueType fonts][10].
![][11]
In case that you accidentally reject the license agreement, you can reinstall the installer with this command:
```
sudo apt install reinstall ttf-mscorefonts-installer
```
Microsoft TrueType fonts are also available via the [Ubuntu Restricted Extras package][12] that contains other proprietary media codecs to play files like MP3 etc.
Dont underestimate proprietary fonts
You may think whats the big deal with fonts? After all, its just a font, not a crucial piece of software, right?
But did you know that for years, [Netflix paid millions of dollars for the proprietary font][13] it used? At the end, they created their own custom fonts and that saved them a considerable amount of money.
I hope you find this quick tutorial useful. More productivity tutorials are down the line, leave your comments below and subscribe to our social media for more!
![][14]
### Dimitrios Savvopoulos
Dimitrios is an MSc Mechanical Engineer but a Linux enthusiast in heart. He is well settled in Solus OS but curiosity drives him to constantly test other distros. Challenge is part of his personality and his hobby is to compete from 5k to the marathon distance.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-microsoft-fonts-ubuntu/
作者:[Community][a]
选题:[lujun9972][b]
译者:[译者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/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Times_New_Roman
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/microsoft-fonts-ubuntu.png?ssl=1
[3]: https://en.wikipedia.org/wiki/Liberation_fonts
[4]: https://en.wikipedia.org/wiki/Red_Hat
[5]: https://itsfoss.com/install-fonts-ubuntu/
[6]: https://itsfoss.com/ubuntu-repositories/
[7]: https://i1.wp.com/i.imgur.com/JoEJp5w.png?ssl=1
[8]: https://i0.wp.com/i.imgur.com/M8zTc7f.png?ssl=1
[9]: https://i0.wp.com/i.imgur.com/Cshle6S.png?ssl=1
[10]: https://en.wikipedia.org/wiki/TrueType
[11]: https://i1.wp.com/i.imgur.com/9oIu3oj.png?ssl=1
[12]: https://itsfoss.com/install-media-codecs-ubuntu/
[13]: https://thehustle.co/nextflix-sans-custom-font/
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Dimitrios.jpg?ssl=1

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,161 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (5 ways to level up your Vim skills)
[#]: via: (https://opensource.com/article/20/3/vim-skills)
[#]: author: (Detlef Johnson https://opensource.com/users/deckart)
5 ways to level up your Vim skills
======
Kick your text editor up a notch with a few fun tricks.
![Computer keyboard typing][1]
Vim is one of the most popular text editors out there, so it is definitely worth taking time to learn how to use it. If the only things you learn how to do with the ubiquitous [Vi(m)][2] command-line text editor are to open a file, enter and edit some text, save the edited files, and exit the program, you will be much better off for it.
Circumstances where you will find it extremely convenient to know Vim nearly always involve tasks running remote shell operations. If you regularly use secure shell: 
```
`$ ssh user@hostname.provider.com`
```
and work with virtual private servers (VPS) or local virtualization containers, for that matter, you could benefit greatly from strong Vim skills.
### Set Vim as your default text editor
Vim is readily available in nearly all modern Linux (or BSD) distributions at the terminal emulator shell-command prompt. Once you've defined Vim as your default editor in your user shell, then you can navigate built-in utilities like **$ man** using familiar Vim key bindings. I'll explain how to do that with both Bash and Z shell (zsh), which is now the default shell for macOS users (since Catalina).
#### Set Vim as default in Bash
Bash manages settings through a combination of dotfiles. It's most common to add your preferred editor to your **.bashrc** file in your home directory, but it can be added to **.bash_profile** as well. (Read the [GNU Bash documentation][3] to understand the difference).
Set Vim as your default editor by adding the following to **~/.bashrc**:
```
# set default editor to Vim
export EDITOR=vim
```
A line starting with a **#** is an optional comment, which is a good way to remind yourself what a command does.
#### Set Vim as default in Zsh
Zsh is an increasingly popular terminal emulator, especially since Apple's FreeBSD-based Darwin system recently switched from Bash to zsh.
The zsh dotfile parallels Bash's, so you can choose between **~/.zshrc** or **~/.zprofile**. See [the zsh documentation][4] for details on when to use which one.
Set it as default with:
```
# set default editor to Vim
export EDITOR=vim
```
### Optimize your Vim configuration
Vim, much like a terminal emulator shell, uses dotfiles to set personal preferences. If you spotted the pattern, you might have guessed it's **~/.vimrc**.
The first setting you may want to change is switching legacy Vi compatibility mode to Off. Since Vim is a superset of Vi, everything in Vi is available and vastly improved in Vim, and you get many advanced features. The latest version (8.2) allows you to open a terminal as a subprocess shell running in a split window.
As an aside, setting legacy compatibility off might not seem like it's doing anything ([and in fact, it might not be][5]). Vim automatically switches the mode to Off by implication when it encounters a **.vimrc** file. It can still be important at times to explicitly turn it off. The shorthand "nocp" is synonymous with "nocompatible," which also works. There are many "[TIMTOWTDI][6]" conveniences for switching preferences as you work.
Lines that begin with **"** are comments in **.vimrc** syntax (just like **#** in **.bashrc** files). They can help you remember things like why you chose a cryptic setting name.
To turn off Vi compatibility, add the following to your **~/.vimrc** file:
```
" ensure that legacy compatibility mode is off
" documentation: <http://vimdoc.sourceforge.net/htmldoc/options.html\#'compatible>'
set nocp
```
### Understand modes
The notion of Vim's "modes" is very important to learn about, especially the difference between the very distinct **Normal** and **Insert** modes. Confusion about modes is what trips up most new users. Modes aren't unique to Vim, nor were they introduced by Vi. Command mode is so old that it predates the invention of [copy and paste][7] functionality in the 1970s.
#### Important modes
Vim depends on different modes to define keyboard-stroke behavior. The important modes to know are:
* **Normal mode**: Default mode used primarily for navigation and opening files
* **Insert mode** (includes Replace): Where Vim allows for text input to an open file
* **Visual mode**: Where Vim acts similar to mouse-based input, such as copying, editing, replacing, and more
* **Command mode** (including Line, Ex command, and Last-line mode): A powerful way to do more in Vim
Each mode has a great deal to explore. Use [Vimtutor][8] (**$ vimtutor**) to interactively learn about movement, modes, and running Ex commands in "Last Line" mode. Some indispensable productivity operators include:
**:E** | Opens explorer for locating files and directories
---|---
**.** | Repeats the last edit action
**;** | Repeats the last motion or movement forward
**,** | Repeats the last motion or movement backward
**/** | Searches document forward
**?** | Searches document backward
***** | Finds next occurrence of the word under the cursor
**#** | Finds the previous occurrence of the word under the cursor
**~** | Toggles case
**%** | Toggles between opening and closing **()**, **[]**, and **{}**; highly useful for coding
**z=** | Makes spelling suggestions
### Play Vim like a piano
While it's important to commit Vim's operator "language" to memory, the challenge to gaining mastery is to learn to think like a musician and combine operators and movements into "key chords in harmony" so that you can play Vim like a piano. That's where the power of text manipulation with Vim rivals that of the other notable command-line editor, Emacs. (While one of these editors will wear down your **Esc** key, using the other will wear down your **Ctrl** key.)
When describing key chords, it's conventional in Vim to designate the **Ctrl** key using the capital letter C, followed by a hyphen (**C-**). It's not universal, but I will follow that convention from here onward and clarify when there is any potential for confusion.
If you type long lines in Vim, you'll want to set it to wrap your text. To start personalizing Vim for the way you work, think about that setting: How would you like Vim to handle text wrapping by default when it starts? On or off? I like it turned off and leave it out of the runtime commands file. When I want text to wrap, I simply set it in command-line mode with **:set wrap**.
There's nothing wrong with having Vim set to wrap text by default. It's simply a matter of preference—which can change over time. The same goes for handling paste, code language indent syntax, and the **Tab** key (tabs or spaces? and how many spaces then? Dive into these options [here][9]). All these options for default behavior are entirely configurable and changeable in real time as you work with command-line mode operations.
You will find many suggestions for setting Vim defaults in community forums, on Vim wikis, and in articles (like this one). Setting preferences for your personal computing environment should be fairly familiar to you, and Vim is no different. I highly recommend that you start by making very small changes to your settings, and make additional changes slowly so that you can easily revert settings. This way, you might avoid the use of plugins for years—or entirely.
### Splits, tabs, and terminals in Vim 8.2
There are two ways to split your working files into different views: they can appear side-by-side, or you can switch between them with full (window) screens using application tabs. These changes to your application window are initiated from command-line mode, which requires a colon (**:**) to call up the prompt.
Each window split can host a file for editing, and you can arrange tabs to switch between additional files as much as you like. There is limited screen space for splits, so tabs are handy when you want to split more screens. How you decide to work is purely a matter of preference. To split a window horizontally, use **:sp**, and use **:vs** for vertical splits.
As of [Vim 8.2][10], you can open a terminal shell sub-process in a vertical split with **:vert term** to run operations on the command line right alongside your code. You need to type **exit** to close your terminal process, just like you would end a shell session, but you close splits and tabs the same way you would close any ordinary Vim window, with **:q**.
To initialize a tab, use a special edit command: **:tabedit**, which automatically switches you to the new open tab. If you give the command a file name as an argument, that file will open for editing. If you neglect to give it a file name as an argument, the command-line mode edit **:e filename.txt** works just like it would in any ordinary Vim window. Navigate tabs with the next (**:tabn**) and previous (**:tabp**) commands.
To use splits, you need to know how to navigate among them using the key-chord combination **C-w** plus a movement key in the direction you want to move, such as left (**h**), down (**j**), up (**k**), or right (**l**). When you want to learn more key chords specific to splits and tabs, read the **:help split** and **:help tabpage** for the Vim manual entries.
### Get help
While the Vim manual is referenced in Vimtutor, opening Vim help with **:help** will let you spend time with the editor on your own and get more productive without wholly relying on articles like this one. Experience is key to Vim mastery. The experience contributes to your overall computing intuition since so much of what has gone into Vim is drawn from the Unix universe.
Have fun exploring the beauty of Vim, and share any questions you have in the comments.
Want to become a master of text editing in the terminal, and beyond? These tips for getting started...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/vim-skills
作者:[Detlef Johnson][a]
选题:[lujun9972][b]
译者:[译者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/deckart
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing)
[2]: https://www.vim.org/
[3]: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
[4]: http://zsh.sourceforge.net/Intro/intro_3.html
[5]: http://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default
[6]: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it
[7]: https://www.npr.org/2020/02/22/808404858/remembering-the-pioneer-behind-your-computers-cut-copy-and-paste-functions
[8]: http://www2.geog.ucl.ac.uk/~plewis/teaching/unix/vimtutor
[9]: https://opensource.com/article/18/9/vi-editor-productivity-powerhouse
[10]: https://www.vim.org/vim-8.2-released.php

View File

@ -1,135 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (HankChow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10)
[#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10
======
[Ubuntu 20.04 LTS release][1] is less than a month away. It has plenty of visual changes and several performance improvements.
If you are still using Ubuntu 18.04 LTS, youll find Ubuntu 20.04 stunningly beautiful with its dark Yaru theme. Heres a [video showing what Ubuntu 20.04 looks like][2]. Have a look and judge it yourself.
[Subscribe to our YouTube channel for more Linux videos][3]
Looks great, isnt it? If you are excited about Ubuntu 20.04 and cannot wait till the final stable release on 23rd April, you can start using it even today. Its fairly stable and it could even help Ubuntu team in testing this release.
Theres always the option to download the daily build and install it afresh. But if you are using Ubuntu 18.04 or Ubuntu 19.10, you can upgrade to Ubuntu 20.04 beta from your existing system.
Please check this tutorial to learn [how to find out which Ubuntu version you are using][4].
In this tutorial, Ill show you the steps to upgrade to Ubuntu 20.04 beta.
### How to upgrade to Ubuntu 20.04 beta from Ubuntu 18.04 and 19.10
![Upgrade Ubuntu 20 04 Beta][5]
Before you see the steps, let me answer some of the common questions regarding upgrading to Ubuntu beta version.
* The upgrade from one version to another is an easy process but you need to have a good internet connection that could download a couple of GBs of data at a good speed.
* Upgrading to a newer version disables the third-party repositories ([PPA][6] you added on your own). Some of these PPAs might not be available for the new version yet. You can manually enable the PPAs after upgrading.
* Having a backup of your important data on an external USB disk is always recommended. Just copy all your important files from Documents, Pictures, Music, Downloads and other places and put it on an external USB or hard disk.
* Once you have upgraded to a newer version, you cannot go back to the older version you were using. Reinstalling the older version is the only option.
* If you upgrade to the Ubuntu 20.04 beta version, you dont need to install it again when the final stable version is released. Just update your Ubuntu system regularly and youll already be using the same 20.04 when it is released.
* You cannot upgrade to Ubuntu 20.04 directly from Ubuntu 16.04, 17, 18, 19.04.
Alright! You know enough now. Lets see the steps to upgrade to Ubuntu 20.04 beta from Ubuntu 19.10 and 18.04.
#### Step 1: Make sure the settings are right
Go to Software &amp; Updates application:
![Software & Updates application in Ubuntu][7]
In the Updates tab, check that Notify me of a new Ubuntu version is set to “Any new version” or “LTS version”:
![Ubuntu Upgrade Version Settings][8]
This may reload the Software repository cache.
#### Step 2: Update your system for any pending software updates
Once you have the correct settings in place, open a terminal ([use Ctrl+Alt+T shortcut in Ubuntu][9]) and use the following [command to update your Ubuntu system][10]:
```
sudo apt update && sudo apt full-upgrade
```
The apt full-upgrade or dist-upgrade function the same as apt upgrade but it will remove currently installed packages if this is needed to upgrade the system as a whole (i.e. a version upgrade).
Your system may ask to restart after installing updates. Thats fine. Restart and resume upgrading to beta release from step 3.
#### Step 3: Run update manager with development release upgrade option
Now that you have all the necessary updates installed, you can open the update manager but with -d option. The -d option tells it to look for development releases.
```
update-manager -d
```
It may take a couple of minutes before informing you that a new version of Ubuntu is available.
![Availability of Ubuntu 20.04 in Ubuntu 19.10][11]
A similar message is displayed in Ubuntu 18.04 as well:
![Availability of Ubuntu 20.04 in Ubuntu 18.04][12]
Hit the upgrade button when you see the above message.
#### Step 4: Start upgrading to Ubuntu 20.04 beta
The rest of the upgrade procedure is basically waiting for update downloads and clicking okay wherever requested.
![][13]
Hit the upgrade button and follow the on-screen instructions.
![][14]
You might be notified that all the third party sources have been disabled. At some point, it will also inform you of the packages that will be upgraded, removed etc. It will also ask if you want to keep obsolete packages or not. I prefer to remove them.
Depending on your internet speed, the upgrade may take a couple of hours. Once the upgrade process is complete, youll be asked to restart your system.
![][15]
This video shows all the steps in action:
See, it wasnt that difficult. Enjoy all the new features in Ubuntu 20.04.
Questions or suggestions? Feel free to leave a comment below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/upgrade-ubuntu-beta/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者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/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
[2]: https://www.youtube.com/watch?v=9u5B0njRgOw
[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1
[6]: https://itsfoss.com/ppa-guide/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-upgrade-version-settings.jpg?ssl=1
[9]: https://itsfoss.com/ubuntu-shortcuts/
[10]: https://itsfoss.com/update-ubuntu/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-from-18-04.jpg?ssl=1
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-1.jpg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-2.jpg?ssl=1
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/restart-to-finish-beta-upgarde-ubuntu-20-04.jpg?ssl=1

View File

@ -0,0 +1,85 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Building a sensing prosthetic with the Raspberry Pi)
[#]: via: (https://opensource.com/article/20/4/raspberry-pi-sensebreast)
[#]: author: (Kathy Reid https://opensource.com/users/kathyreid)
Building a sensing prosthetic with the Raspberry Pi
======
SenseBreast is an early prototype of a sensing mastectomy prosthetic
based on open hardware.
![Open source doctor.][1]
_Content advisory: this article contains frank discussions of breast cancer._
What's the first question you ask your surgeon when you're discussing reconstruction options after breast cancer?
"How many USB ports can you give me?" is probably not the one that comes to mind for many people!
Although the remark was said jokingly, it sparked a thread that would ultimately become [SenseBreast][2]—an early prototype of a sensing mastectomy prosthetic, based on open hardware.
### How did SenseBreast come about?
All technology has a history—an origin story of experimentation, missteps, successes, setbacks, and breakthroughs. SenseBreast is no different. SenseBreast was developed as a term project for the Masters of Applied Cybernetics—a highly selective course at the Australian National University's [3A Institute][3]. The mission of the 3Ai is to bring artificial intelligence and cyber-physical systems safely, responsibly, and sustainably to scale. The purpose of the assignment was to explore the nexus between the electronic, virtual world, and the physical, tactile world.
### What is SenseBreast?
SenseBreast combines two distinct elements: a cyber component—electronics, sensors, and storage for gathering data, and a physical component—a breast form designed to be worn inside a mastectomy bra. SenseBreast is a rudimentary cyber-physical system. In cyber-physical systems, physical and software components are deeply intertwined and interact in different ways depending on context.
The SenseBreast draws on a rich heritage of open source hardware and software. Based on the Raspberry Pi 3B+, it uses the Debian-flavored Raspbian operating system, Python to interact with the onboard sensors, and d3.js to visualize the data that the sensors generate.
Early versions of the SenseBreast used the SenseHAT, but in the true spirit of open source collaboration, I partnered with Australian open source luminary Jon Oxer to develop a custom SenseBreast board. This contains an inertial motion unit (IMU) and temperature, humidity, and pressure sensors, just like the SenseHAT, but in addition, it contains the BME680 volatile gas sensor and a breakout for a heart rate monitor.
![SenseBreast open hardware board developed by Jon Oxer and Kathy Reid][4]
SenseBreast is wearable tech, so the physical form of the cyber-physical system is also important. Factors like comfort, texture, and fit in clothing are important in the design of wearables because technology isn't better unless it's better for people! The early attempts at building a housing for SenseBreast were spectacular failures; in fact, the very first iteration was put together using acrylic render and linen cloth, and held together with paper clips—in true hacker style! It wasn't comfortable to wear at all, but it served as a proof point for further exploration.
![First attempt at creating a breast form using acrylic render covered in linen cloth][5]
Later iterations used a different approach. This involved taking a cast of a breast, using quick-dry silicone supported by a plaster cast. The resulting mold was then used with slow-setting silicone to create a true-to-life shape. A recess was carved into the form to house the electronic components, and an additional silicone layer was added to protect the wearer's skin from contact with electronics.
### What did we learn from SenseBreast?
The key learning from SenseBreast is that data is partial. It only tells part of a story. It can be misleading and untrustworthy, which makes the decisions based on that data unreliable too. For example, the sensor data gathered by SenseBreast was affected by how hard the CPU was working. The graph below plots a sequence of 5 minutes of data from SenseBreast, just after the device has booted. You can see that the temperature decreases over time; this is because the CPU has to work harder as the Raspberry Pi boots, and then cools down after the boot operations are completed.
![Data visualisation of the readings in SenseBreast using the d3.js library][6]
These sorts of learnings have implications on a broader scale.
What if the SenseBreast were not an open source device, but a commercial wearable that stored data about me? What if part of the business model of that company was to sell the data that was harvested? What if my health insurer had access to that data? Or prospective employers? Now, more than ever, it's important that we have private, open solutions for sensing data about ourselves.
### What's next for the SenseBreast project?
The SenseBreast is a very early prototype, but it has the potential to develop through many different arcs. It could be used to assess range of movement post-surgery, to research how different garments and fabrics adjust to temperature and humidity, and to identify correlations between ambient air pressure and conditions such as lymphoedema. The path SenseBreast takes will be dependent on the passion, needs, and dedication of the incredible global open source community.
You can learn more about SenseBreast at [https://sensebreast.org][2] and see my presentation at [linux.conf.au][7] 2020 [here][8].
The code for SenseBreast is available on [GitHub][9].
Health IT has been surprisingly unwilling to deeply support open source software. Despite the huge...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/raspberry-pi-sensebreast
作者:[Kathy Reid][a]
选题:[lujun9972][b]
译者:[译者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/kathyreid
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcedoctor.png?itok=fk79NwpC (Open source doctor.)
[2]: https://sensebreast.org/
[3]: https://3ainstitute.cecs.anu.edu.au/
[4]: https://opensource.com/sites/default/files/uploads/49427571178_bb5df37c3a_c.jpg (SenseBreast open hardware board developed by Jon Oxer and Kathy Reid)
[5]: https://opensource.com/sites/default/files/uploads/49641040471_6d0cc91619_c.jpg (First attempt at creating a breast form using acrylic render covered in linen cloth)
[6]: https://opensource.com/sites/default/files/uploads/49640513813_5a7d63803a_c.jpg (Data visualisation of the readings in SenseBreast using the d3.js library)
[7]: http://linux.conf.au
[8]: https://www.youtube.com/watch?v=G3QfZ11DCpc.
[9]: https://github.com/KathyReid/sensebreast

View File

@ -0,0 +1,162 @@
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Scheduling tasks on Linux using the at command)
[#]: via: (https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
Scheduling tasks on Linux using the at command
======
The at command makes it easy to schedule Linux tasks to be run at any time or date you choose. Check out what it can do for you.
romkaz / Getty Images
When you want commands or scripts to run at some particular time, you dont have to sit with your fingers hovering over the keyboard waiting to press the enter key or even be at your desk at the right time. Instead, you can set your task to be run through the **at** command. In this post, well look at how tasks are scheduled using **at**, how you can precisely select the time you want your process to run and how to view whats been scheduled to run using **at**.
### at vs cron
For those whove been scheduling tasks on Linux systems using **cron**, the **at** command is something like **cron** in that you can schedule tasks to run at a selected time, but **cron** is used for jobs that are run periodically even if that means only once a year. Most **cron** jobs are set up to be run daily, weekly or monthly, though you control how often and when.
The **at** command, on the other hand, is used for tasks which are run only once. Want to reboot your system at midnight tonight? No problem, **at** can do that for you assuming you have the proper permissions. If you want the system rebooted every Saturday night at 2 a.m., use **cron** instead.
### Using at
The **at** command is easy to use ,and there are only a few things to remember. A simple use of **at** might look like this:
```
$ at 5:00PM
at> date >> thisfile
at> <EOT>
```
After typing “at” and the time the command should be run, **at** prompts you for the command to be run (in this case, the **date** command). Type **^D** to complete your request.
Assuming we set up this **at** command earlier than 5 p.m., the date and time will be added to the end of a file named “thisfile” later the same day. Otherwise, the command will run at 5 p.m. the following day.
You can enter more than one command when interacting with the **at** command. If you want more than one command to be run at the same time, simply specify more than one command line:
[][1]
```
$ at 6:22
warning: commands will be executed using /bin/sh
at> echo first >> thisfile
at> echo second >> thisfile
at> <EOT>
```
In the commands above, were using a regular user account and adding some simple text to a file in that users home directory. If its after 6:22 a.m. when this command is run, the command will run the following day because 6:22 is taken to mean 6:22 a.m. If you want it to run at 6:22 p.m., either use 6:22 PM or 18:22. “6:22 PM” also works.
You can use **at** to schedule commands to run on specific dates either by specifying the dates or specifying dates and times like “10:00AM April 15 2021” or “noon + 5 days” (run at noon five days from today). Here are some examples:
```
at 6PM tomorrow
at noon April 15 2021
at noon + 5 days
at 9:15 + 1000 days
```
After you specify the command to run and press **^D**, you will notice that the **at** command has assigned a job number to each request. This number will show up in the **at** command's job queue.
```
$ at noon + 1000 days
warning: commands will be executed using /bin/sh
at> date >> thisfile
at> <EOT>
job 36 at Tue Dec 27 12:00:00 2022 <== job # is 36
```
### Checking the queue
You can look at the queue of **at** jobs with the **atq** (at queue) command:
```
$ atq
32 Thu Apr 2 03:06:00 2020 a shs
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
34 Thu Apr 2 18:00:00 2020 a shs
```
If you need to cancel one of the jobs in the queue, use the **atrm** (at remove) command along with the job number.
```
$ atrm 32
$ atq
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
34 Thu Apr 2 18:00:00 2020 a shs
```
You can look into the details of a scheduled task using the **at -c** command. Additional details (the active search path, etc.) are also available, but the bottom lines of the output will show you what command has been scheduled to run.
```
$ at -c 36 | tail -6
cd /home/shs || {
echo 'Execution directory inaccessible' >&2
exit 1
}
date >> thisfile
```
Notice that the command shown begins with testing whether the users directory can be entered with a **cd** command. The job will exit with an error if this is not the case. Otherwise the command specified when the **at** command was issued will be run. Read the command as "move into /home/shs OR exit with the error shown".
### Running jobs as root
To run **at** jobs as root, simply use **sudo** with your **at** command like this:
```
$ sudo at 8PM
[sudo] password for shs:
warning: commands will be executed using /bin/sh
at> reboot now
at> <EOT>
job 37 at Wed Apr 1 16:00:00 2020
```
Notice that the root task shows up in the queue with **root** as the one to execute it.
```
35 Mon Apr 6 12:00:00 2020 a shs
36 Tue Dec 27 12:00:00 2022 a shs
37 Wed Apr 1 20:00:00 2020 a root <==
```
### Running scripts
You can also use the **at** command to run scripts. Here's an example:
```
$ at 4:30PM
warning: commands will be executed using /bin/sh
at> bin/tryme
at> <EOT>
```
### Denying use of the at command
The **/etc/at.deny** file provides a way to disallow users from being able to make use of the **at** command. By default, it will probably include a list of disallowed accounts like **ftp** and **nobody**. An **/etc/at.allow** file could be used to do the opposite but, generally, only the **at.deny** file is configured.
**Wrap-Up**
The **at** command is very versatile and easy to use when you want to schedule a one-time task even if you want it to run this afternoon or years in the future.
Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3535808/scheduling-tasks-on-linux-using-the-at-command.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,309 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Take back your dotfiles with Chezmoi)
[#]: via: (https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/)
[#]: author: (Ryan Walter https://fedoramagazine.org/author/rwaltr/)
Take back your dotfiles with Chezmoi
======
![][1]
In Linux, dotfiles are hidden text files that are used to store various configuration settings for many such as Bash and Git to more complex applications like i3 or VSCode.
Most of these files are contained in the _~/.config_ directory or right in the home directory. Editing these files allows you to customize applications beyond what a settings menu may provide, and they tend to be portable across devices and even other Linux distributions. But one talking point across the Linux enthusiast community is how to manage these dotfiles and how to share them.
We will be showcasing a tool called [Chezmoi][2] that does this task a little differently from the others.
### The history of dotfile management
If you search [GitHub for dotfiles][3], what you will see are over 100k repositories after one goal: Store peoples dotfiles in a shareable and repeatable manor. However, other than using git, they store their files differently.
While Git has solved code management problems that also translates to config file management, It does not solve how to separate between distributions, roles (such as home vs work computers) secrets management, and per device configuration.
Because of this, many users decide to craft their own solutions, and the community has responded with multiple answers over the years. This article will briefly cover some of the solutions that have been created.
#### Experiment in an isolated environment
Do you want to try these below solutions quickly in a contained environment? Run:
```
$ podman run --rm -it fedora
```
… to create a Fedora container to try the applications in. This container will automatically delete itself when you exit the shell.
#### The install problem
If you store your dotfiles in Git repository, you will want to make it easy for your changes to automatically be applied inside your home directory, the easiest way to do this at first glance is to use a symlink, such as _ln -s ~/.dotfies/bashrc ~/.bashrc_. This will allow your changes to take place instantly when your repository is updated.
The problem with symlinks is that managing symlinks can be a chore. Stow and [RCM (covered here on Fedora Magazine)][4] can help you manage those, but these are not seamless solutions. Files that are private will need to be modified and chmoded properly after download. If you revamp your dotfiles on one system, and download your repository to another system, you may get conflicts and require troubleshooting.
Another solution to this problem is writing your own install script. This is the most flexible option, but has the tradeoff of requiring more time into building a custom solution.
#### The secrets problem
Git is designed to track changes. If you store a secret such as a password or an API key in your git repository, you will have a difficult time and will need to rewrite your git history to remove that secret. If your repository is public, your secret would be impossible to recover if someone else has downloaded your repository. This problem alone will prevent many individuals from sharing their dotfiles with the public world.
#### The multi-device config problem
The problem is not pulling your config to multiple devices, the problem is when you have multiple devices that require different configuration. Most individuals handle this by either having different folders or by using different forks. This makes it difficult to share configs across the different devices and role sets
### How Chezmoi works
Chezmoi is a tool to manage your dotfiles with the above problems in mind, it doesnt blindly copy or symlink files from your repository. Chezmoi acts more like a template engine to generate your dotfiles based on system variables, templates, secret managers, and Chezmois own config file.
#### Getting Started with Chezmoi
Currently Chezmoi is not in the default repositories. You can download the current version of Chezmoi as of writing with the following command.
```
$ sudo dnf install https://github.com/twpayne/chezmoi/releases/download/v1.7.17/chezmoi-1.7.17-x86_64.rpm
```
This will install the pre-packaged RPM to your system.
Lets go ahead and create your repository using:
```
$ chezmoi init
```
It will create your new repository in _~/.local/share/chezmoi/_. You can easily cd to this directory by using:
```
$ chezmoi cd
```
Lets add our first file:
```
chezmoi add ~/.bashrc
```
… to add your bashrc file to your chezmoi repository.
Note: if your bashrc file is actually a symlink, you will need to add the -f flag to follow it and read the contents of the real file.
You can now edit this file using:
```
$ chezmoi edit ~/.bashrc
```
Now lets add a private file, This is a file that has the permissions 600 or similar. I have a file at .ssh/config that I would like to add by using
```
$ chezmoi add ~/.ssh/config
```
Chezmoi uses special prefixes to keep track of what is a hidden file and a private file to work around Gits limitations. Run the following command to see it:
```
$ chezmoi cd
```
**Do note that files that are marked as private are not actually private, they are still saved as plain text in your git repo. More on that later.**
You can apply any changes by using:
```
$ chezmoi apply
```
and inspect what is different by using
```
$ chezmoi diff
```
#### Using variables and templates
To export all of your data Chezmoi can gather, run:
```
$ chezmoi data
```
Most of these are information about your username, arch, hostname, os type and os name. But you can also add our own variables.
Go ahead and run:
```
$ chezmoi edit-config
```
… and input the following:
```
[data]
email = "fedorauser@example.com"
name = "Fedora Mcdora"
```
Save your file and run chezmoi data again. You will see on the bottom that your email and name are now added. You can now use these with templates with Chezmoi. Run:
```
$ chezmoi add -T --autotemplate ~/.gitconfig
```
… to add your gitconfig as a template into Chezmoi. If Chezmoi is successful in inferring template correctly, you could get the following:
```
[user]
email = "{{ .email }}"
name = "{{ .name }}"
```
If it does not, you can change the file to this instead.
Inspect your file with:
```
$ chezmoi edit ~/.gitconfig
```
After using
```
$ chezmoi cat ~/.gitconfig
```
… to see what chezmoi will generate for this file. My generated example is below:
```
[root@a6e273a8d010 ~]# chezmoi cat ~/.gitconfig
[user]
email = "fedorauser@example.com"
name = "Fedora Mcdora"
[root@a6e273a8d010 ~]#
```
It will generate a file filled with the variables in our chezmoi config.
You can also use the varibles to perform simple logic statements. One example is:
```
{{- if eq .chezmoi.hostname "fsteel" }}
# this will only be included if the host name is equal to "fsteel"
{{- end }}
```
Do note that for this to work the file has to be a template. You can check this by seeing if the file has a “.tmpl” appended to its name on the file in _chezmoi cd_, or by readding the file using the -T option
#### Keeping secrets… secret
To troubleshoot your setup, use the following command.
```
$ chezmoi doctor
```
What is important here is that it also shows you the [password managers it supports][5].
```
[root@a6e273a8d010 ~]# chezmoi doctor
warning: version dev
ok: runtime.GOOS linux, runtime.GOARCH amd64
ok: /root/.local/share/chezmoi (source directory, perm 700)
ok: /root (destination directory, perm 550)
ok: /root/.config/chezmoi/chezmoi.toml (configuration file)
ok: /bin/bash (shell)
ok: /usr/bin/vi (editor)
warning: vimdiff (merge command, not found)
ok: /usr/bin/git (source VCS command, version 2.25.1)
ok: /usr/bin/gpg (GnuPG, version 2.2.18)
warning: op (1Password CLI, not found)
warning: bw (Bitwarden CLI, not found)
warning: gopass (gopass CLI, not found)
warning: keepassxc-cli (KeePassXC CLI, not found)
warning: lpass (LastPass CLI, not found)
warning: pass (pass CLI, not found)
warning: vault (Vault CLI, not found)
[root@a6e273a8d010 ~]#
```
You can use either of these clients, or a [generic client][6], or your systems [Keyring][7].
For GPG, you will need to add the following to your config using:
```
$ chezmoi edit-config
```
```
[gpg]
recipient = "<Your GPG keys Recipient"
```
You can use:
```
$ chezmoi add --encrypt
```
… to add any files, these will be encrypted in your source respository and not exposed to the public world as plain text. Chezmoi will automatically decrypt them when applying.
We can also use them in templates. For example, a secret token stored in [Pass (covered on Fedora Magazine)][8]. Go ahead and generate your secret.
In this example, its called “githubtoken”:
```
rwaltr@fsteel:~] $ pass ls
Password Store
└── githubtoken
[rwaltr@fsteel:~] $
```
Next, edit your template, such as your .gitconfig we created earlier and add this lines.
```
token = {{ pass "githubtoken" }}
```
Then lets inspect using*:*
```
$ chezmoi cat ~/.gitconfig
```
```
[rwaltr@fsteel:~] $ chezmoi cat ~/.gitconfig
This is Git's per-user configuration file.
[user]
name = Ryan Walter
email = rwalt@pm.me
token = mysecrettoken
[rwaltr@fsteel:~] $
```
Now your secrets are properly secured in your password manager, your config can be publicly shared without risk!
### Final notes
This is only scratching the surface. Please check out [Chezmois website][2] for more information. The author also has his [dotfiles public][9] if you are looking for more examples on how to use Chezmoi.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/take-back-your-dotfiles-with-chezmoi/
作者:[Ryan Walter][a]
选题:[lujun9972][b]
译者:[译者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/rwaltr/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/chezmoi-cover-816x346.png
[2]: https://www.chezmoi.io/
[3]: https://github.com/search?q=dotfiles&type=Repositories
[4]: https://fedoramagazine.org/managing-dotfiles-rcm/
[5]: https://www.chezmoi.io/docs/how-to/#keep-data-private
[6]: https://www.chezmoi.io/docs/how-to/#use-a-generic-tool-to-keep-your-secrets
[7]: https://www.chezmoi.io/docs/how-to/#use-a-keyring-to-keep-your-secrets
[8]: https://fedoramagazine.org/using-pass-to-manage-your-passwords-on-fedora/
[9]: https://github.com/twpayne/dotfiles

View File

@ -0,0 +1,296 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Best Raspberry Pi Operating Systems for Various Purposes)
[#]: via: (https://itsfoss.com/raspberry-pi-os/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Best Raspberry Pi Operating Systems for Various Purposes
======
[Raspberry Pi][1] is an indispensable single-board computer that comes in handy for a lot of work. Dont believe me? Just [go through this list of Raspberry Pi projects][2] to get a gist of what this tiny device is capable of.
Considering how useful a Raspberry Pi is it is an important task to choose the right operating system for it. Of course, you can do a lot of things with Linux but an OS specially configured for a specific purpose can save you considerable time and effort.
So, in this article, I will be mentioning some of the popular and useful operating systems tailored for Raspberry Pi.
### Installing any OS on Raspberry Pi is really easy thanks to the Raspberry Pi Imager tool
[Installing a Raspberry PI operating system on an SD card][3] is easier than ever before. You can simply get the [Raspberry Pi Imager][4] and get any Raspberry Pi OS installed quickly. Check the official video to see how easy it is.
You may also utilize [NOOBS][5] (New Out Of the Box Software) to easily install different operating systems on Raspberry Pi. You might also get a pre-installed SD card from the list of their supported retailers mentioned in their [official NOOBS download page][5].
Feel free to explore more about installing the operating systems in their [official documentation][6].
[Raspberry Pi OS Download][4]
Now that you know how to install it (and where to get it from), let me highlight a list of useful Raspberry Pi OS to help you out.
### Various operating systems for Raspberry Pi
Please keep in mind that I have taken some effort to list only those Raspberry Pi operating system projects that are being actively maintained. If a project gets discontinued in near future, let me know in the comment section and Ill update this article.
Another thing is that I have focused on the latest Raspberry 4 but this should not be considered a list of Raspberry Pi 4 OS. You should be able to use it on Raspberry Pi 3, 3 B+ and other variants as well but please check the official project websites for the exact details.
**Note:** The list is in no particular order of ranking.
#### 1\. Raspbian OS: The official Raspberry Pi OS
![][7]
Raspbian is the officially supported OS for Raspberry Pi boards. It comes baked in with several tools for education, programming, and general use. Specifically, it includes Python, Scratch, Sonic Pi, Java, and several other important packages.
Originally, Raspbian is based on Debian and comes pre-installed with loads of useful packages. So, when you get this installed, you probably dont need to install essentials separately you should find almost everything pre-installed.
Raspbian OS is actively maintained and it is one of the most popular Raspberry Pi OS out there. You can install it using [NOOBS][5] or follow the [official documentation][6] to get it installed.
[Raspbian OS][8]
#### 2\. Ubuntu MATE: For general purpose computing
![][9]
Even though Raspbian is the officially supported OS, it does not feature the latest and greatest packages. So, if you want quicker updates and potentially latest packages, you can try Ubuntu MATE for Raspberry Pi.
Ubuntu MATE tailored as a Raspberry Pi OS is an incredibly lightweight distribution to have installed. Its also popularly used on [NVIDIAs Jetson Nano][10]. In other words, you can utilize it for several use-cases with the Raspberry Pi.
To help you out, we also have a detailed guide on [how to install Ubuntu MATE on Raspberry Pi][11].
[Ubuntu MATE for Raspberry Pi][12]
#### 3\. Ubuntu Server: To use it as a Linux server
![][13]
If youre planning to use your Raspberry Pi as some sort of server for your project, Ubuntu Server can be a great choice to have installed.
You can find both 32-bit and 64-bit images of the OS. And, depending on what board you have (if it supports 64-bit), you can go ahead and install the same.
However, it is worth noting that Ubuntu Server isnt tailored for desktop usage. So, you need to keep in mind that you will have no proper graphical user interface installed by default.
[Ubuntu Server][14]
#### 4\. LibreELEC: For media server
![][15]
While we already have a list of [media server software available for Linux][16], LibreELEC is one of them.
Its a great lightweight OS system capable enough to have [KODI][17] on your Raspberry Pi. You can try installing it using the Raspberry Pi Imager.
You can easily head to their [official download webpage][18] and find a suitable installer image for your board.
[LibreELEC][19]
#### 5\. OSMC: For media server
![][20]
OSMC is yet another [popular media server software][16] for Linux. While considering the use of Raspberry Pi boards as media center devices, this is one of the best Raspberry Pi OS that you can recommend to someone.
Similar to LibreELEC, OSMC also runs KODI to help you manage your media files and enjoy watching the content you already have.
OSMC does not officially mention the support for **Raspberry Pi 4**. So, if you have Raspberry Pi 3 or lower, you should be good to go.
[OSMC][21]
#### 6\. RISC OS: The original ARM OS
![][22]
Originally crafted for ARM devices, RISC OS has been around for almost 30 years or so.
We also have a separate detailed article on [RISC OS][23], if youre curious to know more about it. Long story short, RISC OS is also tailored for modern ARM-based single-board computers like the Raspberry Pi. It presents a simple user interface with a focus on performance.
Again, this is not something meant for the Raspberry Pi 4. So, only if you have a Raspberry Pi 3 or lower, you can give it a try.
[RISC OS][24]
#### 7\. Mozilla WebThings Gateway: For IoT projects
![][25]
As part of Mozillas [open-source implementation for IoT devices][26], WebThings Gateway lets you monitor and control all your connected IoT devices.
You can follow the [official documentation][27] to check the requirements and the instructions to get it installed on a Raspberry Pi. Definitely, one of the most useful Raspberry Pi OS for IoT applications.
[WebThings Gateway][28]
#### 8\. Ubuntu Core: For IoT projects
Yet another Raspberry Pi OS for potential [IoT][29] applications or just to simply test snaps Ubuntu Core.
Ubuntu core is specifically tailored for IoT devices or specifically Raspberry Pi, here. I wouldnt make any claims about it- but Ubuntu Core is a suitable secure OS for Raspberry Pi boards. You can give this a try for yourself!
[Ubuntu Core][30]
#### 9\. DietPi: Lightweight Raspberry Pi OS
![DietPi Screenshot via Distrowatch][31]
DietPi is a lightweight [Debian][32] operating system that also claims to be lighter than the “Raspbian Lite” OS.
While considering it as a lightweight Raspberry Pi OS, it offers a lot of features that could come in handy for several use-cases. Ranging from easy installers for software packages to a backup solution, theres a lot to explore.
If youre aiming to get an OS with a low footprint but potentially better performance, you could give this a try.
[DietPi][33]
#### 10\. Lakka Linux: Make a retro gaming console
![][34]
Looking for a way to turn your Raspberry Pi to a retro gaming console?
Lakka Linux distribution is originally built on the RetroArch emulator. So, you can have all your retro games on your Raspberry Pi in no time.
We also have a separate article on [Lakka Linux][35] if youre curious to know about it. Or else, just go right ahead and test it out!
[Lakka][36]
#### 11\. RetroPie: For retro gaming
![ ][37]
RetroPie is yet another popular Raspberry Pi OS that turns it into a retro gaming console. It features several configuration tools so that you can customize the theme or just tweak the emulator to have the best retro games.
It is worth noting that it does not include any copyrighted games. You can give it a try and see how it works!
[RetroPie][38]
#### 12\. Kali Linux: For hacking on budget
![][39]
Want to try and learn some ethical hacking skills on your Raspberry Pi? Kali Linux can be a perfect fit for it. And, yes, it usually supports the latest Raspberry Pi as soon as it launches.
Not just limited to Raspberry Pi, but you can get a long list of other supported devices as well. Try it out and have fun!
[Kali Linux][40]
#### 13\. OpenMediaVault: For Network Attached Storage (NAS)
![][41]
If youre trying to set up a [NAS][42] (Network Attached Storage) solution on minimal hardware, Raspberry Pi can help.
Originally, based on Debian Linux, OpenMediaVault offers a bunch of features that include web-based administration capabilities, plugin support, and more. It does support most of the Raspberry Pi models so you can try downloading it and get it installed!
[OpenMediaVault][43]
#### 14\. ROKOS: For crypto mining
![][44]
If youre someone whos interested in cryptocurrencies and bitcoins specifically, this could interest you.
ROKOS is a Debian-based OS that basically lets you turn your Raspberry Pi into a node while having pre-installed drivers and packages for the same. Of course, you need to know how it works before getting it installed. So, I suggest you do some research if youre not sure what youre doing.
[ROKOS][45]
#### 15\. Alpine Linux: Lightweight security-focused Linux
Nowadays, a lot of users are usually looking for security-focused and [privacy-focused distributions][46]. And, if you are one of them, you might as well try Alpine Linux for Raspberry Pi.
It may not be as user-friendly as youd expect (or beginner-friendly) if youre just getting started with Raspberry Pi. But, if you want something different to start with, you can try Alpine Linux, which is a security-focused Linux distribution.
[Alpine Linux][47]
#### 16\. Kano OS: Operating system for kidseducation
![][48]
If youre looking for an open-source OS for Raspberry Pi to make things interesting to learn and educate kids, Kano OS is a good choice.
Its being actively maintained and the user experience for the desktop integration on Kano OS is quite simple and fun for someone to play and make kids learn from it.
[Kano OS][49]
#### 17\. KDE Plasma Bigscreen: To convert regular TVs into Smart TVs
![][50]
This is an under development project from KDE. With [KDE Plasma Bigscreen OS][51] installed on Raspberry Pi, you can use your regular TV like a smart TV.
You dont need a special remote to control the TV. You can use the regular remote control.
Plasma Bigscreen also integrates [MyCroft open source AI][52] for voice control.
The project is in beta phase so expect some bugs and issues if you are willing to give it a try.
[Plasma Bigscreen][53]
#### Wrapping Up
Im sure there are a lot of other operating systems tailored for Raspberry Pi but Ive tried to list the most popular or the useful ones that are actively maintained.
If you think I missed one of best suited Raspberry Pi OS, feel free to let me know about it in the comments below!
--------------------------------------------------------------------------------
via: https://itsfoss.com/raspberry-pi-os/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者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/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.raspberrypi.org/
[2]: https://itsfoss.com/raspberry-pi-projects/
[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/
[4]: https://www.raspberrypi.org/downloads/
[5]: https://www.raspberrypi.org/downloads/noobs/
[6]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspbian_home_screen.jpg?resize=800%2C492&ssl=1
[8]: https://www.raspbian.org/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?resize=800%2C600&ssl=1
[10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/
[11]: https://itsfoss.com/ubuntu-mate-raspberry-pi/
[12]: https://ubuntu-mate.org/raspberry-pi/
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubunt-server.png?ssl=1
[14]: https://ubuntu.com/download/raspberry-pi
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/libreelec.jpg?resize=800%2C600&ssl=1
[16]: https://itsfoss.com/best-linux-media-server/
[17]: https://kodi.tv/
[18]: https://libreelec.tv/downloads_new/
[19]: https://libreelec.tv/
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/osmc-server.jpg?resize=800%2C450&ssl=1
[21]: https://osmc.tv/
[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/10/riscos5.1.jpg?resize=800%2C600&ssl=1
[23]: https://itsfoss.com/risc-os-is-now-open-source/
[24]: https://www.riscosopen.org/content/
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/web-things-gateway.png?ssl=1
[26]: https://iot.mozilla.org/about/
[27]: https://iot.mozilla.org/docs/gateway-getting-started-guide.html
[28]: https://iot.mozilla.org/gateway/
[29]: https://en.wikipedia.org/wiki/Internet_of_things
[30]: https://ubuntu.com/download/raspberry-pi-core
[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/diet-pi.jpg?ssl=1
[32]: https://www.debian.org/
[33]: https://dietpi.com/
[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/lakkaos.jpg?resize=1024%2C640&ssl=1
[35]: https://itsfoss.com/lakka-retrogaming-linux/
[36]: http://www.lakka.tv/
[37]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/retro-pie.png?ssl=1
[38]: https://retropie.org.uk/
[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kali-linux-pi.png?ssl=1
[40]: https://www.offensive-security.com/kali-linux-arm-images/
[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/openmediavault.jpg?ssl=1
[42]: https://en.wikipedia.org/wiki/Network-attached_storage
[43]: https://www.openmediavault.org/
[44]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/rocos-bitcoin-pi.jpg?ssl=1
[45]: https://rokos.space/
[46]: https://itsfoss.com/privacy-focused-linux-distributions/
[47]: https://alpinelinux.org/
[48]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/kano-os-pi.jpeg?ssl=1
[49]: https://kano.me/row/downloadable
[50]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/plasma-bigscreen-menu.jpg?ssl=1
[51]: https://itsfoss.com/kde-plasma-bigscreen/
[52]: https://itsfoss.com/mycroft-mark-2/
[53]: https://plasma-bigscreen.org/#download-jumpto

View File

@ -0,0 +1,129 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux)
[#]: via: (https://itsfoss.com/bodhi-linux-review/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux
======
Bodhi Linux is a [lightweight Linux distribution][1] based on Ubuntu. Unlike most other distributions, Bodhi uses its own Moksha desktop and focuses on providing you a minimal setup to run on older computers.
### What is Bodhi Linux?
![Bodhi Start Page][2]
[Bodhi Linux][3] was first introduced in 2011. It is designed with “[minimalism, resource efficiency, and user choice][4]” in mind. The devs strove to provide a “[system that is functional but not bloated][5]“. As such, it uses the lightweight Moksha Desktop and has only the basic applications preinstalled. The idea is to give the user a stable platform to build the system that they want. It is based on the latest Ubuntu LTS.
### Moksha Desktop
![Bodhi Desktop][6]
Originally Bodhi shipped with the [Enlightenment desktop environment][7]. Bodhi Linux has long been known as the “Enlightened” Linux distro. In fact, the word bodhi is based on the Sanskrit word for “enlightenment”.
However, that changed when Enlightenment 18 was released. The release was in such bad shape that it was not included in Bodhi. Enlightenment 19 was released and fixed some of the problems, but still had issues.
After trying to work with the Enlightenment dev team and getting nowhere, the Bodhi devs [forked][8] Enlightenment 17 in 2015. The new desktop environment would be named [Moksha][9], which is based on the Sanskrit word for “emancipation, liberation, or release”. You can find the code for it on [GitHub][10].
### What is new in 5.1.0?
[Subscribe to our YouTube channel for more Linux videos][11]
[Bodhi 5.1.0][12] is the first release in two years and the second release to be based on Ubuntu 18.04. Besides updating packages, it also has new default icons and theme. This release makes several changes to the default applications. Leafpad comes preinstalled instead of epad and [GNOME Web][13] (also known as Epiphany) replaces [Midori][14]). The eepDater system updater was removed.
There are currently [four different versions][15] of Bodhi 5.1.0 available to [download][16]: Standard, Hwe, Legacy, and AppPack.
* Standard will work for systems made in the last decade. It does not push kernel updates.
* Hwe (Hardware Enablement) edition is new to the Bodhi family and is designed to include support for newer hardware and will received kernel updates. The 5.1 release features the 5.3.0-42 kernel.
* Legacy is the only edition that is 32-bit. It uses the “older 4.9.0-6-686 Linux kernel that is optimized for old (15+ years old) hardware. This kernel also does not include the PAE extension which is not supported on many older systems.”
* The AppPack edition is for those who want a fully-loaded system out of the box and comes with many applications preinstalled.
### System Requirements for Bodhi Linux
Minimum system requirement
* 500 MHz processor
* 256 MB of RAM
* 5 GB of drive space
Recommended system requirement
* 1.0 GHz processor
* 512 MB of RAM
* 10 GB of drive space
### Experiencing Bodhi Linux
![Old Bodhi Linux][17]
Since it is based on Ubuntu, installing Bodhi was very simple. After I signed into Bodhi, I was surprised by the new theme and icon set. The last time I installed Bodhi (including 5.0 a couple of months ago) I thought that it needed a new look. There was nothing really wrong with the previous theme, but it looked like something from the early 2000. The new theme gives it a more modern look.
![Bodhi Linux 5.1][18]
I was also glad to see that Midori had been replaced by GNOME Web. Im not a fan of [Midori browser][19]. It always seemed too minimal for me. (However, that might change in the future with [Midori Next][20].) Web felt more like the web browser I need. Most importantly it comes with Firefox Sync, so I can keep all of my bookmarks and passwords synced.
Unlike many Linux distros, Bodhi doesnt really come with a stand-alone software center. Instead, if you click the AppCenter icon it opens the browser and navigates to the [AppCenter p][21][a][21][ge][21] of the Bodhi website. Here apps are sorted by category. Most of them are [lightweight applications][22].
![Bodhi Linux Appcenter][23]
If you click on one of the pages and click “Install”, Bodhi will install it (after to type in your passwords). This is achieved using a neat little program named [apturl][24] that “is a very simple way to install a software package from a web browser”. Its pretty slick and I wish more Ubuntu-based distros would use it.
Overall, I like the Moksha desktop. It adheres to the desktop metaphor we have seen for decades (and which I am most comfortable with). It stays out of your way but is very easy to change and modify. The only thing I miss is that the application menu doesnt open when I hit the super key. But I guess you cant have everything in life.
### Final Thoughts
I was pleasantly surprised by this recent release of Bodhi Linux. In the past, Ive played with it from time to time. I always liked it, but this last release has been the best so far. In a way, they have broken free of the idea that Bodhi is only for older system by adding support for newer kernels.
If you are looking for a change of scenery while staying close to the world of Ubuntu give [Bodhi Linux][3] a try.
Have you ever used Bodhi Linux? What is your favorite Ubuntu-based distro? Please let us know in the comments below.
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][25].
--------------------------------------------------------------------------------
via: https://itsfoss.com/bodhi-linux-review/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/lightweight-linux-beginners/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-start-page.png?resize=800%2C500&ssl=1
[3]: https://www.bodhilinux.com/
[4]: https://www.bodhilinux.com/w/wiki/
[5]: https://www.bodhilinux.com/w/what-is-bodhi-linux/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-desktop.jpg?resize=800%2C500&ssl=1
[7]: https://www.enlightenment.org/start
[8]: https://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/
[9]: https://www.bodhilinux.com/moksha-desktop/
[10]: https://github.com/JeffHoogland/moksha
[11]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[12]: https://www.bodhilinux.com/2020/03/25/bodhi-linux-5-1-0-released/
[13]: https://wiki.gnome.org/Apps/Web/
[14]: https://en.wikipedia.org/wiki/Midori_(web_browser
[15]: https://www.bodhilinux.com/w/selecting-the-correct-iso-image/
[16]: https://www.bodhilinux.com/download/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi.png?resize=800%2C400&ssl=1
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bodhi-Linux-5-1-screenshot.jpg?ssl=1
[19]: https://itsfoss.com/midori-browser/
[20]: https://www.midori-browser.org/2020/01/15/midori-next-come-on-yarovi-we-can/
[21]: https://www.bodhilinux.com/a/
[22]: https://itsfoss.com/lightweight-alternative-applications-ubuntu/
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Bodhi-Linux-AppCenter.png?resize=800%2C500&ssl=1
[24]: https://wiki.ubuntu.com/AptUrl
[25]: https://reddit.com/r/linuxusersgroup

View File

@ -0,0 +1,140 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?)
[#]: via: (https://itsfoss.com/aur-arch-linux/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
What is Arch User Repository (AUR)? How to Use AUR on Arch and Manjaro Linux?
======
If you have been using [Arch Linux][1] or other distribution based on Arch such as Manjaro, you might have comes across the term AUR. You try to install a new software and someone suggests to install it from AUR. This leaves you confused.
What is this AUR? Why is it used? How to use AUR? Ill answer these questions in this article.
### What is AUR?
![][2]
AUR stands for Arch User Repository. It is a community-driven repository for Arch-based Linux distributions users. It contains package descriptions named [PKGBUILDs][3] that allow you to compile a package from source with [makepkg][4] and then install it via [pacman][5] (package manager in Arch Linux).
The AUR was created to organize and share new packages from the community and to help accelerate popular packages inclusion into the [community repository][6].
A good number of new packages that enter the official repositories start in the AUR. In the AUR, users are able to contribute their own package builds (PKGBUILD and related files).
The AUR community has the ability to vote for packages in the AUR. If a package becomes popular enough — provided it has a compatible license and good packaging technique — it may be entered into the community repository directly accessible by pacman.
In short, AUR is the way for developers to make new software available to Arch Linux users before the software is officially included in Arch repositories.
### Should you use AUR? Whats the risk involved?
Using the AUR is like crossing the street. If you proceed with caution you should be fine.
If you are new to Linux it is advised to not to use the AUR until you build a foundation knowledge about Arch/Manjaro and Linux in general.
It is true that anyone can upload packages to the AUR but the [Trusted Users][7] (TUs) are charged with keeping an eye on what gets uploaded. Although TUs perform quality control to the uploaded packages, there is in no guarantee that packages in the AUR are well formed or not malicious.
In practice the AUR seems to be quite safe but in theory it can do some damage, but only if you are not careful. A smart Arch user, **always** inspects PKGBUILDs and *.install files when building packages from the AUR.
Additionally TUs (Trusted Users) also remove packages in the AUR that are included in core/extra/community so there should be no naming conflicts between them. The AUR will often contain developmental versions of packages (cvs/svn/git/etc) but they will have modified names such as foo-git.
As for the AUR packages, pacman handles dependency resolution and detects file conflicts so you never have to worry about overwriting files in one package with files from another package unless you use the “force” option by default. If you do that, you probably have more serious problems than file conflicts.
### How to use AUR?
The simplest way to use AUR is through a AUR helper. An [AUR helper][8] is a command line tool (some has GUI as well) that lets you search for packages published on the AUR and install them.
##### Installing an AUR helper on Arch Linux
Lets say you want to use [Yay AUR helper][9]. Make sure that you have git installed on Linux. And then clone the repository, go to the directory and build the package.
Use these commands one by one for that:
```
sudo pacman -S git
sudo git clone https://aur.archlinux.org/yay-git.git
cd yay
makepkg -si
```
Once installed, you can use yay command like this to install a package:
```
yay -S package_name
```
Its not that you must use AUR helper for installing packages from AUR. Expand the next section to see how to use AUR without AUR helper.
##### Installing AUR packages without AUR helpers
If you dont want to use AUR helper, you can install packages from AUR on your own as well.
As soon as you find the package you want to install on [AUR page][10] it is advised to confirm “Licence”, “Popularity”, “Last Updated”, “Dependencies” and so on as an extra quality control step.
```
git clone [package URL]
cd [package name]
makepkg -si
```
For example. lets say you want to install [telegram desktop package][11]:
```
git clone https://aur.archlinux.org/telegram-desktop-git.git
cd telegram-desktop-git
makepkg -si
```
#### Enabling AUR support in Manjaro Linux
AUR isnt enabled by default and you have to enable it through pamac. My laptop runs [Manjaro][12] Cinnamon but the steps are same for all Manjaro flavors.
Open Pamac (listed as Add/Remove Software):
![][13]
Once you are in pamac go to preferences like shown below.
![][14]
In preferences dialog box go to AUR tab, enable the AUR support, enable check for updates and close the dialog box.
![][15]
You can now search for packages and those which belong to AUR can be identified by the tag under the package descriptions.
![][16]
I hope you find this article useful and keep an eye on social media for upcoming Arch related topics.
--------------------------------------------------------------------------------
via: https://itsfoss.com/aur-arch-linux/
作者:[Dimitrios Savvopoulos][a]
选题:[lujun9972][b]
译者:[译者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/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.archlinux.org/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-is-aur.png?ssl=1
[3]: https://wiki.archlinux.org/index.php/PKGBUILD
[4]: https://wiki.archlinux.org/index.php/Makepkg
[5]: https://wiki.archlinux.org/index.php/Pacman#Additional_commands
[6]: https://wiki.archlinux.org/index.php/Community_repository
[7]: https://wiki.archlinux.org/index.php/Trusted_Users
[8]: https://itsfoss.com/best-aur-helpers/
[9]: https://github.com/Jguer/yay
[10]: https://aur.archlinux.org/
[11]: https://aur.archlinux.org/packages/telegram-desktop-git
[12]: https://manjaro.org/
[13]: https://i1.wp.com/i.imgur.com/kFF6HtW.png?ssl=1
[14]: https://i0.wp.com/i.imgur.com/47r963A.png?ssl=1
[15]: https://i1.wp.com/i.imgur.com/UThiDHO.png?ssl=1
[16]: https://i2.wp.com/i.imgur.com/RM5BKi2.png?ssl=1

View File

@ -0,0 +1,107 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube)
[#]: via: (https://itsfoss.com/lbry/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube
======
_**LBRY is a new Blockchain-based, open source platform for sharing digital content. It is gaining popularity as a decentralized alternative to YouTube but LBRY is more than just a video sharing service.**_
### LBRY is an open source blockchain based platform for content sharing
At the core of it, [LBRY][1] is a new protocol which is a peer to peer, decentralized file sharing and payment network secured by [blockchain][2] technology. Anyone can build apps on top of LBRY protocol that interact with digital content on the LBRY network. But these technical stuff is for developers.
As a user you can use [LBRY platform][3] for watching videos, listening to music and reading eBooks.
As a content creator, you can use LBRY to share your digital content like video, music, images, podcasts, eBooks etc.
Unlike YouTube, your activities are not tracked to serve you ads. In fact, LBRY is ad free. If you are logged into the network, you wont see any ads anywhere on its website.
### No ads, and you may even earn cryptocurrency for viewing videos on LBRY
The LBRY is governed by its own cryptocurrency called LBC (LBRY Credits).
Like any other cryptocurrency, you can mine it, buy it or get it from someone else. Content creators can set a price in LBC for streaming their content or they can provide it for free and get tipped in LBC by the viewers.
Dont worry, you dont necessarily need to buy LBC. Since its new, youll get LBC as rewards for doing simple tasks as viewing videos, exploring LBRY, following channels etc. In fact, youll get a few LBC simply for creating an account at LBRY and setting up your profile.
![LBRY Rewards Sample][4]
Youll also get LBC in rewards for inviting other users to LBRY platform. For example, if you join [LBRY from Its FOSS invite link][5], both you and I get LBC as reward.
The LBRY reward system will change once the platform grows. Remember initially Bitcoins were also readily available and now it values thousands of dollars.
### Open source, peer to peer, blockchain: LBRY ticks all the right blocks for a privacy-aware user
![LBRY interface][6]
While the cyptocurrency is essential to create a fair and open marketplace in LBRY, its main feature is the peer to peer, decentralized network using blockchain. LBRY puts emphasis on treating you as user, not a product.
Everything built to power LBRY is open source. You can find the entire source code on its GitHub repository.
[LBRY on GitHub][7]
The [LBRY FAQ page][8] is a good resource to know more about LBRY and how it works.
### Using LBRY
![][9]
If you want to give LBRY a try, you can check out its [video sharing platform][3]. If you are logged in or using its app, you wont see any ads.
Creating an account on LBRY will also let you get the LBRY rewards (i.e. the LBC cryptocurrency). You can watch the videos on LBRY web site or on its application.
I have noticed that video streaming is slightly faster when you use the app instead of web browser. [LBRY app is available][10] for Linux, Windows, macOS, iOS and Android.
As a web publisher, Its FOSS is on all major social media channels. We appreciate and respect such decentralized services and try to make a presence on such offbeat platform. You can [find us on Mastodon][11], a [decentralized alternative to Twitter][12]. You can also find Its FOSS on LBRY.
While we will be putting our video content primarily on YouTube and Vimeo (for ad-free experience), our YouTube content will be automatically available on LBRY as well.
So if you are going to use LBRY, you can follow us there to watch all our videos on LBRY.
[Join LBRY and follow Its FOSS][5]
### Conclusion
There may not be a lot of content on LBRY right now. LBRY is trying to encourage and reward creators who publish on LBRY first instead of YouTube.
LBRY is in early stages but its team is working hard to become a viable alternative to YouTube. It has an open road map where they have shared an insight into all their future plans. You may [check it out yourself][13].
By the way, LBRY is not the only platform of this kind. [PeerTube][14] is a similar service that provides a peer to peer video sharing platform.
_**If you are someone who doesnt like tech giants like Google, Microsoft, Huawei spying on your data, keeping a profile of you to serve you targeted ads, you may try platforms like PeerTube and LBRY.**_
What do you think of LBRY? Are you already using something like LBRY or PeerTube? If not, are you willing to give it a try? Whats your overall feeling about P2P platforms like LBRY? Do share your views in the comment section.
--------------------------------------------------------------------------------
via: https://itsfoss.com/lbry/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者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/
[b]: https://github.com/lujun9972
[1]: https://lbry.com/
[2]: https://en.wikipedia.org/wiki/Blockchain
[3]: https://lbry.tv/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-rewards-sample.png?ssl=1
[5]: https://lbry.tv/$/invite/@itsfoss:0
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry.png?ssl=1
[7]: https://github.com/lbryio/
[8]: https://lbry.com/faq
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-interface.jpg?ssl=1
[10]: https://lbry.com/get
[11]: https://mastodon.social/@itsfoss
[12]: https://itsfoss.com/mastodon-open-source-alternative-twitter/
[13]: https://lbry.com/roadmap
[14]: https://joinpeertube.org/

View File

@ -1,184 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How the Linux desktop has grown)
[#]: via: (https://opensource.com/article/19/8/how-linux-desktop-grown)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
Linux 桌面史话
======
> 自 1990 年代初以来Linux 桌面已从简单的窗口管理器发展为完整的桌面。与我们一起来探索 Linux 桌面的历史。
![Person typing on a 1980's computer][1]
我首次安装 Linux 是 1993 年。那时,安装这种操作系统没有太多的选择。早期,许多人只是从别人那里复制一个正在运行的镜像。然后有人想到了一个精巧的主意,创建一个 Linux 的“发行版”,使你可以自定义要安装的软件。那就是 Softlanding Linux 系统SLS也是我首次见到了 Linux。
我的 386 PC 虽然内存不多但也足够了。SLS 1.03 需要 2MB 的内存才能运行,如果要编译程序,则需要 4MB 的内存。如果要运行 X Window 系统,则需要多达 8MB 的内存!而我的电脑正好有足够的内存来运行 X Window 系统。
因为我是在命令行中成长的,图形用户界面对我来说并不是必不可少的。但它确实很方便。我可以在不同的窗口中运行应用程序,并轻松地在任务之间切换。
从我首次体验 Linux 开始,我就迷上了它。从那以后,我一直在台式机上使用 Linux。和许多人一样我在双引导配置下运行 Linux 已有一段时间,因此我可以跳回到 MS-DOS 和 Windows 来运行某些程序。直到 1998 年,我终于冒了个险,全面投身于 Linux 之中。
在过去的 26 年中,我目睹了 Linux 桌面的成熟。在那段时间里,我还尝试了一种有趣的桌面环境组合,我会在下面通过 Linux 桌面的历史之旅分享它。
### X 和窗口管理器
Linux 上的第一个“桌面”其实不是桌面。相反,它们是运行在 X Window 系统上的“<ruby>窗口管理器<rt>window manager</rt></ruby>WM。X 提供了图形用户界面的基本组件如在屏幕上创建窗口以及提供键盘和鼠标输入。就其本身而言X 并没有做太多事情。为了使 X 图形环境能够用起来,你需要一种方法来管理会话中的所有窗口。这就出现了<ruby>窗口管理器<rt>window manager</rt></ruby>。运行 xterm 或 xclock 之类的 X 程序会在一个窗口中打开该程序。窗口管理器会跟踪窗口并进行基本的内部管理,例如让你可以来回移动窗口并将其最小化。其余的事情取决于你自己。你可以通过将程序名列在 `~/ .xinitrc` 文件中以在 X 开始时启动这些程序,但是通常,你会从 xterm 中运行新程序。
在 1993 年,最常见的窗口管理器是 TWM它的历史可以追溯到 1988 年。TWM 极其简单,仅仅提供了基本的窗口管理功能。
![TWM on SLS 1.05][2]
*SLS 1.05 上的 TWM显示了 xterm、xclock 和 Emacs 编辑器*
另一个早期的窗口管理器是 OpenLook 虚拟窗口管理器OLVWM。OpenLook 是 Sun 微系统公司在 1980 年代开发的图形用户界面,后来又移植到其他 Unix 平台。作为一个*虚拟*窗口管理器OLVWM 支持多个工作区。
![OLVWM on SLS 1.05][3]
*SLS 1.05 上的 OLVWM显示了 xterm 和虚拟工作区选择器*
当 Linux 开始流行时,没多久就有人创建出具有更流畅性能和改进界面的新的窗口管理器。这些新的窗口管理器中首先出现的是虚拟窗口管理器 FVWM。FVWM 比 TWM 或 OLVWM 更具现代感。但是,我们仍然没有桌面。
![FVWM on SLS 1.05][4]
*SLS 1.05 上的 FVWM显示了 xterm 和文件管理器*
以现代的眼光来看TWM 和 FVWM 可能看起来很普通。但重要的是要想想当时其它图形环境的外观。 Windows 当时的版本看起来也相当简单。Windows 版本 1 到版本 3 使用了一个称为“程序管理器”的普通启动器。
![Windows 3.11][5]
*Windows 3.11,显示程序管理器和记事本编辑器*
1995 年 8 月,微软发布了 Windows 95改变了现代 PC 桌面的格局。当然,我对此印象深刻。我觉得 Windows 3.x 笨拙而丑陋,但 Windows 95 却流畅而漂亮。更重要的是,我们现在将 Windows 95 视为“ **桌面**”。新的“桌面”隐喻是向前迈出的一大步。你可以在桌面上放置图标——实际上Windows 95 提供了两个默认的桌面图标,分别是“我的电脑”(用于打开文件管理器)和“回收站”(用于放置以后要删除的文件)。
但是更重要的是Windows 95 桌面的意味着*集成*。程序管理器不见了,取而代之的是屏幕底部的任务栏,可让你使用更简单的“开始”菜单启动新程序。任务栏是多功能的,还通过一系列的按钮显示了你正在运行的程序,而托盘显示了时间、扬声器音量和其它简单的控件。你可以在这个新桌面上右键单击任何对象, Windows 95 会为你提供一个上下文相关的菜单,其中包含你可以执行的操作。
![Windows 95][6]
*Windows 95显示了记事本编辑器*
与以前版本的 Windows 甚至其它 Linux 窗口管理器相比Windows 95 的界面更加流畅并且易于使用。值得一提的是Linux 开发人员创建了一个模仿 Windows 95 界面的 FVWM 的新版本。名为 FVWM95 的新窗口管理器仍然不是桌面,但看起来非常漂亮。新的任务栏使你可以使用“开始”菜单启动新的 X 程序。任务栏还使用类似于 Windows 95 的按钮显示了正在运行的程序。
![FVWM95 on Red Hat Linux 5.2][7]
*在 Red Hat Linux 5.2 上的 FVWM95显示了 xterm 和一个带有 xterm 图标、文件管理器和其他程序的快速访问程序启动器*
在 FVWM95 和其他窗口管理器还在改进的同时核心问题仍然存在Linux 并没有真正的桌面。它具有一堆窗口管理器,仅此而已。使用图形用户界面的 Linux 应用程序(基本上意味着它们是 X 应用程序)看起来形态各异且工作方式也不同。除了 X Window 系统提供的简单的纯文本复制/粘贴功能外你无法从一个应用程序复制和粘贴到另一个应用程序里。Linux 真正需要的是在其图形用户界面中完全重新打造以创建它的第一个桌面。
### Linux 桌面之初啼
在 1996 年Matthias Ettrich 感于 X 之下 Linux 应用程序体验不一致的困扰。他想使找个图形环境更易于使用,而且更重要的是,他想使所有东西都像实际的桌面一样“集成”在一起。
Matthias 开始研究<ruby>K 桌面环境<rt>K Desktop Environment</rt></ruby>KDE。那个 K 代表着 “Kool”LCTT 译注:即 Cool。但是 KDE 这个名字也意味着可以在<ruby>通用桌面环境<rt>Common Desktop Environment</rt></ruby>CDE上发挥作用而通用桌面环境是“大 Unix”世界的标准。尽管到了 1996 年CDE 看起来已经有点过时了。CDE 基于 Motif 部件集,这与 FVWM 模仿的设计相同。KDE 1.0 于 1998 年 7 月完成,是对 FVWM95 等普通窗口管理器的绝对改进。
![KDE 1.0][8]
*K 桌面环境KDE版本 1.0。图片来源Paul Brown / KDE*
KDE 是 Linux 向前迈出的一大步。最终Linux 有了一个具有应用程序集成和更现代的桌面图标的真正的桌面。KDE 的设计与 Windows 95 并无不同。屏幕底部有一个任务栏,它提供与 Windows 95 的“开始”菜单等效的功能以及一些应用程序快捷方式。KDE 还支持虚拟桌面,它们被巧妙地标记为 “One”、“ Two”、“Three” 和 “Four”。而正在运行的应用程序则通过屏幕顶部单独的任务栏中的按钮表示。
但是并不是每个人都对 KDE 感到满意。为了从系统中抽象出 GUI 来KDE 使用了 Trolltech 的 Qt 工具套件库。不幸的是Qt 并不是以自由软件的许可证进行分发的。Trolltech 允许 Qt 免费在自由软件应用程序中使用,但在商业或专有应用程序中要收取使用费。而且这种二分法与自由软件不符。这给 Linux 发行版带来了问题:它们应该包括 KDE 吗?还是默认使用较旧而属于自由软件的图形用户界面(例如 FVWM
面对这种情况Miguel de Icaza 和 Federico Mena 于 1997 年开始开发新的 Linux 桌面上。这个新项目被称为 GNOME<ruby>GNU 网络对象模型环境<rt>GNU Network Object Model Environment</rt></ruby>的缩写。GNOME 旨在成为完全自由的软件,并使用了来自 GIMP 图像编辑器中的另一种工具套件(称为 GTK。 GTK 从字面上代表 <ruby>GIMP 工具套件<rt>GIMP Tool Kit</rt></ruby>。当 GNOME 1.0 最终于 1999 年发布时Linux 有了另一个现代化的桌面环境。
![GNOME 1.0][9]
*GNOME 1.0 版。图片来源GNOME 文档项目*
有两个 Linux 桌面环境固然很棒但“KDE 与 GNOME”之争仍持续了一段时间。到 1999 年Trolltech 以新的公共许可证 <ruby>Q 公共许可证<rt>Q Public License</rt></ruby>QPL重新发布了 Qt 库。但是,新许可证有其自己的包袱—-QPL 仅适用于 Qt 在开源软件项目中的使用,而不适用于商业项目。因此,<ruby>自由软件基金会<rt>Free Software Foundation</rt></ruby>FSF认为 QPL 与 <ruby>GNU 通用公共许可证<rt>GNU General Public License</rt></ruby>GNU GPL[不兼容][10]。在 Trolltech 在 2000 年根据 GNU GPL v2 重新发布 Qt 库之前,这个许可证问题一直存在。
### 随着时间的发展
Linux 桌面继续成熟。KDE 和 GNOME 进行了一场友好的竞争,不仅增加了新功能,还互相交流了思想和观念。到 2004 年GNOME 和 KDE 都取得了长足的进步,但用户界面只是在原有基础上添加了一些变化。
KDE 2 和 3 继续依赖屏幕底部的任务栏概念但并入了用于运行应用程序的按钮。KDE 最明显的变化之一是添加了 Konqueror 浏览器,该浏览器首次出现在 KDE 2 中。
![KDE 2.2.2 \(2001\) showing the Konqueror browser][11]
*KDE 2.2.22001显示了 Konqueror 浏览器。图片来源Paul Brown / KDE*
![KDE 3.2.2][12]
*Fedora Core 2 上的 KDE 3.2.22004显示了 Konqueror 文件管理器(使用 Fedora Core 2 主题)*
GNOME 2 还使用了任务栏概念但将其分为两个部分位于屏幕顶部的任务栏以启动应用程序并响应桌面警报以及位于页面底部的任务栏以显示正在运行的应用程序。我自己将这两个任务栏称之为“你可以做的事情”顶部和“你正在做的事情”底部。除了精简的用户界面外GNOME 还添加了由 Eazel 开发的名为 Nautilus 的更新文件管理器。
![GNOME 2.6.0][13]
*Fedora Core 2 上的 GNOME 2.6.02004显示了 Nautilus 文件管理器(使用 Fedora Core 2 主题)*
随着时间的流逝KDE 和 GNOME 走了不同的路径。两者都提供了功能丰富、健壮且现代化的桌面环境但是却具有不同的用户界面目标。2011 年GNOME 和 KDE 处理桌面界面的方式之间存在重大偏差。KDE 4.62011 年 1 月)和 KDE 4.72011 年 7 月)提供了更传统的桌面感受,同时继续根植于许多用户熟悉的任务栏概念。当然,可以看到 KDE 发生很多变化,但是它仍然保留了熟悉的外观。
![KDE 4.6][14]
*KDE 4.6,显示 Gwenview 图像查看器。图片来源KDE*
2011 年GNOME 通过新的桌面概念彻底改变了走向。GNOME 3 旨在创建一个更简单、更精简的桌面体验,使用户可以专注于自己的工作。任务栏消失了,取而代之的是屏幕顶部的黑色状态栏,其中包括音量和网络控件,显示了时间和电池状态,并允许用户通过重新设计过的菜单启动新程序。
菜单的变化最具最戏剧性。单击“活动”菜单或将鼠标移到“活动”的“热角”,会将所有打开的应用程序显示为单独的窗口。用户还可以从概述中单击“应用程序”选项卡以启动新程序。“概述”还提供了内部集成的搜索功能。
![GNOME 3.0][15]
*GNOME 3.0,显示 GNOME 图片应用程序。图片来源GNOME*
![GNOME 3.0][16]
*GNOME 3.0显示活动概述。图片来源GNOME*
### 你的桌面之选
拥有两个 Linux 桌面意味着用户有很多选择。有些人喜欢 KDE而另一些人喜欢 GNOME。没关系选择最适合你的桌面就行。
可以肯定的是KDE 和 GNOME 都有拥护者和批评者。例如GNOME 放弃任务栏以支持“活动概述”而受到了很多批评。也许最著名的批评家是 Linus Torvalds他在 2011 年[大声斥责并抛弃了][17]新的 GNOME将其视为“邪恶的烂摊子”然后在两年后[回到了][18] GNOME。
其他人也对 GNOME 3 提出了类似的批评,以至于一些开发人员复刻 GNOME 2 的源代码来创建 MATE 桌面。MATE<ruby>MATE 高级传统环境<rt>MATE Advanced Traditional Environment</rt></ruby>的递归缩写)延续了 GNOME 2 的传统任务栏界面。
无论如何,毫无疑问当今两个最受欢迎的 Linux 桌面是 KDE 和 GNOME。它们的当前版本非常成熟并且具有很多功能。 KDE 5.162019和 GNOME 3.322019都试图简化和精简 Linux 桌面体验但是方式有所不同。GNOME 3.32 继续致力于极简外观,删除所有分散用户注意力的用户界面元素,以便用户可以专注于其应用程序和工作。 KDE 5.16 在任务栏上采用了更为熟悉的方法,但是增加了其他视觉上的改进和特质,尤其是围绕改进的小部件处理和图标。
![KDE 5.16 Plasma][19]
*KDE 5.16 Plasma。图片来源KDE*
![GNOME 3.32][20]
*GNOME 3.32。图片来源GNOME*
同时,你也不会完全失去它们之间的兼容性。每个主要的 Linux 发行版都提供兼容性库,因此你可以在运行 GNOME 时从 KDE 运行应用程序。在当你实际要使用的应用程序是为其他桌面环境编写的时候,这非常有用。 你可以在 GNOME 上运行 KDE 应用程序,反之亦然。
我认为这种态势不会很快改变这是一件好事。KDE 和 GNOME 之间的良性竞争使这两个阵营的开发人员都可以避免故步自封。无论你使用 KDE 还是 GNOME你都将拥有一个集成度很高的现代化桌面。最重要的是这意味着 Linux 拥有自由软件的最佳特性:选择。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/8/how-linux-desktop-grown
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hallhttps://opensource.com/users/jason-bakerhttps://opensource.com/users/jlacroixhttps://opensource.com/users/doni08521059https://opensource.com/users/etc-eterahttps://opensource.com/users/marcobravohttps://opensource.com/users/alanfdoss
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer)
[2]: https://opensource.com/sites/default/files/uploads/twm-sls105.png (TWM on SLS 1.05)
[3]: https://opensource.com/sites/default/files/uploads/olvwm-sls105.png (OLVWM on SLS 1.05)
[4]: https://opensource.com/sites/default/files/uploads/fvwm-sls105.png (FVWM on SLS 1.05)
[5]: https://opensource.com/sites/default/files/uploads/win311.png (Windows 3.11)
[6]: https://opensource.com/sites/default/files/uploads/win95.png (Windows 95)
[7]: https://opensource.com/sites/default/files/uploads/fvwm95-rh52.png (FVWM95 on Red Hat Linux 5.2)
[8]: https://opensource.com/sites/default/files/uploads/kde1.png (KDE 1.0)
[9]: https://opensource.com/sites/default/files/uploads/gnome10.png (GNOME 1.0)
[10]: https://www.linuxtoday.com/developer/2000090500121OPLFKE
[11]: https://opensource.com/sites/default/files/uploads/kde_2.2.2.png (KDE 2.2.2 (2001) showing the Konqueror browser)
[12]: https://opensource.com/sites/default/files/uploads/kde322-fc2.png (KDE 3.2.2)
[13]: https://opensource.com/sites/default/files/uploads/gnome26-fc2.png (GNOME 2.6.0)
[14]: https://opensource.com/sites/default/files/uploads/kde46.png (KDE 4.6)
[15]: https://opensource.com/sites/default/files/uploads/gnome30.png (GNOME 3.0)
[16]: https://opensource.com/sites/default/files/uploads/gnome30-overview.png (GNOME 3.0)
[17]: https://www.theregister.co.uk/2011/08/05/linus_slams_gnome_three/
[18]: https://www.phoronix.com/scan.php?page=news_item&px=MTMxNjc
[19]: https://opensource.com/sites/default/files/uploads/kde516.png (KDE 5.16 Plasma)
[20]: https://opensource.com/sites/default/files/uploads/gnome332.png (GNOME 3.32)

View File

@ -1,127 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is GraphQL?)
[#]: via: (https://opensource.com/article/19/6/what-is-graphql)
[#]: author: (Zach Lendon https://opensource.com/users/zachlendon)
什么是 GraphQL
======
GraphQL 是一种查询语言、执行引擎和规范,它让开发人员重新思考如何构建客户端和 API
应用。
![Analytics: Charts and Graphs][1]
GraphQL 是当今软件技术中最大的流行语之一。但它_实际上_是什么它是像 [SQL][2] 这样的查询语言吗?像 [JVM][3] 这样的执行引擎?像 [XML][4] 这样的规范?
如果你的回答是上面这些,那么你是对的![GraphQL][5] 是查询语言语法、编程语言无关的执行引擎和不断发展的规范。
让我们深入了解 GraphQL 如何成为这些,并了解人们为什么对此感到兴奋。
### 查询语言
GraphQL 作为查询语言似乎是合理的—”QL“ 似乎足够重要,毕竟它出现在名称中。但是我们在查询什么?查看示例查询请求和相应的响应可能会有所帮助。
以下的用户查询:
```
{
 user(id: 4) {
   name
   email
   phoneNumber
 }
}
```
可能会返回下面的 JSON 结果:
```
{
 "user": {
   "name": "Zach Lendon"
   “email”: “[zach@hydrate.io][6]”
   “phoneNumber”: “867-5309”
 }
}
```
想象一下客户端应用查询用户详细信息获取结果并使用它填充配置文件。作为查询语言GraphQL 的核心优势之一是客户端应用可以_只请求它需要_的数据并期望以一致的方式返回这些数据。
那么_什么_返回了 GraphQL 响应?这就是执行引擎(通常以 GraphQL 服务器的形式)发挥作用的地方。
### 执行引擎
![GraphQL execution engine][7]
GraphQL 执行引擎负责处理 GraphQL 查询并返回 JSON 响应。所有 GraphQL 服务器由两个核心组件组成分别定义了执行引擎的结构和行为schema 和解析器。
GraphQL schema 是一种自定义类型语言,它公开哪些查询既允许(有效),又由 GraphQL 服务器实现处理。上面用户示例查询的 schema 可能如下所示:
```
type User {
        name: String
        email: String
        phoneNumber: String
}
type Query {
        user: User
}
```
此 schema 定义返回用户的用户查询。客户端可以通过用户查询请求用户上的任何字段,并且 GraphQL 服务器将仅返回请求的字段。通过使用强类型架构GraphQL 服务器可以验证传入查询,以确保它们基于定义的 schema 有效。
确定查询有效后,它由 GraphQL 服务器的解析器处理。解析器函数支持每个 GraphQL 类型的每个字段。用户查询的示例解析器可能如下所示:
```
Query: {
  user(obj, args, context, info) {
    return context.db.loadUserById(args.id).then(
      userData =&gt; new User(userData)
    )
  }
}
```
虽然上面的例子是 JavaScript但 GraphQL 服务器可以用任意语言编写。这是因为 GraphQL 也是_也是_一种规范
### 规范
GraphQL 规范定义了 GraphQL 实现必须遵循的功能和特性。作为开放网络基金会最终规范协议([OWFa 1.0][8])所提供的开放规范,技术社区可以借此机会查看 GraphQL 实现必须符合规范的要求,并帮助制定 GraphQL 的未来。
虽然该规范对 GraphQL 的语法,什么是有效查询以及 schema 进行了非常具体的说明,但它没有提供有关如何存储数据或 GraphQL 服务器应使用哪种编程语言实现的指导。这在软件领域是非常强大且相对独特。它允许以多种编程语言创建 GraphQL 服务器并且由于它们符合规范因此客户端将确切知道它们的工作方式。GraphQL 服务器已经有多种语言实现,人们不仅可以期望像 JavaScript、Java和 C# 这样的语言还可以使用Go、Elixir 和 Haskell 等。服务器实现所使用的语言不会成为采用过程的障碍。它不仅存在多种语言实现,而且它们都是开源的。如果没有你选择的语言的实现,那么可以自己实现。
### 总结
GraphQL 是开源 API 领域中一个令人兴奋的,相对较新的参与者。它将查询语言和执行引擎与开源规范结合在一起,它定义了 GraphQL 实现的功能。
GraphQL 已经开始改变公司对构建客户端和 API 应用的看法。通过将 GraphQL 作为技术栈的一部分,前端开发人员可以自由查询所需的数据,而后端开发人员可以将客户端应用需求与后端系统架构分离。通常,公司首先通过在其现有后端服务之上构建一个 GraphQL API “层”来使用 GraphQL。这使客户端应用开始获得寻求的性能和运营效率同时使后端团队有机会在 GraphQL 层后面进行所需的“幕后”更改(如果有)。通常,这些更改将针对优化,这些优化将帮助确保使用 GraphQL 的应用可以尽可能高效地运行。由于 GraphQL 提供了抽象,因此系统团队可以进行更改的同时继续在其 GraphQL API 级别上遵守 GraphQL 的“合约”。
由于 GraphQL 相对较新因此开发人员仍在寻找新颖而激动人心的方法来利用它构建更好的软件解决方案。GraphQL 将如何改变你构建应用的方式,它不会辜负宣传吗?只有一种方法可以找到答案。去使用 GraphQL 构建一些东西!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/6/what-is-graphql
作者:[Zach Lendon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/zachlendon
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs)
[2]: https://opensource.com/article/18/2/getting-started-sql
[3]: https://www.cubrid.org/blog/understanding-jvm-internals/
[4]: https://www.w3.org/TR/xml/
[5]: http://graphql.org/
[6]: mailto:zach@hydrate.io
[7]: https://opensource.com/sites/default/files/pictures/graphql-execution-engine.png (GraphQL execution engine)
[8]: http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0---patent-only

View File

@ -1,91 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why use GraphQL?)
[#]: via: (https://opensource.com/article/19/6/why-use-graphql)
[#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley)
为什么使用 GraphQL?
======
> 这就是 GraphQL 在标准 REST API 技术上获得发展的原因。
[][1]
正如我[以前][3]所写,[GraphQL][2] 是下一代 API 技术,它正在改变客户端应用程序与后端系统的通信方式以及后端系统的设计方式。
由于一开始就从创建它的组织 Facebook 获得了支持,并得到了其他技术巨头(如 Github、Twitter 和 AirBnB的支持因此 GraphQL 作为应用程序系统的关键技术的地位似乎是可靠的 —— 无论现在还是将来。
### GraphQL 在崛起
移动应用程序性能和组织敏捷性重要性的提高为 GraphQL 登上现代企业体系结构的顶端提供了助推器。
鉴于 [REST][4] 是一种非常流行的体系结构风格,早已提供了数据交互机制,与 [REST][4] 相比GraphQL 这项新技术具有哪些优势GraphQL 中的 “QL” 代表查询语言,而这是一个很好的起点。
借助 GraphQL组织内的不同客户端应用程序可以轻松地仅查询所需数据从而取代了其他 REST 方法,并提高了实际应用程序的性能。 使用传统的 [REST][4] API 端点,客户端应用程序将详询服务器资源,并接收包含了与请求匹配的所有数据的响应。如果来自 [REST][4] API 端点的成功响应返回 35 个字段,那么客户端应用程序就会接收 35 个字段。
### 提取的问题
传统上,[REST][4] API 无法为客户端应用程序提供简便的方法来仅检索或更新它们关心的数据。这通常被描述为“<ruby>过度获取<rt>over-fetching</rt></ruby>”的问题。随着移动应用程序在人们的日常生活中的普遍使用,过度获取问题会给现实世界带来不良后果。移动应用程序需要发出的每个请求都必须发送和接收的每个字节,对最终用户的性能造成的负面影响越来越大。数据连接速度较慢的用户尤其会受到不太好的 API 设计方案的影响。在性能体验不佳时,使用移动应用程序的客户更有可能不购买产品或不使用服务。低效的 API 设计只会浪费公司的钱。
并非只有“过度获取”是问题,“欠缺获取”同样也是问题。默认情况下,仅返回客户端实际需要的部分数据的端点或许会要求客户端进行其他调用以满足其数据需求,这就需要其他的 HTTP 请求。由于过度和欠缺的获取问题及其对客户端应用程序性能的影响,促进有效获取的 API 技术才有机会在市场上引起轰动 —— GraphQL 大胆地介入并填补了这一空白。
### REST 的应对
[REST][4] API 设计师不战而退,他们尝试通过以下几种方式来应对移动应用程序性能问题:
* “include” 和 “exclude” 查询参数,允许客户端应用程序通过可能较长的查询格式来指定所需的字段。
* “复合”服务,组合了多个端点,以使客户端应用程序在其发出的请求数量和接收到的数据方面更高效。
  
尽管这些模式是 [REST][4] API 社区为解决移动客户端所面临的挑战而做出的英勇尝试,但它们在以下几个关键方面仍存在不足:
* 包含和排除查询的键/值对很快变得混乱,特别是对于需要嵌套“点表示法”语法(或类似方法)以包含和排除更深的目标数据的对象图而言。此外,在此模型中调试查询字符串的问题通常需要手动分解 URL。
* 包含和排除查询的服务器实现通常是自定义的,因为基于服务器的应用程序没有标准的方式来处理包含和排除查询的使用,就像没有定义包含和排除查询的标准方式一样。
* 复合服务的兴起创建了更加紧密耦合的后端和前端系统,需要加强协调以交付项目,并且一旦将敏捷项目转回瀑布式。这种协调和耦合顺便还能稍减组织敏捷性的痛苦。此外,根据定义,组合服务不是 RESTful。
  
### GraphQL 的起源
对于 Facebook 来说,从其 2011-2012 年基于 HTML5 版本的旗舰移动应用程序中感受到的痛点和体验,才造就了 GraphQL。Facebook 工程师意识到提高性能至关重要,因此意识到他们需要一种新的 API 设计来确保最佳性能。可能考虑到以上 [REST][4] 的局限性,并且需要支持许多 API 客户端的不同需求,因此人们开始去了解其共同创建者 Lee Byron 和 Dan Schaeffer那时尚是 Facebook 员工)撒播下的早期种子,创建了后来被称之为 GraphQL 的技术。
通过 GraphQL 查询语言,客户端(通常是单个 GraphQL 端点)应用程序通常可以显著减少所需的网络调用数量,并确保仅检索所需的数据。在许多方面,这可以追溯到早期的 Web 编程模型,在该模型中,客户端应用程序代码将直接查询后端系统,有些人可能还记得 10 到 15 年前在 JSP 上用 JSTL 编写 SQL 查询吧!
现在最大的区别是使用 GraphQL我们有了一个跨多种客户端和服务器语言和库实现的规范。借助 GraphQL 这样一种 API 技术,我们通过引入 GraphQL 应用程序中间层来分离后端和前端应用程序系统,该层提供了一种以与组织的业务领域相一致的方式来访问组织数据的机制。
除了解决软件工程团队遇到的技术挑战之外GraphQL 还促进了组织敏捷性的提高,特别是在企业中。启用 GraphQL 的组织敏捷性通常归因于以下因素:
* GraphQL API 设计人员和开发人员无需在客户端需要一个或多个新字段时创建新的端点,而是能够将这些字段包含在现有的图形实现中,从而以较少的开发工作量和跨应用程序系统的较少更改的方式公开新功能。
* 通过鼓励 API 设计团队将更多的精力放在定义对象图上,而不是在专注于客户端应用程序交付上,前端和后端软件团队为客户交付解决方案的速度日益解耦。
  
### 采纳之前的注意事项
尽管 GraphQL 具有引人注目的优势,但 GraphQL 并非没有实施挑战。一些例子包括:
* 为 [REST][4] API 建立的缓存机制更加成熟。
* 用于使用 [REST][4] 来构建 API 的模式已经非常完善。
* 尽管工程师可能更喜欢 GraphQL 等新技术,但与 GraphQL 相比,市场上的人才库更多是从事于构建基于 [REST][4] 的解决方案。
### 结论
通过同时提高性能和组织敏捷性GraphQL 在公司中的采纳在过去几年中猛增。但是,与 RESTful API 设计生态系统相比,它确实还需要更成熟一些。
GraphQL 的一大优点是,它并不是作为替代 API 解决方案的批发替代品而设计的。相反,可以实现 GraphQL 来补充或增强现有的 API。因此鼓励公司探索逐步采用 GraphQL 的方法,这对他们来说最有意义,他们发现它对应用程序性能和组织敏捷性具有最大的积极影响。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/6/why-use-graphql
作者:[Zach Lendon][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D
[2]: https://graphql.org/
[3]: https://opensource.com/article/19/6/what-is-graphql
[4]: https://en.wikipedia.org/wiki/Representational_state_transfer

View File

@ -0,0 +1,164 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Use the Fluxbox Linux desktop as your window manager)
[#]: via: (https://opensource.com/article/19/12/fluxbox-linux-desktop)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
使用 Fluxbox Linux desktop 作为你的窗口管理器
======
这篇文章是Linux 桌面24天的特别系列的一部分。
Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的 Linux
桌面特色来使你的用户体验轻松快速高效。
![在蓝色区域中是,在浏览器上的文本编辑器][1]
桌面的概念可谓是仁者见仁智者见智。很多人把桌面看作一个家基地或者一个舒适的客厅甚至是一个字面意义上的桌面在其中放置着他们经常使用的记事本最好的笔和铅笔还有他们最喜欢的咖啡杯。KDE, GNOME, Pantheon (等等)在 Linux 上提供了这种舒适的生活方式。
但是对一些用户来说,桌面只是一个空荡荡的监控控件,将还没有自由浮动的应用程序窗口直接投射到显示器上的一个侧面效果。对于这些用户来说,桌面是真空的,在其中他们可以运行应用程序—不管的大型办公软件和图形套件,还是一个简单的终端窗口,或是来管理服务的停靠小程序。这种操作一台 [POSIX][2] 计算机的模式有很长的历史,该家族树的一支是 *box 窗口管理器Blackbox, Fluxbox 和 Openbox 。
[Fluxbox][3] 是一个针对 X11 系统的窗口管理器,它基于一个较老的名为 Blackbox 的项目。当我发现 Linux 时Blackbox 的开发已进入衰退期,因此我进入 Fluxbox ,此后我至少在一个以上的活跃的系统上使用它。它使用 C++ 编写,并在 MIT 开源许可证下授权。
### 安装 Fluxbox
你很可能会在你的 Linux 发行版的存储库中找到 Fluxbox ,但是你也可以在 [Fluxbox.org][4] 上找到它。如果你正在运行一个不同的桌面,在同一个系统上安装 Fluxbox 是安全的,因为 Fluxbox 不预先决定任何配置或附带应用程序。
在安装 Fluxbox 后,注销你当前的桌面会话,以便你可以登录一个新的桌面会话。默认情况下,你的桌面会话管理器 (KDM, GDM, LightDM 或 XDM取决于你的安装设置) 将你继续登录到上一个在桌面,所以你在登录前必需要覆盖上一个桌面。
使用 GDM 覆盖一个桌面:
![在 GDM 中选择你的桌面会话][5]
或者使用 KDM:
![使用 KDM 选择你的桌面会话][6]
### 配置 Fluxbox 桌面
当你第一次登录到桌面时,屏幕大部分是空的,因为 Fluxbox 提供的所有东西是面板(用于任务栏,系统托盘等等)和用于应用程序窗口的窗口装饰品。
![在 CentOS 7 上的默认 Fluxbox 配置][7]
如果你的发行版提供一个简单的 Fluxbox 桌面,你可以使用 **feh** 命令 (你可能需要从你的发行版存储库中来安装它) 来为你的桌面设置背景。这个命令有一些用于设置背景的选项,包括使用你选择的墙纸来填充屏幕的 **\--bg-fill** ,来按比例缩放的 **\--bg-scale** 等等选项。
```
`$ feh --bg-fill ~/photo/oamaru/leaf-spiral.jpg`
```
![应用主题的 Fluxbox ][8]
默认情况下Fluxbox 自动生成一个菜单,在桌面上任意位置右键单击可用该菜单,这给予你访问应用程序的能力。取决于你的发行版,这个菜单可能非常小,也可能列出 **/usr/share/applications** 目录中的所有启动程序。
Fluxbox 配置是在文本文件中设置的,这些文本文件包含在 **$HOME/.fluxbox** 目录中。你可以:
* 在 **keys** 中设置键盘快捷键
* 在 **startup** 中启动服务和应用程序
* 在 **init** 设置桌面首选项(例如工作区数量、面板位置等等)
* 在 **menu** 中设置菜单项
该文本配置文件非常易于逆向工程,但是你也可以 (并且是应该) 阅读 Fluxbox [文档][9] 。
例如,这是我的典型菜单 (或者说至少有它的基本结构)
```
# 为使用你自己的菜单,复制这些文本到 ~/.fluxbox/menu然后编辑
# ~/.fluxbox/init ,并更改 session.menuFile 文件到 ~/.fluxbox/menu
[begin] (fluxkbox)
[submenu] (apps) {}
[submenu] (txt) {}
[exec] (Emacs 23 (text\)) { x-terminal-emulator -T "Emacs (text)" -e /usr/bin/emacs -nw} <>
[exec] (Emacs (X11\)) {/usr/bin/emacs} <>
[exec] (LibreOffice) {/usr/bin/libreoffice}
[end]
[submenu] (code) {}
[exec] (qtCreator) {/usr/bin/qtcreator}
[exec] (eclipse) {/usr/bin/eclipse}
[end]
[submenu] (graphics) {}
[exec] (ksnapshot) {/usr/bin/ksnapshot}
[exec] (gimp) {/usr/bin/gimp}
[exec] (blender) {/usr/bin/blender}
[end]
[submenu] (files) {}
[exec] (dolphin) {/usr/bin/dolphin}
[exec] (konqueror) { /usr/bin/kfmclient openURL $HOME }
[end]
[submenu] (network) {}
[exec] (firefox) {/usr/bin/firefox}
[exec] (konqueror) {/usr/bin/konqueror}
[end]
[end]
## 更改窗口管理器或工作环境
[submenu] (environments) {}
[restart] (flux) {/usr/bin/startfluxbox}
[restart] (ratpoison) {/usr/bin/ratpoison}
[exec] (openIndiana) {/home/kenlon/qemu/startSolaris.sh}
[end]
[config] (config)
[submenu] (styles) {}
[stylesdir] (/usr/share/fluxbox/styles)
[stylesdir] (~/.fluxbox/styles)
[end]
[workspaces] (workspaces)
[reconfig] (reconfigure)
[restart] (restart)
[exit] (exeunt)
[end]
```
该菜单也提供一些首选项设置,例如,选择一个主题和从 Fluxbox 会话中重启或注销的能力。
我使用键盘快捷键来启动大多数的应用程序,这些快捷键写入到 **keys** 配置文件中。这里有一些示例 ( **Mod4** 按键是超级按键,我使用其来指定全局快捷键)
```
# 打开应用程序
Mod4 t :Exec konsole
Mod4 k :Exec konqueror
Mod4 z :Exec fbrun
Mod4 e :Exec emacs
Mod4 f :Exec firefox
Mod4 x :Exec urxvt
Mod4 d :Exec dolphin
Mod4 q :Exec xscreensaver-command -activate
Mod4 3 :Exec ksnapshot
```
在这些快捷方式和一个打开的终端之间,在我工作日的大部分时间内很少使用鼠标,因此从一个控制器切换到另一个控制器不会浪费时间。并且因为 Fluxbox 很好地避开了控制器之间切换的方法,因此在其中操作没有一丝干扰。
### 为什么你应该使用 Fluxbox
Fluxbox 对系统资源的占用非常轻量,但是它拥有重要的功能来使你的用户体验轻松快速高效。它很容易定制,并且它允许你定义你自己的工作流。你不必使用 Fluxbox 的面板,因为在这里有其它的极好的面板。你甚至可以鼠标双击和拖动两个独立的应用程序窗口到彼此之中,以便它们成为一个窗口,每个窗口都有自己的选项卡。
无穷的可能性,所以今天就在你的 Linux 上尝试一下 Fluxbox 的简单稳定吧!
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/fluxbox-linux-desktop
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
[3]: http://fluxbox.org
[4]: http://fluxbox.org/download/
[5]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM)
[6]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM)
[7]: https://opensource.com/sites/default/files/advent-fluxbox-default.jpg (Default Fluxbox configuration on CentOS 7)
[8]: https://opensource.com/sites/default/files/advent-fluxbox-green.jpg (Fluxbox with a theme applied)
[9]: http://fluxbox.org/features/

View File

@ -0,0 +1,134 @@
[#]: collector: (lujun9972)
[#]: translator: (HankChow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Upgrade to Ubuntu 20.04 Beta from 18.04 & 19.10)
[#]: via: (https://itsfoss.com/upgrade-ubuntu-beta/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
如何将 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04 beta
======
[Ubuntu 20.04 LTS 版本][1]还有不到一个月就发布了Ubuntu 在这一个版本中对视觉效果作出了大变动,同时在性能方面也有所提高。
如果你还在使用 Ubuntu 18.04 LTS 版本,你会发现 Ubuntu 20.04 配合深色 Yaru 主题非常惊艳,看过 [Ubuntu 20.04 的展示视频][2]你就知道了。
[订阅我们的 YouTube 频道观看更多 Linux 视频][3]
感觉确实不错。如果你想在 4 月 23 日最终稳定版正式发布前率先使用 Ubuntu 20.04,也可以在官方网站上下载 beta 版本。尽管如此,它的稳定性并不差,同时你也可以在使用这个版本的过程中帮助 Ubuntu 团队进行测试。
你可以下载<ruby>每日构建<rt>daily build</rt></ruby>版并进行重新安装,如果你正在使用的是 Ubuntu 18.04 或 Ubuntu 19.10,也可以在现有系统的基础上直接升级到 Ubuntu 20.04 beta 版本。
如果你需要确认正在使用的 Ubuntu 版本,可以参考[这篇文章][4]。
在本文中,我将会介绍如何升级到 Ubuntu 20.04 beta 版本。
### 如何将 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04 beta
![Upgrade Ubuntu 20 04 Beta][5]
在你阅读后面的内容之前,我首先说明一些关于升级到 Ubuntu beta 版本的常见问题。
* 版本升级的过程并不复杂,但在整个过程中需要有良好的网络连接,以便下载高达好几 GB 的数据。
* 版本升级的过程中,第三方存储库(比如你自行添加的 [PPA][6])会被禁用,有些 PPA 可能也和新版本不兼容,在版本升级完毕后,你可以手动启用 PPA。
* 强烈建议将重要数据备份到外部的 USB 硬盘上。你只需要将各个目录下的重要文件直接复制到外部 USB 硬盘上保存即可。
* 升级到新版本之后,就无法再回滚到之前的旧版本了,只能重新安装旧版本系统。
* 如果你选择升级到 Ubuntu 20.04 beta 版本,那么在 Ubuntu 20.04 最终稳定版发布之后,你也不需要重新安装。只需要保持定期更新 Ubuntu 系统,届时你就可以直接用上最终稳定版了。
* Ubuntu 16.04/17/18/19.04 都无法直接升级到 Ubuntu 20.04。
了解完上面的内容之后,下面开始从 Ubuntu 18.04/19.10 升级到 Ubuntu 20.04。
#### 步骤 1检查设置是否正确
进入“<ruby>软件和升级<rt>Software & Updates</rt></ruby>”应用:
![Software & Updates application in Ubuntu][7]
在“<ruby>升级<rt>Updates</rt></ruby>”选项卡中,设置“有任何新版本 Ubuntu 都提醒我”或“有 LTS 版本 Ubuntu 就提醒我”:
![Ubuntu Upgrade Version Settings][8]
设置完成后,系统会刷新软件库缓存。
#### 步骤 2安装系统更新
在上面的步骤完成之后,打开终端(在 Ubuntu 中可以使用 `Ctrl+Alt+T` [快捷键][9]),然后使用以下命令[更新 Ubuntu 系统][10]
```
sudo apt update && sudo apt full-upgrade
```
`apt full-upgrade``apt dist-upgrade` 的功能和 `apt upgrade` 大致相同,但对于系统版本的升级,`apt full-upgrade` 会在需要的情况下将当前已安装的软件移除掉。
更新安装完成后,系统可能会需要重新启动。在重新启动之后,就可以进入步骤 3 了。
#### 步骤 3使用更新管理器查找开发版本
在步骤 2 中已经安装了所有必要的更新,现在通过下面的命令打开更新管理器,其中 `-d` 参数表示需要查找开发版本:
```
update-manager -d
```
整个过程可能需要好几分钟,随后会提示有新版本的 Ubuntu 可用:
![Availability of Ubuntu 20.04 in Ubuntu 19.10][11]
在 Ubuntu 18.04 上的提示是这样的:
![Availability of Ubuntu 20.04 in Ubuntu 18.04][12]
然后点击对话框中的“<ruby>升级<rt>upgrade</rt></ruby>”按钮。
#### 步骤 4开始升级到 Ubuntu 20.04 beta
接下来只要等待下载更新就可以了,遇到对话框直接点击 OK 即可。
![][13]
点击“<ruby>升级<rt>upgrade</rt></ruby>”按钮,然后按照提示进行操作。
![][14]
在升级过程中,可能会有提示信息告知所有第三方源都已经禁用。有时候还会提示有哪些软件包需要升级或删除,以及是否需要保留一些已经过时了的软件包。一般情况下,我会选择直接删除。
整个升级过程通常会需要几个小时,但主要还是取决于实际的网速。升级完成后,系统会提示需要重新启动。
![][15]
下面的视频展示了所有相关步骤。
由此可见,这个升级流程并不复杂。欢迎体验 Ubuntu 20.04 带来的新特性。
如果你有疑问或建议,欢迎在评论区留言。
--------------------------------------------------------------------------------
via: https://itsfoss.com/upgrade-ubuntu-beta/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[HankChow](https://github.com/HankChow)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
[2]: https://www.youtube.com/watch?v=9u5B0njRgOw
[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[4]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-beta.jpg?ssl=1
[6]: https://itsfoss.com/ppa-guide/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/software-updates-app-ubuntu.jpg?ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/ubuntu-upgrade-version-settings.jpg?ssl=1
[9]: https://itsfoss.com/ubuntu-shortcuts/
[10]: https://itsfoss.com/update-ubuntu/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-from-18-04.jpg?ssl=1
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-1.jpg?ssl=1
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04-steps-2.jpg?ssl=1
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/restart-to-finish-beta-upgarde-ubuntu-20-04.jpg?ssl=1