mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject into dev
This commit is contained in:
commit
ca945ff9bb
@ -0,0 +1,83 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12371-1.html)
|
||||
[#]: subject: (How Cloud-init can be used for your Raspberry Pi homelab)
|
||||
[#]: via: (https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab)
|
||||
[#]: author: (Chris Collins https://opensource.com/users/clcollins)
|
||||
|
||||
在你的树莓派家庭实验室中使用 Cloud-init
|
||||
======
|
||||
|
||||
> 了解了云行业的标准,该向你的家庭实验室自动添加新设备和用户了。
|
||||
|
||||

|
||||
|
||||
[Cloud-init][2](可以说)是一个标准,云提供商用它来为云实例提供初始化和配置数据。它最常用于新实例的首次启动,以自动完成网络设置、账户创建和 SSH 密钥安装等使新系统上线所需的任何事情,以便用户可以访问它。
|
||||
|
||||
在之前的一篇文章《[修改磁盘镜像来创建基于树莓派的家庭实验室][3]》中,我展示了如何为像树莓派这样的单板计算机定制操作系统镜像以实现类似的目标。有了 Cloud-init,就不需要向镜像中添加自定义数据。一旦在镜像中启用了它,你的虚拟机、物理服务器,甚至是小小的树莓派都可以表现得像你自己的 “家庭私有云” 中的云计算实例。新机器只需插入、打开,就可以自动成为你的[家庭实验室][4]的一部分。
|
||||
|
||||
说实话,Cloud-init 的设计并没有考虑到家庭实验室。正如我所提到的,你可以很容易地修改给定的一套系统磁盘镜像,以启用 SSH 访问并在第一次启动后对它们进行配置。Cloud-init 是为大规模的云提供商设计的,这些提供商需要容纳许多客户,维护一组小的镜像,并为这些客户提供访问实例的机制,而无需为每个客户定制一个镜像。拥有单个管理员的家庭实验室则不会面临同样的挑战。
|
||||
|
||||
不过,Cloud-init 在家庭实验室中也不是没有可取之处。教育是我的家庭私有云项目的目标之一,而为你的家庭实验室设置 Cloud-init 是一个很好的方式,可以获得大大小小的云提供商大量使用的技术的经验。Cloud-init 也是其他初始配置选项的替代方案之一。与其为家庭实验室中的每台设备定制每个镜像、ISO 等,并在你要进行更改时面临繁琐的更新,不如直接启用 Cloud-init。这减少了技术债务 —— 还有什么比*个人*技术债务更糟糕的吗?最后,在你的家庭实验室中使用 Cloud-init 可以让你的私有云实例与你拥有的或将来可能拥有的任何公有云实例表现相同 —— 这是真正的[混合云][5]。
|
||||
|
||||
### 关于 Cloud-init
|
||||
|
||||
当为 Cloud-init 配置的实例启动并且服务开始运行时(实际上是 systemd 中的四个服务,以处理启动过程中的依赖关系),它会检查其配置中的[数据源][6],以确定其运行在什么类型的云中。每个主要的云提供商都有一个数据源配置,告诉实例在哪里以及如何检索配置信息。然后,实例使用数据源信息检索云提供商提供的配置信息(如网络信息和实例识别信息)和客户提供的配置数据(如要复制的授权密钥、要创建的用户账户以及许多其他可能的任务)。
|
||||
|
||||
检索数据后,Cloud-init 再对实例进行配置:设置网络、复制授权密钥等,最后完成启动过程。然后,远程用户就可以访问它,准备好使用 [Ansible][7] 或 [Puppet][8] 等工具进行进一步的配置,或者准备好接收工作负载并开始分配任务。
|
||||
|
||||
### 配置数据
|
||||
|
||||
如上所述,Cloud-init 使用的配置数据来自两个潜在来源:云提供商和实例用户。在家庭实验室中,你扮演着这两种角色:作为云提供商提供网络和实例信息,作为用户提供配置信息。
|
||||
|
||||
#### 云提供商元数据文件
|
||||
|
||||
在你的云提供商角色中,你的家庭实验室数据源将为你的私有云实例提供一个元数据文件。这个[元数据][9]文件包含实例 ID、云类型、Python 版本(Cloud-init 用 Python 编写并使用 Python)或要分配给主机的 SSH 公钥等信息。如果你不使用 DHCP(或 Cloud-init 支持的其他机制,如镜像中的配置文件或内核参数),元数据文件还可能包含网络信息。
|
||||
|
||||
#### 用户提供的用户数据文件
|
||||
|
||||
Cloud-init 的真正价值在于用户数据文件。[用户数据][10]文件由用户提供给云提供商,并包含在数据源中,它将实例从一台普通的机器变成了用户舰队的一员。用户数据文件可以以可执行脚本的形式出现,与正常情况下脚本的工作方式相同;也可以以云服务配置 YAML 文件的形式出现,利用 [Cloud-init 的模块][11] 来执行配置任务。
|
||||
|
||||
### 数据源
|
||||
|
||||
数据源是由云提供商提供的服务,它为实例提供了元数据和用户数据文件。实例镜像或 ISO 被配置为告知实例正在使用什么数据源。
|
||||
|
||||
例如,亚马逊 AWS 提供了一个 [link-local][12] 文件,它将用实例的自定义数据来响应实例的 HTTP 请求。其他云提供商也有自己的机制。幸运的是,对于家庭私有云项目来说,也有 NoCloud 数据源。
|
||||
|
||||
[NoCloud][13] 数据源允许通过内核命令以键值对的形式提供配置信息,或通过挂载的 ISO 文件系统以用户数据和元数据文件的形式提供。这些对于虚拟机来说很有用,尤其是与自动化搭配来创建虚拟机。
|
||||
|
||||
还有一个 NoCloudNet 数据源,它的行为类似于 AWS EC2 数据源,提供一个 IP 地址或 DNS 名称,通过 HTTP 从这里检索用户数据和元数据。这对于你的家庭实验室中的物理机器来说是最有帮助的,比如树莓派、[NUC][14] 或多余的服务器设备。虽然 NoCloud 可以工作,但它需要更多的人工关注 —— 这是云实例的反模式。
|
||||
|
||||
### 家庭实验室的 Cloud-init
|
||||
|
||||
我希望这能让你了解到 Cloud-init 是什么,以及它对你的家庭实验室有何帮助。它是一个令人难以置信的工具,被主要的云提供商所接受,在家里使用它可以是为了教育和乐趣,并帮助你自动向实验室添加新的物理或虚拟服务器。之后的文章将详细介绍如何创建简单的静态和更复杂的动态 Cloud-init 服务,并指导你将它们纳入你的家庭私有云。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab
|
||||
|
||||
作者:[Chris Collins][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/clcollins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation)
|
||||
[2]: https://cloudinit.readthedocs.io/
|
||||
[3]: https://linux.cn/article-12277-1.html
|
||||
[4]: https://opensource.com/article/19/3/home-lab
|
||||
[5]: https://www.redhat.com/en/topics/cloud-computing/what-is-hybrid-cloud
|
||||
[6]: https://cloudinit.readthedocs.io/en/latest/topics/datasources.html
|
||||
[7]: https://www.ansible.com/
|
||||
[8]: https://puppet.com/
|
||||
[9]: https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html#
|
||||
[10]: https://cloudinit.readthedocs.io/en/latest/topics/format.html
|
||||
[11]: https://cloudinit.readthedocs.io/en/latest/topics/modules.html
|
||||
[12]: https://en.wikipedia.org/wiki/Link-local_address
|
||||
[13]: https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
|
||||
[14]: https://en.wikipedia.org/wiki/Next_Unit_of_Computing
|
55
published/202006/20190218 Talk, then code.md
Normal file
55
published/202006/20190218 Talk, then code.md
Normal file
@ -0,0 +1,55 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12319-1.html)
|
||||
[#]: subject: (Talk, then code)
|
||||
[#]: via: (https://dave.cheney.net/2019/02/18/talk-then-code)
|
||||
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
|
||||
|
||||
给开源项目贡献代码时:先讨论,再编码
|
||||
======
|
||||
|
||||
我所参与的开源项目遵循的是一种这样的理念,我把它描述为 “先讨论,再编码”。我认为一般来说这是开发软件的好方法,我想花一点时间来谈谈这种方法的好处。
|
||||
|
||||
### 避免伤害感情
|
||||
|
||||
先讨论你想做的改变最重要的原因是避免伤害感情。我经常看到一个贡献者闭门造车地提交了一个 PR,却发现他的努力工作被拒绝了。这可能有一堆原因:PR 太大了,PR 没有遵循本地风格,PR 修复了一个对项目不重要的问题或者最近间接修复了的问题,等等。
|
||||
|
||||
这些问题的根本原因都是缺乏沟通。“先讨论,再编码” 理念的目标不是阻碍你或给你带来挫折,而是确保一个功能第一次就能正确落地,而不至于产生大量的维护债务。无论是改动的作者,还是审查者,当一个改动突然出现时,并暗示说 “好吧,我已经做完了,你要做的就是合并它,对吧?”,先讨论可以让他们不必背负伤害感情的情绪负担。
|
||||
|
||||
### 讨论应该如何进行?
|
||||
|
||||
每一个新功能或错误修复都应该在工作开始前与项目的维护者讨论。私下试验是可以的,但不要在没有讨论之前就发送修改。
|
||||
|
||||
对于简单的改动,“讨论” 的定义可以只是 GitHub 议题中的一个设计草图。如果你的 PR 修复了一个 bug,你应该链接到它修复的 bug。如果没有,你应该先提出一个 bug,等待维护者确认后再发送 PR。这可能看起来有点落后 —— 谁不希望一个 bug 被修复呢 —— 但考虑到这个 bug 可能是对软件工作方式的误解,也可能是一个更大问题的症状,这需要进一步调查。
|
||||
|
||||
对于比较复杂的改动,尤其是功能请求,我建议在发送代码之前,先分发一份设计文档并达成一致。这不一定是一个完整的文档,发一个议题,带个草图可能就足够了,但关键是在用代码搞定之前,先用文字达成一致。
|
||||
|
||||
在任何情况下,你都不应该继续发送你的代码,直到维护者同意你的方法是他们所满意的。拉取请求是日常生活,而不仅仅是为了赶着过节。
|
||||
|
||||
### 代码审查,而不是由委员会设计
|
||||
|
||||
代码审查不是争论设计的地方。这有两个原因。首先,大多数代码审查工具都不适合长长的评论会话,GitHub 的 PR 界面在这方面非常糟糕,Gerrit 比较好,但很少有管理员团队会维护 Gerrit 实例。更重要的是,在代码审查阶段就出现了分歧,说明大家对如何实现这个变化并没有达成一致。
|
||||
|
||||
* * *
|
||||
|
||||
讨论你想写的代码,然后再写你所讨论的代码。请不要反其道而行之。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://dave.cheney.net/2019/02/18/talk-then-code
|
||||
|
||||
作者:[Dave Cheney][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://dave.cheney.net/author/davecheney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://dave.cheney.net/2013/09/07/how-to-include-c-code-in-your-go-package (How to include C code in your Go package)
|
||||
[2]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging (Let’s talk about logging)
|
||||
[3]: https://dave.cheney.net/2016/04/11/the-value-of-tdd (The value of TDD)
|
||||
[4]: https://dave.cheney.net/2016/03/12/suggestions-for-contributing-to-an-open-source-project (Suggestions for contributing to an Open Source project)
|
195
published/202006/20190814 How to install Python on Windows.md
Normal file
195
published/202006/20190814 How to install Python on Windows.md
Normal file
@ -0,0 +1,195 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (011011100010110101101111)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12335-1.html)
|
||||
[#]: subject: (How to install Python on Windows)
|
||||
[#]: via: (https://opensource.com/article/19/8/how-install-python-windows)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/greg-p)
|
||||
|
||||
如何在 Windows 上安装 Python
|
||||
======
|
||||
|
||||
> 安装 Python,启动 IDE,然后你就可以在 Windows 系统下进行编程了。
|
||||
|
||||

|
||||
|
||||
你是否想学习编程呢?可以从 [Python][2] 开始,它因为简洁的语法和面向对象的特性而非常受欢迎,是最常见的编程语言之一。而且 Python 是一门解释型语言,这意味着你无需知道如何把 Python 代码编译为机器语言 —— Python 会帮你做到这一点,从而使你能够在编写代码的同时立即进行测试。
|
||||
|
||||
但是你也不能仅仅因为 Python 学习起来简单而低估了它强大的潜能,无论是在[电影][4][工作室][5]、视频游戏工作室,还是在金融机构、IT 机构、制造业,都有 Python 的身影,甚至很多业余爱好者、[艺术家][6]、教师和许多其他人都使用 Python。
|
||||
|
||||
另一方面,Python 也是一门严肃的编程语言,学习它需要付出和实践。还有,你什么都不需要马上做,就几乎可以在任何计算机平台上安装并尝试使用 Python ,因此,如果你使用的是 Windows 操作系统,那本文正适合你。
|
||||
|
||||
如果你使用的是开源的 Linux 操作系统,那你可以 [在 Linux 上安装][7] 并 [尝试使用 Python][8]。
|
||||
|
||||
### 如何获取 Python
|
||||
|
||||
你可以从 [Python 官方网站][9] 上去下载 Python。在 Python 官方网站下载页,可以将鼠标悬停在 “Downloads” 按钮上,待菜单展开后,再将鼠标悬停在 “Windows” 选项,最后点击按钮就可以下载最新版的 Python 了。
|
||||
|
||||
![Downloading Python on Windows][10]
|
||||
|
||||
或者你也可以直接点击 “Downloads” 按钮,然后在下载页中选择特定的版本去下载。
|
||||
|
||||
### 安装 Python
|
||||
|
||||
下载好安装包后,直接打开就可以启动安装程序了。
|
||||
|
||||
安装时,选择默认的安装路径比较好,最重要的是要将 Python 添加到搜索路径中,否则 Python 应用程序不知道它该从哪里找到 Python 必须的运行时环境;默认认安装时并没有选中这一项,需要手动勾选安装窗口的 “Add Python 3.7 to Path” ,然后点击继续。
|
||||
|
||||
![Select "Add Python 3 to PATH"][11]
|
||||
|
||||
由于 Windows 需要经过你的批准才会允许安装非微软官方发行的应用程序,因此你必须要在弹出 “User Account Control”(UAC) 系统提示窗口的时候 点击 “Yes” 来继续完成安装。
|
||||
|
||||
![Windows UAC][12]
|
||||
|
||||
这时候你就需要耐心等待,系统会自动将 Python 软件包分发到合适的位置,等待过后,也就意味着你已经成功的安装了 Python ,你就可以愉快的与 Python 玩耍了!
|
||||
|
||||
### 安装一个 IDE
|
||||
|
||||
虽然说你仅需要一个文本编辑器,就可以开始编写 Python 代码了,但是我依然建议你使用 IDE(集成开发环境)来进行开发,这样开发起来就会变得方便很多。IDE 会将文本编辑器和一些好用的 Python 功能集成到一起,使用起来非常友好。你可以考虑选择 IDLE 3 或者 NINJA-IDE 来作为你的 IDE。
|
||||
|
||||
#### IDLE 3
|
||||
|
||||
Python 自带一款 IDE,名字叫 IDLE。虽然你可以使用任何文本编辑器编写 Python 代码,但 IDE 通常会提供 [Notepad++][13] 之类的纯文本编辑器所没有的代码高亮、语法检测等功能,甚至在 IDE 里可以直接通过鼠标点击 “Run” 按钮就能快速运行 Python 代码。
|
||||
|
||||
想要启动 IDLE ,可以点击 Windows 的 “开始” (或者 “Windows”)按钮,然后输入 `python` 来进行搜索。这时候可能会搜索到多个选项,选择 IDLE 启动就好了。
|
||||
|
||||
![IDLE 3 IDE][14]
|
||||
|
||||
如果在 “开始” 菜单中没有搜到,你也可以在 “开始” 菜单输入 `cmd` (或同时按下键盘 `win + R` 键) 来启动 Windows 命令提示符,然后输入下面命令来启动 IDLE :
|
||||
|
||||
```
|
||||
C:\Windows\py.exe
|
||||
```
|
||||
|
||||
如果还是无法启动的话,可是试着重新安装 Python ,安装时记得务必要在安装向导中选中 “Add Python to PATH”。详细说明,可以参考 [Python 官方文档][15] 。
|
||||
|
||||
#### Ninja-IDE
|
||||
|
||||
如果你已经有一些编程经验,而且你觉得 IDLE 对你来说有些简陋的话,你也可以试试 [Ninja-IDE][16]。 Ninja-IDE 是一款非常出色的 Python IDE,它具有代码高亮功能,并且它会自动帮你检测诸如拼写错误、引号或括号缺失以及其他语法错误。而且它还可以显示行号(调试的时候会非常有用)、缩进标记甚至可以直接通过点击 “Run” 按钮来运行你的代码。
|
||||
|
||||
![Ninja-IDE][17]
|
||||
|
||||
如果要安装 Ninja-IDE ,你可以访问 Ninja-IDE 的官网 [下载 Windows 安装程序][18] 。步骤跟安装 Python 大同小异:下载安装包、允许 Windows 安装非微软官方的应用程序,然后等待完成安装即可。
|
||||
|
||||
Ninja-IDE 安装完成后,双击 Windows 桌面或开始菜单下的 Ninja-IDE 就可以启动了。
|
||||
|
||||
### 告诉 Python 怎么做
|
||||
|
||||
关键字能让 Python 知道你想要做什么。在 IDLE 或者 Ninja-IDE ,打开 “文件” 菜单,创建一个新文件。
|
||||
|
||||
在 Ninja-IDE 中,不要创建一个新项目,而是单独创建一个新文件就可以了。
|
||||
|
||||
在你用 IDLE 或者 Ninja-IDE 新建的文件中,输入以下代码:
|
||||
|
||||
```
|
||||
print("Hello world.")
|
||||
```
|
||||
|
||||
* 如果你使用的是 IDLE ,请点击 “运行” 菜单,选择 “运行模块” 选项来运行你的程序。
|
||||
* 如果你使用的是 Ninja ,请单击左侧按钮栏中的 “运行文件” 按钮。
|
||||
|
||||
![Running code in Ninja-IDE][19]
|
||||
|
||||
任何时间当你想要执行代码,IDE 都会提示你先保存当前正在处理的文件,然后再继续。
|
||||
|
||||
`print` 关键字会告诉 Python 打印出你在括号和引号中输入的所有文本。
|
||||
|
||||
但是别高兴地太早,Python 的核心库也就只能访问 `print` 和 `help` 之类的基本关键字、函数等。
|
||||
|
||||
如果想要使用更多的关键字和函数,你就需要使用 `import` 关键字去加载它们。好了,先在你的 IDLE 或者 Ninja 中新建一个文件,命名为 `pen.py` 。
|
||||
|
||||
**警告**:不要把你新建的文件命名为 `turtle.py` ,因为 `turtle.py` 是包含了你要控制的 turtle 程序的文件名称,使用 `turtle.py` 作为文件名会让 Python 感到困惑,因为它以为你想要引入你自己的文件。
|
||||
|
||||
在你新建的文件中输入一下代码,并运行:
|
||||
|
||||
```
|
||||
import turtle
|
||||
```
|
||||
|
||||
[Turtle][20] 是一个用起来非常有意思的模块. 把这段代码添加到你的文件内:
|
||||
|
||||
```
|
||||
turtle.begin_fill()
|
||||
turtle.forward(100)
|
||||
turtle.left(90)
|
||||
turtle.forward(100)
|
||||
turtle.left(90)
|
||||
turtle.forward(100)
|
||||
turtle.left(90)
|
||||
turtle.forward(100)
|
||||
turtle.end_fill()
|
||||
```
|
||||
|
||||
来看看你可以使用 turtle 模块来绘制出哪些图案。
|
||||
|
||||
想要清空 turtle 绘制的区域的话,你可以使用 `turtle.clear()` 函数。那你知道 `turtle.color("blue")` 是用来做什么的吗?
|
||||
|
||||
我们来试一下更复杂点的程序:
|
||||
|
||||
```
|
||||
import turtle as t
|
||||
import time
|
||||
|
||||
t.color("blue")
|
||||
t.begin_fill()
|
||||
|
||||
counter = 0
|
||||
|
||||
while counter < 4:
|
||||
t.forward(100)
|
||||
t.left(90)
|
||||
counter = counter+1
|
||||
|
||||
t.end_fill()
|
||||
time.sleep(2)
|
||||
```
|
||||
|
||||
给你个挑战,试试修改代码,让它得到下图所示的结果:
|
||||
|
||||
![Example Python turtle output][21]
|
||||
|
||||
当你完成这段代码后,你就可以继续学习更多有意思的模块了。这个 [入门级骰子游戏][22] 就是个不错的开始。
|
||||
|
||||
### 保持 Pythonic
|
||||
|
||||
Python 是一门非常有趣的语言,它的模块几乎能实现所有你想要实现的功能。正如你所看到的,Python 入门很容易,只要你对自己有耐心,很快就会发现自己在理解和编写 Python 时能像写汉字一样流畅。你可以多阅读关于 [Python 的文章][23],试着自己编写一些小片段,然后看看 Python 会执行出什么结果。如果想要把 Python 真正融合到你实际工作中,你可以试试 Linux ,Linux 具有在本地可编写脚本的功能,而其他系统却没有。
|
||||
|
||||
祝你好运,记得保持 Pythonic。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/8/how-install-python-windows
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[LiuWenlong](https://github.com/011011100010110101101111)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sethhttps://opensource.com/users/greg-p
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming)
|
||||
[2]: https://www.python.org/
|
||||
[3]: https://opensource.com/article/19/7/get-modular-python-classes
|
||||
[4]: https://github.com/edniemeyer/weta_python_db
|
||||
[5]: https://www.python.org/about/success/ilm/
|
||||
[6]: https://opensource.com/article/19/7/rgb-cube-python-scribus
|
||||
[7]: https://opensource.com/article/19/7/ways-get-started-linux
|
||||
[8]: https://opensource.com/article/17/10/python-101
|
||||
[9]: https://www.python.org/downloads/
|
||||
[10]: https://opensource.com/sites/default/files/uploads/win-python-install.jpg (Downloading Python on Windows)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/win-python-path.jpg (Select "Add Python 3 to PATH")
|
||||
[12]: https://opensource.com/sites/default/files/uploads/win-python-publisher.jpg (Windows UAC)
|
||||
[13]: https://notepad-plus-plus.org/
|
||||
[14]: https://opensource.com/sites/default/files/uploads/idle3.png (IDLE 3 IDE)
|
||||
[15]: http://docs.python.org/3/using/windows.html
|
||||
[16]: http://ninja-ide.org/
|
||||
[17]: https://opensource.com/sites/default/files/uploads/win-python-ninja.jpg (Ninja-IDE)
|
||||
[18]: http://ninja-ide.org/downloads/
|
||||
[19]: https://opensource.com/sites/default/files/uploads/ninja_run.png (Running code in Ninja-IDE)
|
||||
[20]: https://opensource.com/life/15/8/python-turtle-graphics
|
||||
[21]: https://opensource.com/sites/default/files/uploads/win-python-idle-turtle.jpg (Example Python turtle output)
|
||||
[22]: https://opensource.com/article/17/10/python-101#python-101-dice-game
|
||||
[23]: https://opensource.com/sitewide-search?search_api_views_fulltext=Python
|
@ -0,0 +1,169 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12324-1.html)
|
||||
[#]: subject: (Cockpit and the evolution of the Web User Interface)
|
||||
[#]: via: (https://fedoramagazine.org/cockpit-and-the-evolution-of-the-web-user-interface/)
|
||||
[#]: author: (Shaun Assam https://fedoramagazine.org/author/sassam/)
|
||||
|
||||
Cockpit 及其网页用户界面的演变
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
3 年多以前,Fedora 杂志发表了一篇题为《[Cockpit 概览][2]》的文章。从那时起,Cockit 的界面有了一些引人注目的变化。今天的 Cockpit 更加简洁,更大的字体更好地利用了屏幕的空间。
|
||||
|
||||
本文将介绍它的用户界面的一些变化。还将探讨一些在网页界面中可用的通用工具,以简化那些单调的系统管理员任务。
|
||||
|
||||
### Cockpit 驾驶舱安装
|
||||
|
||||
Cockpit 可以使用 `dnf install cockpit` 命令安装。这提供了一个最小的设置,提供了使用该界面所需的基本工具。
|
||||
|
||||
另一个选择是安装 “Headless Management” 组,这将安装用于扩展 Cockpit 功能的附加包。它包括用于 NetworkManager、软件包、磁盘和 SELinux 管理的扩展。
|
||||
|
||||
运行以下命令,在启动时启用 Web 服务并打开防火墙端口:
|
||||
|
||||
```
|
||||
$ sudo systemctl enable --now cockpit.socket
|
||||
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket -> /usr/lib/systemd/system/cockpit.socket
|
||||
|
||||
$ sudo firewall-cmd --permanent --add-service cockpit
|
||||
success
|
||||
$ sudo firewall-cmd --reload
|
||||
success
|
||||
```
|
||||
|
||||
### 登录网页界面
|
||||
|
||||
要访问网页界面,打开你最喜欢的浏览器,在地址栏中输入该服务器的域名或 IP,然后输入服务端口(9090)。由于 Cockpit 使用 HTTPS,安装过程中会创建一个自签证书来加密密码和其他敏感数据。你可以安全地接受这个证书,或者向你的系统管理员或受信任的来源请求 CA 证书。
|
||||
|
||||
一旦证书被接受,就会出现新改进的登录屏幕。长期使用的用户会注意到用户名和密码字段已被移到顶部。此外,凭证字段后面的白色背景会立即吸引用户的注意力。
|
||||
|
||||
![][3]
|
||||
|
||||
自上一篇文章后,登录界面增加了一个功能,就是用 `sudo` 权限登录 —— 如果你的账号是 `wheel` 组的成员。勾选 “对于特权任务,重用我的密码” 旁边的方框,就可以提升你的权限。
|
||||
|
||||
登录界面的另一个版本是连接到同样运行 Cockpit Web 服务的远程服务器的选项。点击 “其他选项” 并输入远程机器的主机名或 IP 地址,从本地浏览器管理它。
|
||||
|
||||
### 主屏幕视图
|
||||
|
||||
一开始,我们就会看到基本概述,带有常见的系统信息,这包括机器的品牌和型号、操作系统、系统是否是最新的,等等。
|
||||
|
||||
![][4]
|
||||
|
||||
点击系统的品牌/型号会显示硬件信息,如 BIOS/固件。它还包括与 `lspci` 中可以看到的组件的详情。
|
||||
|
||||
![][5]
|
||||
|
||||
点击任何一个选项,右边都会显示该设备的详细信息。例如,“CPU 核心百分比” 选项显示了用户和内核使用了多少 CPU 核心的详细信息。此外,“内存和交换” 图表显示了系统内存的使用量、缓存量和交换分区的活动量。“磁盘 I/O” 和 “网络流量” 图表连到了 Cockpit 的 “存储和网络” 部分。这些内容将在接下来详细探讨系统工具的一篇文章中重新探讨。
|
||||
|
||||
#### SSH 密钥和认证
|
||||
|
||||
由于安全是系统管理员的关键因素,Cockpit 现在有了查看机器 MD5 和 SHA256 密钥指纹的选项。点击 “显示指纹” 选项可以显示服务器的 ECDSA、ED25519 和 RSA 指纹密钥。
|
||||
|
||||
![][6]
|
||||
|
||||
你也可以通过点击右上角的用户名,选择“验证”,添加自己的密钥。点击 “添加密钥”,可以在其他系统上验证该机器。你也可以通过点击右侧的 “X” 按钮,撤销你在 Cockpit Web 服务中的权限。
|
||||
|
||||
![][7]
|
||||
|
||||
#### 更改主机名和加入域
|
||||
|
||||
更改主机名可以在主页上一键解决。单击当前显示的主机名,并在“更改主机名”框中输入新名称。最新的功能之一是提供了一个 “简称” 的选项。
|
||||
|
||||
Cockpit 增加的另一个功能是可以连接到目录服务器。点击 “加入域”,会出现一个弹窗,要求提供域地址或名称、组织单位(可选)和域管理员的凭证。“Domain Membership” 组提供了加入 LDAP 服务器所需的所有包,包括 FreeIPA,以及流行的 Active Directory。
|
||||
|
||||
要退出域,请点击域名,然后点击 “离开域”。将会出现一个警告,解释一旦系统不再在域上将会发生的变化。要确认,点击红色的 “离开域” 按钮。
|
||||
|
||||
![][8]
|
||||
|
||||
#### 配置 NTP 和系统日期和时间
|
||||
|
||||
使用命令行和编辑配置文件绝对可以完成最大限度的调整。然而,有些时候,一些更直接的方法就足够了。通过 Cockpit,你可以选择手动设置或使用 NTP 自动设置系统的日期和时间。一旦同步,右边的信息图标就会由红色变成蓝色。如果你手动设置日期和时间,该图标将消失。
|
||||
|
||||
要更改时区,请输入洲,下面会弹出城市列表。
|
||||
|
||||
![][9]
|
||||
|
||||
#### 关机和重启
|
||||
|
||||
你可以在 Cockpit 的主屏幕上轻松关闭和重启服务器。你也可以延迟关机/重启,并发送消息警告用户。
|
||||
|
||||
![][10]
|
||||
|
||||
#### 设置性能配置文件
|
||||
|
||||
如果安装了 `tuned` 和 `tuned-utils` 包,可以在主屏幕上更改性能配置文件。默认情况下,它被设置为推荐的配置文件。然而,如果服务器的用途需要更多的性能,我们可以在 Cockpit 中更改配置文件以满足这些需求。
|
||||
|
||||
![][11]
|
||||
|
||||
### 网页版终端控制台
|
||||
|
||||
一个 Linux 系统管理员的工具箱如果不能访问终端,将毫无用处。终端使得管理员可以对服务器进行微调,而不仅仅是 Cockpit 中的内容。随着主题功能的加入,管理员可以根据自己的喜好快速调整文字和背景颜色。
|
||||
|
||||
另外,如果你错输入了 `exit` 命令,点击右上角的 “重置” 按钮,会提供一个闪烁着光标的新屏幕。
|
||||
|
||||
![][12]
|
||||
|
||||
### 添加远程服务器和仪表板布局
|
||||
|
||||
“Headless Management” 组包括了仪表盘模块(`cockpit-dashboard`)。它以实时图表的形式提供了 CPU、内存、网络和磁盘性能的概览。远程服务器也可以通过同一界面进行添加和管理。
|
||||
|
||||
例如,要在仪表盘中添加远程计算机,请单击 “+” 按钮。输入服务器的名称或 IP 地址,并选择你要的颜色。这有助于你在图中区分服务器的统计数据。要在服务器之间进行切换,请点击主机名称(如下面的屏幕动画所示)。要从列表中删除一个服务器,点击勾选标记图标,然后点击红色垃圾桶图标。下面的例子演示了 Cockpit 如何管理一台名为 `server02.local.lan` 的远程机器。
|
||||
|
||||
![][13]
|
||||
|
||||
### 文档和寻找帮助
|
||||
|
||||
一如既往,手册页是查找文档的好地方。在命令行结果中进行简单搜索即可找到与使用和配置该 Web 服务的不同方面有关的页面。
|
||||
|
||||
```
|
||||
$ man -k cockpit
|
||||
cockpit (1) - Cockpit
|
||||
cockpit-bridge (1) - Cockpit Host Bridge
|
||||
cockpit-desktop (1) - Cockpit Desktop integration
|
||||
cockpit-ws (8) - Cockpit web service
|
||||
cockpit.conf (5) - Cockpit configuration file
|
||||
```
|
||||
|
||||
Fedora 仓库中也有一个名为 `cockpit-doc` 的软件包。这个软件包的描述是最好的解释。
|
||||
|
||||
> 《Cockpit 部署和开发者指南》向系统管理员展示了如何在他们的机器上部署 Cockpit,并帮助开发者嵌入或扩展 Cockpit。
|
||||
|
||||
更多文档请访问 <https://cockpit-project.org/external/source/HACKING>。
|
||||
|
||||
### 结论
|
||||
|
||||
本文只涉及 Cockpit 中的一些主要功能。管理存储设备、网络、用户账户和软件控制将在下一篇文章中介绍。此外,可选的扩展,如 389 目录服务,以及用于处理 Fedora Silverblue 中的软件包的`cockpit-ostree` 模块。
|
||||
|
||||
随着越来越多的用户采用 Cockpit,可选的功能会继续增加。这个界面对于想要一个轻量级界面来控制服务器的管理员来说是非常理想的。
|
||||
|
||||
你对 Cockpit 有什么看法?在下面的评论中分享你的经验和想法。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/cockpit-and-the-evolution-of-the-web-user-interface/
|
||||
|
||||
作者:[Shaun Assam][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://fedoramagazine.org/author/sassam/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-816x345.jpg
|
||||
[2]: https://fedoramagazine.org/cockpit-overview/
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-login-screen.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-home-screen.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-system-info.gif
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-ssh-key-fingerprints.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-authentication.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-hostname-domain.gif
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-date-time.png
|
||||
[10]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-power-options.gif
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-tuned.gif
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-terminal.gif
|
||||
[13]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-add-remote-servers.gif
|
@ -0,0 +1,123 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12314-1.html)
|
||||
[#]: subject: (6 open source alternatives to Wunderlist)
|
||||
[#]: via: (https://opensource.com/article/20/5/alternatives-list)
|
||||
[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike)
|
||||
|
||||
6 个开源的奇妙清单(Wunderlist)替代品
|
||||
======
|
||||
|
||||
> 喜欢列表?看看这个便捷的开源应用程序列表,以管理你所有的列表!
|
||||
|
||||

|
||||
|
||||
奇妙清单(Wunderlist)是一款清单应用,受到很多人的喜爱,但从 2020 年 5 月 6 日起,它就永远停止了。它的网站鼓励现有用户下载并使用“微软待办”来代替它。这很诱人,因为它可以轻松导入你多年来制作的所有这些列表。不过话又说回来,也许这是个机会,可以“近藤麻理惠”一下这些列表,并削减一些事务。(你真的需要 30 个列表吗?很显然,我觉得我需要,所以我不做评判。)
|
||||
|
||||
我有各种各样的清单,从“2020 年花园的植物”到“给丈夫的礼物”。有些是清单,有些是待办事项清单,有些是为了清单而清单。
|
||||
|
||||
对我和我丈夫来说,最有用的清单是我们共享的杂货清单。我们都有手机上的应用程序,我们都把东西添加到列表中,但在他去购物之前,我们分别在手机上审查它(是的,你没看错),他把东西放进购物车时,他就会勾掉它。这让整个过程变得出奇的高效,我想我们节省了一些钱,因为我们喜欢坚持按清单购物。
|
||||
|
||||
虽然奇妙清单的用户很喜欢它,但它并不是完全独一无二的。还有无数的列表应用。对于奇妙清单,我特别喜欢它将简洁性和设计感结合在一起,而且它成功实现了一些有用的功能,比如与他人分享和协作,列表的动态复选框,以及在移动和网页界面上的良好用户体验。我也很喜欢用它来做一个不“活跃”文档的列表:一个我不会每周都回顾或定期进展的列表,就像我用来进行头脑风暴的许多列表一样(包括我一直想写的小说...)。
|
||||
|
||||
从这些年来我们发表的许多精彩文章中,我整理了一系列奇妙清单的开源替代方案,从简单的任务管理和待办事项清单到复杂的笔记记录和流程管理,这些列表工具可能会满足你的需求。或者,如果你是那个在丢得到处都是的纸条和便签上书写任务和备注的人,这可能是尝试这些数字工具之一的好时机。
|
||||
|
||||
### Tasks:可与 OwnCloud 配合
|
||||
|
||||
Tasks 是一款自由开源的应用,你可以从 [F-droid][2] 安装。Tasks 是一款只适用于手机的应用,但它可以同步到各种地方,非常灵活。你可以将你的列表保存到 NextCloud 或 OwnCloud、Google Tasks、Apple Reminders 以及几乎所有你有账户的 CalDAV 服务器上。
|
||||
|
||||
Tasks 的默认视图是每日视图,所以你输入的任何任务都被假定为从今天开始的任务。如果你像我一样,想维护几个不同的列表,你可以用标签来实现。当你创建一个标签时,你就为任务创建了一个类别。你可以为它指定一种颜色和一个图标,这样每个任务列表都是独一无二的。
|
||||
|
||||
这需要一点时间来适应,但标签有很多优点。因为所有的任务都是有标签的,你可以通过点击你想过滤的标签来查看任务组,但你也可以按天甚至按地点过滤。这意味着,当你去采购杂货时,你的杂货列表会成为活跃的默认列表,而当你回到家时,你的日常生活列表又会成为活跃的列表。
|
||||
|
||||
通过将你的数据同步到你的一个在线账户,你可以与亲人、合作者和同事分享列表。
|
||||
|
||||
另一个伟大的功能是,如果你每天早上上班时都有相同的任务,或者每周杂货清单中有 20 个相同的项目,你可以创建定期重复的任务。
|
||||
|
||||
评测者:Seth Kenlon
|
||||
|
||||
![Screenshot of Tasks interface][3]
|
||||
|
||||
### OpenTasks:适于长列表
|
||||
|
||||
[OpenTasks][4] 是一款优秀的任务管理工具,可以创建带有各种设置的个人任务。它在创建任务时支持多种字段,从基本的东西,如名称和描述,到更复杂的项目,如选择任务是私人、公共还是机密。OpenTasks 与其他替代品最大的不同之处在于它在应用的主屏幕上使用了选项卡。这些选项卡可以让你快速看到到期的任务、即将开始的任务、按优先级排序的任务,以及按当前完成进度排序的任务。许多其他应用程序支持做这样的事情,但 OpenTasks 很快就能轻松访问这些列表。
|
||||
|
||||
[阅读完整的 OpenTasks 评测][5],作者:Joshua Allen Holm。
|
||||
|
||||
![OpenTasks in Google Play store][6]
|
||||
|
||||
### Mirakel:嵌套列表的绝佳之选
|
||||
|
||||
[Mirakel][7] 是一款任务管理应用,它拥有现代化的用户界面,并支持你在这样一款程序中可能想要的几乎所有格式。Mirakel 在基础层面上支持多个被称为“元列表”的列表。创建一个单独的任务有大量的选项,有截止日期、提醒、进度跟踪、标签、备注、子任务和文件附件,所有这些都构成了任务条目的一部分。
|
||||
|
||||
[阅读完整的 Mirakel 评测][5],作者:Joshua Allen Holm。
|
||||
|
||||
![Screenshot from website of Mirakel app][8]
|
||||
|
||||
### Todo:简单有效,随处可用
|
||||
|
||||
[Todo.txt][9] 是我不断反复推荐的两个待办事项和任务管理应用之一(另一个是 Org 模式)。而让我不断推荐的原因是,它简单、便携、易懂,而且有很多很棒的附加组件,即使一台机器有这个程序而其他机器上没有,也不会破坏它。而且由于它是一个 Bash shell 脚本,我从来没有发现不支持它的系统。阅读更多关于[如何安装和使用 Todo.txt][10]。
|
||||
|
||||
[阅读完整的 todo.txt 评测][10],作者:Kevin Sonney。
|
||||
|
||||
![Drop-down menu for Todo.txt][11]
|
||||
|
||||
### Joplin:最佳私人列表
|
||||
|
||||
[Joplin][12] 是一个 NodeJS 应用程序,它可以在本地运行和存储信息,允许你加密任务,并支持多种同步方法。Joplin 可以作为控制台或图形应用程序在 Windows、Mac 和 Linux 上运行。Joplin 还拥有 Android 和 iOS 的移动应用,这意味着你的笔记随处可用,而不需要大费周章。Joplin 甚至允许你用 Markdown、HTML 或纯文本来格式化你的笔记。
|
||||
|
||||
[阅读完整的 Joplin 评测][13],作者:Kevin Sonney。
|
||||
|
||||
![Joplin graphical version ][14]
|
||||
|
||||
### CherryTree:最好的 Evernote / OneNote / Keep 替代品
|
||||
|
||||
[CherryTree][15] 是一个 GPLv3 许可的应用程序,它以节点的形式组织信息。每个节点都可以有子节点,让你轻松组织你的列表和思想。而且,子节点可以有自己的子节点,具有独立的属性。
|
||||
|
||||
[阅读完整的 CherryTree 评测][16],作者:Ben Cotton。
|
||||
|
||||
![CherryTree's hierarchical note layout][17]
|
||||
|
||||
### 附赠:Wekan,给看板粉丝
|
||||
|
||||
<ruby>看板<rt>kanban</rt></ruby>是当今敏捷流程的主流。我们中的许多人(包括我自己)不仅用它们来组织我们的工作,还用它们来组织我们的个人生活。我认识一些艺术家,他们使用 Trello 这样的应用程序来跟踪他们的委托清单,以及正在进行和已经完成的工作。但这些应用往往与工作账户或商业服务挂钩。让我们看看 [Wekan][18],这是一个开源的看板,你可以在本地或你选择的服务上运行。Wekan 提供了与其他看板应用相同的功能,比如创建面板、列表、泳道和卡片,在列表之间拖放,分配给用户,给卡片贴标签,以及做几乎所有你在现代看板中期待的事情。
|
||||
|
||||
[阅读完整的 Wekan 评测][19],作者:Kevin Sonney。
|
||||
|
||||
![Wekan kanban board][20]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/alternatives-list
|
||||
|
||||
作者:[Jen Wike Huger][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/jen-wike
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team)
|
||||
[2]: https://f-droid.org/en/packages/org.tasks/
|
||||
[3]: https://opensource.com/sites/default/files/uploads/screenshot_tasks_resized.jpg (Screenshot of Tasks interface)
|
||||
[4]: https://play.google.com/store/apps/details?id=org.dmfs.tasks
|
||||
[5]: https://opensource.com/article/17/1/task-management-time-tracking-android
|
||||
[6]: https://opensource.com/sites/default/files/uploads/opentasks_rezied.jpg (OpenTasks in Google Play store)
|
||||
[7]: https://mirakel.azapps.de/
|
||||
[8]: https://opensource.com/sites/default/files/uploads/mirakel_web_resized.jpg (Screenshot from website of Mirakel app)
|
||||
[9]: http://todotxt.org/
|
||||
[10]: https://linux.cn/article-11835-1.html
|
||||
[11]: https://opensource.com/sites/default/files/uploads/todo.txtmenu_3.png (Drop-down menu for Todo.txt)
|
||||
[12]: https://joplin.cozic.net/
|
||||
[13]: https://linux.cn/article-10476-1.html
|
||||
[14]: https://opensource.com/sites/default/files/uploads/joplin-1.png (Joplin graphical version )
|
||||
[15]: https://www.giuspen.com/cherrytree/
|
||||
[16]: https://opensource.com/article/19/5/cherrytree-notetaking
|
||||
[17]: https://opensource.com/sites/default/files/uploads/cherrytree.png (CherryTree's hierarchical note layout)
|
||||
[18]: https://wekan.github.io/
|
||||
[19]: https://linux.cn/article-10454-1.html
|
||||
[20]: https://opensource.com/sites/default/files/uploads/wekan-board.png (Wekan kanban board)
|
@ -0,0 +1,157 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12316-1.html)
|
||||
[#]: subject: (Ubuntu Cinnamon Remix 20.04 Review: The Perfect Blend of Ubuntu With Cinnamon)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-cinnamon-remix-review/)
|
||||
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
|
||||
|
||||
Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
|
||||
======
|
||||
|
||||

|
||||
|
||||
推出于 2011 年的 GNOME 3,其 GNOME Shell 迎来了社区的赞扬的同时,也招致了一些人的反对。很多用户和开发者都很喜欢原来的 GNOME 界面,以至于有几个小组复刻了它,其中的一个小组 —— Linux Mint 团队创建了 [Cinnamon 桌面环境][1]。
|
||||
|
||||
Cinnamon 桌面成为了 Linux Mint 的标志型产品。多年来,Cinnamon 一直是 [Linux Mint][2] 的代名词。在过去的几年里,随着 Cinnamon 的普及,这种情况略有改变。现在其他发行版也开始提供 Cinnamon 桌面环境,[Manjaro][3] 就是这样一个例子。
|
||||
|
||||
几个月前,我们向大家介绍了一个[新 Ubuntu 变体][4],它提供了开箱即用的 Cinnamon 桌面体验,今天就让我们来深入了解一下 [Ubuntu Cinnamon Remix][5]。
|
||||
|
||||
### 为什么是 Ubuntu Cinnamon Remix 而不是 Linux Mint?
|
||||
|
||||
的确,Linux Mint 是基于 Ubuntu 的,很多 Linux Mint 的用户都会有这样的疑问:既然 Linux Mint 已经如此成熟,而且用户体验也大致相同,那么换成 Ubuntu 有什么意义吗?
|
||||
|
||||
Ubuntu Cinnamon Remix 与 Linux Mint 有很多小的区别,但有一个关键的区别是 Linux 爱好者不能忽视的。
|
||||
|
||||
Linux Mint 是基于 “LTS”(长期支持)版本的 Ubuntu,这意味着它一直落后于 Canonical 的 6 个月的更新节奏。Ubuntu Cinnamon Remix 则可以得益于较新的内核以及其他 6 个月周期内的功能升级和较新的软件。
|
||||
|
||||
另一个关键的区别是,Ubuntu Cinnamon Remix 将 “继承” [Snap 支持][6],而 Linux Mint 则拥抱 [FlatPak][7]。Ubuntu Cinnamon Remix 使用 Ubuntu 软件中心而不是 Mint 软件管理器。
|
||||
|
||||
我是 Cinnamon 的忠实粉丝,所以我选择了评测这款 Ubuntu 和 Cinnamon 的混合版,在这里我分享一下我的体验。
|
||||
|
||||
### 体验 Ubuntu Cinnamon Remix
|
||||
|
||||
只要有机会,我总会提到 [Calamares 安装程序][8]有多快,感谢 Ubuntu Cinnamon Remix 团队如此选择。
|
||||
|
||||
![Calamares Installer][9]
|
||||
|
||||
新安装的 Ubuntu Cinnamon Remix 会消耗大约 750 MB 的内存。这与 Linux Mint Cinnamon 非常相似。
|
||||
|
||||
![An idle Cinnamon takes 750 MB of RAM][10]
|
||||
|
||||
美丽的 [Kimmo 主题][11]和橙色调的 Ubuntu 壁纸也给我留下了深刻的印象,看来这是一个非常细致的努力的结果。
|
||||
|
||||
![Ubuntu Cinammon Remix 20.04 Desktop][12]
|
||||
|
||||
#### 足够让你开始的工具
|
||||
|
||||
和其他 Ubuntu 发行版一样,Ubuntu Cinnamon Remix 也包含了一些重要的生产力工具,下面是其中一些:
|
||||
|
||||
* 火狐浏览器
|
||||
* Thunderbird - 电子邮件客户端
|
||||
* LibreOffice套件
|
||||
* Celluloid - 多媒体播放器
|
||||
* [GIMP][13] - 图像处理软件
|
||||
* Synaptic 软件包管理器
|
||||
* Gnome 软件中心
|
||||
* [Gparted][14] - 分区管理器
|
||||
|
||||
使用 Ubuntu Cinnamon Remix 作为我的主要平台已经有几天了,它满足了我的高期望。Ubuntu 稳定如磐石,速度非常快,在日常工作中我没有遇到任何问题。
|
||||
|
||||
#### 给 Linux Mint 爱好者的 Ubuntu
|
||||
|
||||
你是否热衷于 Ubuntu Cinnamon,却习惯了 Linux Mint 主题?点击下面的内容,看看如何获得一个完整的 Linux Mint 主题包,以及如何配置它来保持 Ubuntu 的传统。
|
||||
|
||||
给 Ubuntu Cinnamon Remix 以真正的 Mint 感受:
|
||||
|
||||
首先你必须下载并解压以下内容,通过终端很容易完成。
|
||||
|
||||
获取 Linux Mint-X 图标包:
|
||||
|
||||
```
|
||||
wget http://packages.linuxmint.com/pool/main/m/mint-x-icons/mint-x-icons_1.5.5_all.deb
|
||||
```
|
||||
|
||||
获取 Linux Mint-Y 图标包:
|
||||
|
||||
```
|
||||
wget http://packages.linuxmint.com/pool/main/m/mint-y-icons/mint-y-icons_1.3.9_all.deb
|
||||
```
|
||||
|
||||
获取 Linux Mint 主题:
|
||||
|
||||
```
|
||||
wget http://packages.linuxmint.com/pool/main/m/mint-themes/mint-themes_1.8.4_all.deb
|
||||
```
|
||||
|
||||
安装下载的软件包:
|
||||
|
||||
```
|
||||
sudo dpkg -i ./mint-x-icons_1.5.5_all.deb ./mint-y-icons_1.3.9_all.deb ./mint-themes_1.8.4_all.deb
|
||||
```
|
||||
|
||||
完成后,点击左下角的菜单按钮,输入 “themes”。你也可以在系统设置中找到“主题”功能。
|
||||
|
||||
![Accessing Themes][15]
|
||||
|
||||
打开后更换 kimmo 图标和主题,如下图所示。Linux Mint 默认的“绿色”是普通的 Mint-Y,而橙色是 Ubuntu 的最佳选择。
|
||||
|
||||
![Linux Mint Theme Settings][16]
|
||||
|
||||
#### 为 Cinnamon 迷们准备的美食
|
||||
|
||||
让我们承认吧,审美很重要。Cinnamon 拥有简洁优雅的外观、易于阅读的字体和漂亮的色彩对比主题。Cinnamon 提供了一个整洁的桌面,只需进入系统设置下的桌面菜单,即可轻松配置桌面图标。你也可以选择桌面图标只显示在主显示器上、只显示在副显示器上,或者同时显示在两个显示器上。这也适用于超过两台显示器的设置。
|
||||
|
||||
![Ubuntu Cinnamon Remix Desklets][17]
|
||||
|
||||
桌面组件和小程序是一种小型的、单一用途的应用程序,可以分别添加到你的桌面或面板上。在众多的应用程序中,最常用的是 CPU 或资源监控器、天气小程序、便签和日历。
|
||||
|
||||
Cinnamon 控制中心集中提供许多桌面配置选项。通过访问 “主题” 部分,你可以选择桌面基本方案和图标、窗口边框、鼠标指针和控件外观。字体对桌面的整体外观有很大的影响,而 Cinnamon 让改变字体比以往任何时候都要容易。
|
||||
|
||||
Cinnamon 控制中心配置对新用户来说也足够简单,相比之下,KDE Plasma 会因为大量的配置选项而导致新用户感到困惑。
|
||||
|
||||
![][18]
|
||||
|
||||
Cinnamon 面板包含用于启动程序的菜单、基本的系统托盘和应用程序选择器。面板的配置很简单,添加新的程序启动器只需在主菜单中找到你要添加的程序,右击图标,选择 “添加到面板” 即可。你也可以将启动程序图标添加到桌面,以及 Cinnamon 的 “收藏夹” 启动栏中。如果你不喜欢面板上图标的顺序,只需在面板栏上点击右键,进入面板的 “编辑” 模式,重新排列图标即可。
|
||||
|
||||
### 结论
|
||||
|
||||
无论你是决定给你的桌面 “加点料”,还是考虑从 [Windows 迁移到 Linux][19],Cinnamon 社区都为你制作了大量的香料。
|
||||
|
||||
传统而又优雅,可定制而又简单,Ubuntu Cinnamon Remix 是一个有趣的项目,前途无量,对于喜欢 Ubuntu 的 Cinnamon 桌面爱好者来说,这可能是一个不二之选。
|
||||
|
||||
你觉得 Ubuntu Cinnamon Remix 怎么样?你已经使用过它了吗?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-cinnamon-remix-review/
|
||||
|
||||
作者:[Dimitrios Savvopoulos][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://itsfoss.com/author/dimitrios/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/Cinnamon_(desktop_environment)
|
||||
[2]: https://www.linuxmint.com/
|
||||
[3]: https://manjaro.org/
|
||||
[4]: https://itsfoss.com/ubuntudde/
|
||||
[5]: https://ubuntucinnamon.org/
|
||||
[6]: https://snapcraft.io/
|
||||
[7]: https://flatpak.org/
|
||||
[8]: https://calamares.io/
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/Calamares-Installer.png?resize=800%2C426&ssl=1
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/htop-running-on-Ubuntu-Cinnamon-Remix-20.04.png?ssl=1
|
||||
[11]: https://github.com/Ubuntu-Cinnamon-Remix/kimmo-gtk-theme
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-Cinammon-Remix-20.04-desktop.png?resize=800%2C450&ssl=1
|
||||
[13]: https://itsfoss.com/gimp-2-10-release/
|
||||
[14]: https://itsfoss.com/gparted/
|
||||
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/accessing-themes.png?ssl=1
|
||||
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/Linux-Mint-theme-settings.png?ssl=1
|
||||
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-cinnamon-remix-desklets.jpg?fit=800%2C450&ssl=1
|
||||
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-cinnamon-control.jpg?fit=800%2C450&ssl=1
|
||||
[19]: https://itsfoss.com/windows-like-linux-distributions/
|
61
published/202006/20200514 How IoT will rescue aviation.md
Normal file
61
published/202006/20200514 How IoT will rescue aviation.md
Normal file
@ -0,0 +1,61 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Yufei-Yan)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12367-1.html)
|
||||
[#]: subject: (How IoT will rescue aviation)
|
||||
[#]: via: (https://www.networkworld.com/article/3543318/how-iot-will-rescue-aviation.html)
|
||||
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
|
||||
|
||||
物联网将如何拯救航空业
|
||||
======
|
||||
|
||||
> 为防止感染新冠病毒的乘客登机,欧洲飞机制造商,空中客车公司正在研究能够识别病毒的物联网传感器。
|
||||
|
||||
![Stéphan Valentin][1]
|
||||
|
||||
一家开发传感器来探测飞机上和机场中的爆炸物和其他化学物品的生物技术公司正在和空中客车合作,一同开发一种可以检测已经感染新冠病毒乘客的传感器。
|
||||
|
||||
Koniku 的创始人兼首席执行管 Osh Agabi 在[一篇博文][3]中说,总部位于加州的 Konibu 公司和空中客车(Airbus)公司从 2017 年就开始合作共同开发能够探测出不同化学物质的非接触式设备。
|
||||
|
||||
他们希望通过识别从呼吸或者汗液中的气味来判断是否感染新冠病毒,因为这些气味可能是新冠病毒中化学物质的标记。“大多数感染和疾病都会或多或少的改变我们呼吸和汗液里的化学成分,也就会产生不同的气味,” Agabi 写道。“如果我们检测到这些气味,我们就可以检测是否存在感染。”
|
||||
|
||||
这两家公司希望能够识别这种新冠病毒的特异性标记,并且能找到一种可以检测这些标记的物联网(IoT)传感器,这些传感器配备有通过基因工程改造过的受体,从而对病毒进行探测。“那些受体会过滤空气中的分子,并且当它们接触到已经提前被编程检测的存在威胁或危险的分子化合物的时候,就会产生一个信号,”他写道。
|
||||
|
||||
他说,乘客将通过走过一个装有传感器的封闭通道来进行筛选。“通过对构成这些受体细胞中的 DNA 进行编程,使其对出现在感染者呼吸或者汗液中的化合物作出反应,我们相信,我们将能够迅速且可靠地筛查新冠病毒,并且确定一个人是否已经被感染,”他写道。
|
||||
|
||||
其他类型的非接触检测器已经在使用中了,包括<ruby>皮肤温度升高<rt>elevated-skin-temperature</rt></ruby>(EST)摄像头。
|
||||
|
||||
意大利的最主要的机场 Leonardo da Vinci 购置了三个热成像头盔来发现发烧的人。机场已经配备了固定的热感应扫描仪,并且订购了更多的这种设备。[根据当地媒体 Fiumicino Online 的报道][5],被发现潜在发烧的乘客被会要求做进一步的医学检查。
|
||||
|
||||
位于中国深圳制造这种头盔的 KC Wearable 公司表示,这种头盔可以由员工佩戴,并且可以与乘客保持一定的距离。
|
||||
|
||||
制造热感应摄像头的 FLIR Systems 公司在其本月的[财报][6]中表示,对 EST 系统的需求正在持续增加。
|
||||
|
||||
“尽管这些热感应摄像头不能检测或者诊断任何医疗状况,但这些摄像头可以作为识别皮肤温度升高的有效工具。”报告说。
|
||||
|
||||
FLIR 公司 CEO Jim Cannon 在本月的收入电话会议上表示,“许多公司都在寻求在他们的设施中安装这种技术,以便解除<ruby>就地避难<rt>shelter-in-place</rt></ruby>法令”。[根据路透社报道][8],通用汽车就是其中之一。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3543318/how-iot-will-rescue-aviation.html
|
||||
|
||||
作者:[Patrick Nelson][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Yufei-Yan](https://github.com/Yufei-Yan)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Patrick-Nelson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://images.idgesg.net/images/article/2018/08/passenger-view_of_airplane_wing_above_clouds_travel_journey_transportation_by_stephan_valentin_cc0_via_unsplash_1200x800-100766542-large.jpg
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.linkedin.com/pulse/what-happens-when-airports-open-back-up-osh-agabi/?src=aff-lilpar&veh=aff_src.aff-lilpar_c.partners_pkw.10078_plc.Skimbit%20Ltd._pcrid.449670_learning&trk=aff_src.aff-lilpar_c.partners_pkw.10078_plc.Skimbit%20Ltd._pcrid.449670_learning&clickid=WNmzMlyalxyOUI7wUx0Mo34HUkiwwpy%3APQ3X1Y0&irgwc=1
|
||||
[4]: https://www.networkworld.com/newsletters/signup.html
|
||||
[5]: https://www.fiumicino-online.it/articoli/cronaca-2/fase-2-all-aeroporto-di-fiumicino-lo-smart-helmet-per-controllare-la-febbre-a-distanza
|
||||
[6]: https://flir.gcs-web.com/news-releases/news-release-details/flir-systems-announces-first-quarter-2020-financial-results
|
||||
[7]: https://www.fool.com/earnings/call-transcripts/2020/05/06/flir-systems-inc-flir-q1-2020-earnings-call-transc.aspx
|
||||
[8]: https://uk.reuters.com/article/us-flir-systems-gm/general-motors-taps-flir-systems-for-fever-check-cameras-at-factories-idUKKBN22J02B
|
||||
[9]: https://www.facebook.com/NetworkWorld/
|
||||
[10]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,165 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12354-1.html)
|
||||
[#]: subject: (Ubuntu Budgie 20.04 Review: Smooth, Polished & Plenty of Changes)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-budgie-20-04-review/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
Ubuntu Budgie 20.04 LTS:平滑、精致和丰富的变化
|
||||
======
|
||||
|
||||
正如我们向读者承诺的那样,我们将对 [Ubuntu 20.04 LTS 版本][1]的所有主要特色版进行评测。在这个续篇中,我们将对 Ubuntu Budgie 进行评测。
|
||||
|
||||
![Ubuntu Budgie Desktop][2]
|
||||
|
||||
顾名思义,[Ubuntu Budgie][3] 是使用 [Budgie 桌面环境][5]的 [Ubuntu 官方特色版][4]。这个版本是 Ubuntu 家族中较新的一位成员。Ubuntu Budgie 的第一个版本是 16.04,它在 17.04 版本时被接受为官方特色版。
|
||||
|
||||
他们的[目标][6]是“结合 Budgie 界面的简洁和优雅,以生产具有现代范式的面向桌面的传统发行版。”
|
||||
|
||||
### Ubuntu Budgie 20.04 评测:哪些改变了,哪些没有!
|
||||
|
||||
[自 18.04 LTS 发布以来,Ubuntu Budgie][7] 有了令人惊讶的更新和改进:
|
||||
|
||||
* 苹果风格的新菜单
|
||||
* 默认采用基于 Budgie 的网络管理小程序
|
||||
* 新的 Window Shuffler 允许你通过快捷键平铺应用程序
|
||||
* 快速切换桌面布局的新工具
|
||||
* 支持 4k 分辨率
|
||||
* 新的默认应用程序:GNOME Firmware 和 Drawing
|
||||
* 现在已经为 20.04 重构了向后移植包
|
||||
* 默认浏览器是火狐
|
||||
* 默认使用 Catfish 搜索文件和文本
|
||||
* 在 Budgie 中集成了 Nemo 文件管理器
|
||||
* 由于错误,系统托盘小程序被移除了
|
||||
* 默认情况下,事件警报声被禁用
|
||||
* 修复了键盘快捷键神秘失踪的问题
|
||||
* 更好的锁屏样式
|
||||
* 由于社区的需求,文件应用 Nautilus 已被 Nemo 取代
|
||||
* Plank 坞站现在已经切换到屏幕底部,是透明的,并且默认有弹跳动画
|
||||
* 快速笔记和热角小程序已从 Python 移植到 Vala,以提高速度
|
||||
* Celluloid 取代了 MPV
|
||||
* 更新了 GNOME 的依赖性
|
||||
|
||||
![][8]
|
||||
|
||||
Ubuntu Budgie 现在随附了 Budgie 桌面环境的最新版本(10.5.1)。改进包括:
|
||||
|
||||
* 在 Budgie 桌面设置中新增 Raven 部分
|
||||
* Raven 通知可以分组,通知可以关闭
|
||||
* 重新打造了图标任务列表
|
||||
* 能够设置虚拟桌面的数量
|
||||
|
||||
Ubuntu Budgie 自带了大量的 Budgie <ruby>小程序<rt>applet</rt></ruby>和<ruby>微应用<rt>min-app</rt></ruby>。它们可以通过 Ubuntu Budgie “欢迎”应用来安装。
|
||||
|
||||
![Ubuntu Budgie Welcome][9]
|
||||
|
||||
* WeatherShow:显示未来五天的天气预报,每 3 小时更新一次
|
||||
* Wallstreet:一个可以循环展示你的图像文件夹中的壁纸工具
|
||||
* Visual-space:一个紧凑的工作区切换器
|
||||
* Dropby:这个小程序可让你在面板上快速管理 U 盘
|
||||
* Kangaroo:从面板上快速浏览文件夹
|
||||
* 垃圾桶小程序:管理你的垃圾桶
|
||||
* Fuzzyclock:以模糊的方式显示时间
|
||||
* 工作区秒表:允许你跟踪在每个工作区花费的时间
|
||||
|
||||
完整的变更和更新列表,请访问[变更日志][10]。
|
||||
|
||||
#### 系统要求
|
||||
|
||||
Ubuntu Budgie 20.04 更新了[系统要求][11]:
|
||||
|
||||
* 4GB 或以上的内存
|
||||
* 64 位的 Intel 和 AMD 处理器
|
||||
* 在 CSM 模式下启动的 UEFI 电脑
|
||||
* 基于英特尔的现代苹果电脑
|
||||
|
||||
如你所见,Budgie 并不是一个真正的轻量级选择。
|
||||
|
||||
#### 安装的应用
|
||||
|
||||
![][12]
|
||||
|
||||
Ubuntu Budgie 中默认包含了以下有用的应用程序:
|
||||
|
||||
* AisleRiot Solitaire
|
||||
* Geary
|
||||
* Catfish 搜索工具
|
||||
* Cheese 网络摄像头工具
|
||||
* GNOME Drawing
|
||||
* GNOME 2048
|
||||
* GNOME Mahjongg
|
||||
* GNOME Mines
|
||||
* GNOME Sudoku
|
||||
* Gthumb
|
||||
* LibreOffice
|
||||
* Maps
|
||||
* Rhythmbox
|
||||
* Tilix
|
||||
* Ubuntu Budgie 欢迎应用
|
||||
* Evince 文档查看器
|
||||
* Plank
|
||||
* Celluloid
|
||||
|
||||
![Ubuntu Budgie Ram Usage][13]
|
||||
|
||||
### 安装
|
||||
|
||||
起初,我无法让 Ubuntu Budgie 进入<ruby>即用<rt>live</rt></ruby>环境来安装它。结果发现 Ubuntu Budgie 试图通过 EFI 来启动,我从 [Ubuntu Budgie 论坛][14]得到了解决方案。
|
||||
|
||||
当出现紫色的闪屏时,我必须按下 `ESC` 键并选择 `legacy`。之后,它就如常启动了,安装也没有问题了。我只在 Ubuntu Budgie 上遇到过这个问题。我下载并尝试了 Ubuntu MATE 20.04 ISO,但没有遇到类似的问题。
|
||||
|
||||
### Ubuntu Budgie 20.04 的体验
|
||||
|
||||
![][15]
|
||||
|
||||
除了这个安装上的小问题,我使用 Ubuntu Budgie 的体验非常愉快。自 [Ikey][16] 第一次创建 Budgie 桌面以来,Budgie 桌面已经进步了很多,并且已经成为一个非常成熟的选择。Ubuntu Budgie 的目标是“生产一个面向桌面的传统发行版”。它确实做到了极致。他们所做的所有改变都在不断地为他们的产品增添更多的光彩。
|
||||
|
||||
总的来说,Ubuntu Budgie 是一个非常漂亮的发行版。从默认的主题到壁纸选择,你可以看出他们付出了很多努力,视觉体验非常吸引人。
|
||||
|
||||
需要注意的是,Ubuntu Budgie 并不适合低配置的系统。我在戴尔 Latitude D630 上运行它。在没有打开任何应用程序的情况下,它使用了大约 700MB 的内存。
|
||||
|
||||
在 Ubuntu Budgie 中,让我喜欢的部分超乎我的预期,其中一个部分是 [Tilix 终端模拟器][17]。Tilix 允许你在右侧或下方添加终端窗口。它有很多很多功能,我简直爱死了它,我打算在我的其他 Linux 系统上也安装它。
|
||||
|
||||
### 关于 Ubuntu Budgie 20.04 的最后感想
|
||||
|
||||
Ubuntu Budgie 是众多官方版本中一个很受欢迎的新版本。Budgie 给人的感觉非常流畅和精致。它不会让你觉得碍手碍脚,而是帮你完成工作。
|
||||
|
||||
如果你厌倦了当前的桌面环境,想体验一下新的东西,不妨来看看。如果你对当前的环境感到满意,那么就试试 Ubuntu Budgie 的即用 DVD。你可能会喜欢上它。
|
||||
|
||||
![关于 Ubuntu Budgie][18]
|
||||
|
||||
你是否已经尝试过 Ubuntu 20.04 Budgie?你对它的使用体验如何?如果没有用过,你现在使用的是哪个版本的 Ubuntu 20.04?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-budgie-20-04-review/
|
||||
|
||||
作者:[John Paul][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://itsfoss.com/author/john/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/download-ubuntu-20-04/
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-busgie-desktop.png?resize=800%2C500&ssl=1
|
||||
[3]: https://ubuntubudgie.org/
|
||||
[4]: https://itsfoss.com/which-ubuntu-install/
|
||||
[5]: https://en.wikipedia.org/wiki/Budgie_
|
||||
[6]: https://ubuntubudgie.org/about-us/
|
||||
[7]: https://itsfoss.com/ubuntu-budgie-18-review/
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-desktop-settings.jpeg?ssl=1
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-welcome.png?resize=800%2C472&ssl=1
|
||||
[10]: https://ubuntubudgie.org/2020/04/21/ubuntu-budgie-20-04lts-release-notes-for-18-04-upgraders/
|
||||
[11]: https://ubuntubudgie.org/downloads/
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-applications.jpeg?ssl=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-ram-usage.png?resize=800%2C600&ssl=1
|
||||
[14]: https://discourse.ubuntubudgie.org/t/cant-get-ub-to-boot/3397
|
||||
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-20-04.jpg?ssl=1
|
||||
[16]: https://itsfoss.com/ikey-doherty-serpent-interview/
|
||||
[17]: https://gnunn1.github.io/tilix-web/
|
||||
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-about.png?resize=800%2C648&ssl=1
|
@ -0,0 +1,171 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12341-1.html)
|
||||
[#]: subject: (Ubuntu MATE 20.04 LTS Review: Better Than Ever)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-mate-20-04-review/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Ubuntu MATE 20.04 LTS:士别三日,当刮目相待
|
||||
======
|
||||
|
||||
Ubuntu MATE 20.04 LTS 无疑是最流行的 [Ubuntu 官方特色版本][1]之一。
|
||||
|
||||
不仅仅是我,这份[Ubuntu 20.04 调查报告][2]也持同样观点。不过不管流行与否,它都是一个令人印象深刻的 Linux 发行版,尤其是用在较旧的硬件上时。事实上,它也是可用的[最轻量的 Linux 发行版][3]之一。
|
||||
|
||||
所以,我想在一个虚拟机中尝试一下,为你提供一个概览,这样你可以了解其中有何值得期盼的变化,以及是否值得尝试。
|
||||
|
||||
### 在 Ubuntu MATE 20.04 LTS 中有什么新功能?
|
||||
|
||||
- [video](https://www.youtube.com/embed/WBZyXDHw4HA)
|
||||
|
||||
Ubuntu MATE 20.04 LTS 的主要亮点应该是增加了 MATE Desktop 1.24。
|
||||
|
||||
你可以期待 MATE Desktop 1.24 中的所有新特色都被打包到 Ubuntu MATE 20.04 中。除此之外,还有很多重要的变化、改进和增补。
|
||||
|
||||
这是 Ubuntu MATE 20.04 中变化的概述:
|
||||
|
||||
* 新增 MATE Desktop 1.24
|
||||
* 大量视觉改进
|
||||
* 数十处错误修复
|
||||
* 基于 [Linux 内核 5.4][5] 系列
|
||||
* 添加了实验性的 [ZFS][6] 支持
|
||||
* 添加了来自 [Feral Interactive][7] 的 GameMode
|
||||
* 一些软件包更新
|
||||
|
||||
现在,为了更好地了解 Ubuntu MATE 20.04,我将给你提供更多的细节。
|
||||
|
||||
### 用户体验改善
|
||||
|
||||
![][8]
|
||||
|
||||
考虑到越来越多的用户倾向于在桌面上使用 Linux,而用户体验在桌面中起着至关重要的作用。
|
||||
|
||||
如果有一些易于使用和令人愉悦的东西,那么第一印象就会有很大不同。
|
||||
|
||||
对于 Ubuntu MATE 20.04 LTS,我没有感到失望。就我个人而言,我是最新的 [GNOME 3.36][9] 的粉丝。我喜欢在我 [Pop!_OS 20.04][10] 上使用它,但是随着 [MATE 1.24][11] 的出现,使得 Ubuntu MATE 也同样具有很好的体验。
|
||||
|
||||
你会看到窗口管理器有一些重大更改,包括:增加了用于重新调整大小的隐形边框,HiDPI 图标渲染,重新设计了 `ALT+TAB` 工作区切换器的弹出窗口和一些其它的更改,这些是最新的 MATE 1.24 桌面环境的一部分。
|
||||
|
||||
![][12]
|
||||
|
||||
此外, MATE Tweak 也得到了一些贴心的改进,即使你更改桌面的布局,也可以保留用户偏好。新的 MATE 欢迎屏幕也会告知用户更改桌面布局的能力,因此,用户无需不断摸索就能知道这个变化。
|
||||
|
||||
此外,我最喜欢的新增功能之一是可以预览最小化的应用程序。
|
||||
|
||||
例如,你已经最小化了一个应用程序,但是你想在拉起它之前看到它的预览 —— 现在你只需将鼠标悬停在任务栏上就可以做到这一点,如下图所示:
|
||||
|
||||
![][13]
|
||||
|
||||
不过,我必须指出,并不是每个应用程序都可以如预期般的工作。因此,这个功能是有缺陷的,还需要改进。
|
||||
|
||||
### 应用程序新增或升级
|
||||
|
||||
![][14]
|
||||
|
||||
在 MATE 20.04 中,你会注意到有一个新的固件更新器,它是 [fwupd][15] 的 GTK 前端。你可以使用这个更新器来轻松地管理你的固件驱动。
|
||||
|
||||
这个版本也使用 Evolution 替换了 Thunderbird 电子邮件客户端。尽管 [Thunderbird][16] 是一个非常流行的电子邮件客户端,但是 [Evolution][17] 与 MATE 桌面集成得更好,并且证明它更有用。
|
||||
|
||||
![][18]
|
||||
|
||||
考虑到我们已经搭载了 MATE 1.24,你也将发现一个新的时间和日期管理应用程序。不仅如此,如果你需要一个放大镜,Ubuntu MATE 20.04 还内置了 [Magnus][19]。
|
||||
|
||||
![][20]
|
||||
|
||||
Ubuntu MATE 20.04 也包括了众多预安装的软件包/应用程序的升级包。
|
||||
|
||||
![][21]
|
||||
|
||||
尽管这些是小的增补,但却能在很大程度上帮助发行版变得更有用。
|
||||
|
||||
### Linux Kernel 5.4
|
||||
|
||||
Ubuntu MATE 20.04 带有 2019 年最后一个主要的稳定版内核,即 [Linux 内核 5.4][5]。
|
||||
|
||||
使用该内核,你可以获得原生的 [exFAT 支持][22]、改进的硬件支持。更不用说,拥有 [WireGuard][23] VPN 的支持也是一件极好的事。
|
||||
|
||||
所以,你会注意到 Linux Kernel 5.4 的众多好处,包括内核锁定功能。如果你好奇,你可以阅读我们关于 [Linux Kernel 5.4][5] 的新闻报道来了解更多的细节。
|
||||
|
||||
### 增加了 Feral Interactive 的 GameMode
|
||||
|
||||
以将游戏带到 Linux 平台而闻名的 Feral Interactive 带来了一款实用的命令行工具,即 [GameMode][7]。
|
||||
|
||||
它没有提供图形界面,但是在启动一个游戏前,你可以使用命令行请求临时性的系统优化。
|
||||
|
||||
虽然这可能不会给每个系统都带来很大的不同,而是给玩游戏提供了更多的资源,并且 GameMode 可以确保你获得必要的优化。
|
||||
|
||||
### 实验性的 ZFS 安装选项
|
||||
|
||||
你可以使用 ZFS 作为根文件系统了。值得注意的是,它是一个实验性的功能,如果你不确定自己在做什么,那么就不应该使用它。
|
||||
|
||||
要更好地了解 ZFS,我建议你阅读我们的一篇文章,[John Paul][24] 所写的《[ZFS 是什么][6]》的文章。
|
||||
|
||||
### 性能和其它的改进
|
||||
|
||||
Ubuntu MATE 是一款完美的轻量级发行版,同时也是一款适合现代台式机的发行版。
|
||||
|
||||
![][25]
|
||||
|
||||
在这个评测中,我没有运行任何特殊的基准测试工具,以一个普通用户来说,我在虚拟机设置中没有发现任何性能问题。我在一台使用了一颗 i5-7400 处理器、配备 GTX 1050 显卡和 16 GB 内存的主机系统上进行了测试。并且,我将 7 GB 的内存 + 768 MB 的显存 + 2 个处理器核心分配给了虚拟机。
|
||||
|
||||
![][26]
|
||||
|
||||
如果你要自己测试它,请随时告诉我你对它的感觉如何。
|
||||
|
||||
总的来说,除了所有主要的改进之外,还有一些细微的改变/修复/改进,使得 Ubuntu MATE 20.04 LTS 成为了一个很好的升级版本。
|
||||
|
||||
### 我应该升级吗?
|
||||
|
||||
如果你正在运行 Ubuntu MATE 19.10,你应该立即升级它,因为它的支持将在 2020 年 6 月结束。
|
||||
|
||||
对于 Ubuntu MATE 18.04 用户(支持到 2021 年 4 月)来说,这取决于你的需求。如果你需要最新发布版本的功能,你应该选择立即升级它。
|
||||
|
||||
但是,如果你不一定需要新的功能,你可以查看[现存的错误列表][27] 并加入 [Ubuntu MATE 社区][28] 来了解更多最新发布版本的问题。
|
||||
|
||||
在你做完必要的研究后,你可以继续升级你的系统到 Ubuntu MATE 20.04 LTS,它将支持到 2023 年 4 月。
|
||||
|
||||
你试过最新的 Ubuntu MATE 20.04 吗?你认为它怎么样?在评论中让我知道。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-mate-20-04-review/
|
||||
|
||||
作者:[Ankush Das][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/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/which-ubuntu-install/
|
||||
[2]: https://ubuntu.com/blog/ubuntu-20-04-survey-results
|
||||
[3]: https://itsfoss.com/lightweight-linux-beginners/
|
||||
[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
|
||||
[5]: https://itsfoss.com/linux-kernel-5-4/
|
||||
[6]: https://itsfoss.com/what-is-zfs/
|
||||
[7]: https://github.com/FeralInteractive/gamemode
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-20-04.jpg?ssl=1
|
||||
[9]: https://itsfoss.com/gnome-3-36-release/
|
||||
[10]: https://linux.cn/article-12175-1.html
|
||||
[11]: https://mate-desktop.org/blog/2020-02-10-mate-1-24-released/
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-desktop-layout.png?ssl=1
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-minimized-app.png?ssl=1
|
||||
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-20-04-firmware.png?ssl=1
|
||||
[15]: https://fwupd.org
|
||||
[16]: https://www.thunderbird.net/en-US/
|
||||
[17]: https://wiki.gnome.org/Apps/Evolution
|
||||
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-evolution.png?ssl=1
|
||||
[19]: https://kryogenix.org/code/magnus/
|
||||
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-magnus.jpg?ssl=1
|
||||
[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-apps.png?ssl=1
|
||||
[22]: https://cloudblogs.microsoft.com/opensource/2019/08/28/exfat-linux-kernel/
|
||||
[23]: https://wiki.ubuntu.com/WireGuard
|
||||
[24]: https://itsfoss.com/author/john/
|
||||
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-system-reosource.jpg?ssl=1
|
||||
[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-focal-neofetch.png?ssl=1
|
||||
[27]: https://bugs.launchpad.net/ubuntu-mate
|
||||
[28]: https://ubuntu-mate.community/
|
@ -0,0 +1,353 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12356-1.html)
|
||||
[#]: subject: (Simplify data visualization in Python with Plotly)
|
||||
[#]: via: (https://opensource.com/article/20/5/plotly-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
|
||||
使用 Plotly 来简化 Python 中的数据可视化
|
||||
======
|
||||
|
||||
> Plotly 是一个数据绘图库,具有整洁的接口,它旨在允许你构建自己的 API。
|
||||
|
||||

|
||||
|
||||
Plotly 是一个绘图生态系统,可以让你在 [Python][2] 以及 JavaScript 和 R 中进行绘图。在本文中,我将重点介绍[使用 Python 库进行绘图][3]。
|
||||
|
||||
Plotly 有三种不同的 Python API,你可以选择不同的方法来使用它:
|
||||
|
||||
* 类似于 Matplotlib 的面向对象的 API
|
||||
* 数据驱动的 API,通过构造类似 JSON 的数据结构来定义绘图
|
||||
* 类似于 Seaborn 的高级绘图接口,称为 “Plotly Express” API
|
||||
|
||||
我将通过使用每个 API 来绘制相同的图来探索它们:英国大选结果的分组柱状图。
|
||||
|
||||
在我们进一步探讨之前,请注意,你可能需要调整你的 Python 环境来让这段代码运行,包括以下内容:
|
||||
|
||||
- 运行最新版本的Python([Linux][4]、[Mac][5] 和 [Windows][6] 的说明)
|
||||
- 确认你运行的 Python 版本能与这些库一起工作
|
||||
|
||||
数据可在线获得,可以用 Pandas 导入。
|
||||
|
||||
```
|
||||
import pandas as pd
|
||||
df = pd.read_csv('https://anvil.works/blog/img/plotting-in-python/uk-election-results.csv')
|
||||
```
|
||||
|
||||
现在我们可以继续进行了。
|
||||
|
||||
### 使用图对象来绘制图
|
||||
|
||||
Plotly 面向对象的 API 被称为 `graph_objects`,它有点类似于 [Matplotlib 的面向对象 API][7]。
|
||||
|
||||
要创建一个柱状图,你可以构造一个包含四个柱状图的对象:
|
||||
|
||||
```
|
||||
# 导入 Plotly 和数据
|
||||
import plotly.graph_objects as go
|
||||
from votes import wide as df
|
||||
|
||||
# 得到 x 列表
|
||||
years = df['year']
|
||||
x = list(range(len(years)))
|
||||
|
||||
# 定义绘图
|
||||
bar_plots = [
|
||||
go.Bar(x=x, y=df['conservative'], name='Conservative', marker=go.bar.Marker(color='#0343df')),
|
||||
go.Bar(x=x, y=df['labour'], name='Labour', marker=go.bar.Marker(color='#e50000')),
|
||||
go.Bar(x=x, y=df['liberal'], name='Liberal', marker=go.bar.Marker(color='#ffff14')),
|
||||
go.Bar(x=x, y=df['others'], name='Others', marker=go.bar.Marker(color='#929591')),
|
||||
]
|
||||
|
||||
# 指定样式
|
||||
layout = go.Layout(
|
||||
title=go.layout.Title(text="Election results", x=0.5),
|
||||
yaxis_title="Seats",
|
||||
xaxis_tickmode="array",
|
||||
xaxis_tickvals=list(range(27)),
|
||||
xaxis_ticktext=tuple(df['year'].values),
|
||||
)
|
||||
|
||||
# 绘制柱状图
|
||||
fig = go.Figure(data=bar_plots, layout=layout)
|
||||
|
||||
# 告诉 Plotly 去渲染
|
||||
fig.show()
|
||||
```
|
||||
|
||||
与 Matplotlib 不同的是,你无需手动计算柱状图的 `x` 轴位置,Plotly 会帮你适配。
|
||||
|
||||
最终结果图:
|
||||
|
||||
![A multi-bar plot made using Graph Objects][8]
|
||||
|
||||
*A multi-bar plot made using Graph Objects (© 2019 [Anvil][9])*
|
||||
|
||||
### 使用 Python 数据结构来绘图
|
||||
|
||||
你还可以使用 Python 基本数据结构来定义绘图,它与面对对象 API 具有相同的结构。这直接对应于 Plotly 的 JavaScript 实现的 JSON API。
|
||||
|
||||
```
|
||||
# 定义绘图数据
|
||||
fig = {
|
||||
'data': [
|
||||
{'type': 'bar', 'x': x, 'y': df['conservative'], 'name': 'Conservative', 'marker': {'color': '#0343df'}},
|
||||
{'type': 'bar', 'x': x, 'y': df['labour'], 'name': 'Labour', 'marker': {'color': '#e50000'}},
|
||||
{'type': 'bar', 'x': x, 'y': df['liberal'], 'name': 'Liberal', 'marker': {'color': '#ffff14'}},
|
||||
{'type': 'bar', 'x': x, 'y': df['others'], 'name': 'Others', 'marker': {'color': '#929591'}},
|
||||
],
|
||||
'layout': {
|
||||
'title': {'text': 'Election results', 'x': 0.5},
|
||||
'yaxis': {'title': 'Seats'},
|
||||
'xaxis': {
|
||||
'tickmode': 'array',
|
||||
'tickvals': list(range(27)),
|
||||
'ticktext': tuple(df['year'].values),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 告诉 Plotly 去渲染它
|
||||
pio.show(fig)
|
||||
```
|
||||
|
||||
最终结果与上次完全相同:
|
||||
|
||||
![A multi-bar plot made using JSON-like data structures][10]
|
||||
|
||||
*A multi-bar plot made using JSON-like data structures (© 2019 [Anvil][9])*
|
||||
|
||||
#### 使用 Plotly Express 进行绘图
|
||||
|
||||
[Plotly Express][11] 是对图对象进行封装的高级 API。
|
||||
|
||||
你可以使用一行代码来绘制柱状图:
|
||||
|
||||
```
|
||||
# 导入 Plotly 和数据
|
||||
import plotly.express as px
|
||||
from votes import long as df
|
||||
|
||||
# 定义颜色字典获得自定义栏颜色
|
||||
cmap = {
|
||||
'Conservative': '#0343df',
|
||||
'Labour': '#e50000',
|
||||
'Liberal': '#ffff14',
|
||||
'Others': '#929591',
|
||||
}
|
||||
|
||||
# 生成图
|
||||
fig = px.bar(df, x="year", y="seats", color="party", barmode="group", color_discrete_map=cmap)
|
||||
```
|
||||
|
||||
这里使用了<ruby>[长表][12]<rt>Long Form</rt></ruby> 数据,也称为“整洁数据”。这些列代表年份、政党和席位,而不是按政党划分。这与在 [Seaborn][13] 中制作柱状图非常相似。
|
||||
|
||||
```
|
||||
>> print(long)
|
||||
year party seats
|
||||
0 1922 Conservative 344
|
||||
1 1923 Conservative 258
|
||||
2 1924 Conservative 412
|
||||
3 1929 Conservative 260
|
||||
4 1931 Conservative 470
|
||||
.. ... ... ...
|
||||
103 2005 Others 30
|
||||
104 2010 Others 29
|
||||
105 2015 Others 80
|
||||
106 2017 Others 59
|
||||
107 2019 Others 72
|
||||
|
||||
[108 rows x 3 columns]
|
||||
```
|
||||
|
||||
你可以访问底层的图对象 API 进行详细调整。如添加标题和 `y` 轴标签:
|
||||
|
||||
```
|
||||
# 使用图对象 API 来调整绘图
|
||||
import plotly.graph_objects as go
|
||||
fig.layout = go.Layout(
|
||||
title=go.layout.Title(text="Election results", x=0.5),
|
||||
yaxis_title="Seats",
|
||||
)
|
||||
```
|
||||
|
||||
最后,让 Plotly 渲染:
|
||||
|
||||
```
|
||||
fig.show()
|
||||
```
|
||||
|
||||
这将在未使用的端口上运行一个临时 Web 服务器,并打开默认的 Web 浏览器来查看图像(Web 服务器将会马上被关闭)。
|
||||
|
||||
不幸的是,结果并不完美。`x` 轴被视为整数,因此两组之间的距离很远且很小,这使得我们很难看到趋势。
|
||||
|
||||
![使用 Plotly Express 制作的柱状图][14]
|
||||
|
||||
*A multi-bar plot made using Plotly Express (© 2019 [Anvil][9])*
|
||||
|
||||
你可能会尝试通过将 `x` 值转换为字符串来使 Plotly Express 将其视为字符串,这样它就会以均匀的间隔和词法顺序来绘制。不幸的是,它们的间隔还是很大,像在 `graph_objects`中那样设置 `xaxis_tickvals` 也不行。
|
||||
|
||||
与 [Seaborn][13] 中的类似示例不同,在这种情况下,抽象似乎没有提供足够的[应急方案][15]来提供你想要的东西,但是也许你可以编写*自己*的 API?
|
||||
|
||||
### 构建自己的 Plotly API
|
||||
|
||||
对 Plotly 的操作方式不满意?那就构建自己的 Plotly API!
|
||||
|
||||
Plotly 的核心是一个 JavaScript 库,它使用 [D3][16] 和 [stack.gl][17] 进行绘图。JavaScript 库的接口使用指定的 JSON 结构来绘图。因此,你只需要输出 JavaScript 库喜欢使用的 JSON 结构就好了。
|
||||
|
||||
Anvil 这样做是为了创建一个完全在浏览器中工作的 Python Plotly API。
|
||||
|
||||
![Ployly 使用 JavaScript 库创建图形,由其它语言库通过 JSON 使用][18]
|
||||
|
||||
*Plotly uses a JavaScript library to create plots, driven by libraries in other languages via JSON (© 2019 [Anvil][9])*
|
||||
|
||||
在 Anvil 版本中,你可以同时使用图对象 API 和上面介绍的 Python 数据结构方法。运行完全相同的命令,将数据和布局分配给 Anvil 应用程序中的 [Plot 组件][19]。
|
||||
|
||||
这是用 Anvil 的客户端 Python API 绘制的多列柱状图:
|
||||
|
||||
```
|
||||
# 导入 Anvil 库
|
||||
from ._anvil_designer import EntrypointTemplate
|
||||
from anvil import *
|
||||
import anvil.server
|
||||
|
||||
# 导入客户端 Plotly
|
||||
import plotly.graph_objs as go
|
||||
|
||||
# 这是一个 Anvil 表单
|
||||
class Entrypoint(EntrypointTemplate):
|
||||
def __init__(self, **properties):
|
||||
# Set Form properties and Data Bindings.
|
||||
self.init_components(**properties)
|
||||
|
||||
# 从服务器获取数据
|
||||
data = anvil.server.call('get_election_data')
|
||||
|
||||
# 获取一个方便的 x 值列表
|
||||
years = data['year']
|
||||
x = list(range(len(years)))
|
||||
|
||||
# 定义绘图
|
||||
bar_plots = [
|
||||
go.Bar(x=x, y=data['conservative'], name='Conservative', marker=go.Marker(color='#0343df')),
|
||||
go.Bar(x=x, y=data['labour'], name='Labour', marker=go.Marker(color='#e50000')),
|
||||
go.Bar(x=x, y=data['liberal'], name='Liberal', marker=go.Marker(color='#ffff14')),
|
||||
go.Bar(x=x, y=data['others'], name='Others', marker=go.Marker(color='#929591')),
|
||||
]
|
||||
# 规定布局
|
||||
layout = {
|
||||
'title': 'Election results',
|
||||
'yaxis': {'title': 'Seats'},
|
||||
'xaxis': {
|
||||
'tickmode': 'array',
|
||||
'tickvals': list(range(27)),
|
||||
'ticktext': data['year'],
|
||||
},
|
||||
}
|
||||
|
||||
# 生成多列柱状图
|
||||
self.plot_1.data = bar_plots
|
||||
self.plot_1.layout = layout
|
||||
```
|
||||
|
||||
绘图逻辑与上面相同,但是它完全在 Web 浏览器中运行,绘图是由用户计算机上的 Plotly JavaScript 库完成的!与本系列的所有其它 [Python 绘图库][3]相比,这是一个很大的优势。因为其它 Python 库都需要在服务器上运行。
|
||||
|
||||
这是在 Anvil 应用中运行的交互式 Plotly 图:
|
||||
|
||||
![The election plot on the web using Anvil's client-side-Python Plotly library][20]
|
||||
|
||||
*The election plot on the web using Anvil's [client-side-Python][21] Plotly library (© 2019 [Anvil][9])*
|
||||
|
||||
你可以[复制此示例][22]作为一个 Anvil 应用程序(注意:Anvil 需要注册才能使用)。
|
||||
|
||||
在前端运行 Plotly 还有另一个优势:它为自定义交互行为提供了更多选项。
|
||||
|
||||
### 在 Plotly 中自定义交互
|
||||
|
||||
Plotly 绘图不仅是动态的,你可以自定义它们的互动行为。例如,你可以在每个柱状图中使用 `hovertemplate` 自定义工具提示的格式:
|
||||
|
||||
```
|
||||
go.Bar(
|
||||
x=x,
|
||||
y=df['others'],
|
||||
name='others',
|
||||
marker=go.bar.Marker(color='#929591'),
|
||||
hovertemplate='Seats: <b>%{y}</b>',
|
||||
),
|
||||
```
|
||||
|
||||
当你把这个应用到每个柱状图时,你会看到以下结果:
|
||||
|
||||
![A multi-bar plot with custom tool-tips][23]
|
||||
|
||||
*A multi-bar plot with custom tool-tips (© 2019 [Anvil][9])*
|
||||
|
||||
这很有用,当你想要在某些事件发生时执行任何你想要的代码就更好了(例如,当用户将鼠标悬停在栏上,你想要显示一个相关选举的信息框)。在 Anvil 的 Plotly 库中,你可以将事件处理程序绑定到诸如悬停之类的事件,这使得复杂的交互成为可能。
|
||||
|
||||
![A multi-bar plot with a hover event handler][24]
|
||||
|
||||
*A multi-bar plot with a hover event handler (© 2019 [Anvil][9])*
|
||||
|
||||
你可以通过将方法绑定到绘图的悬停事件来实现:
|
||||
|
||||
```
|
||||
def plot_1_hover(self, points, **event_args):
|
||||
"""This method is called when a data point is hovered."""
|
||||
i = points[0]['point_number']
|
||||
self.label_year.text = self.data['year'][i]
|
||||
self.label_con.text = self.data['conservative'][i]
|
||||
self.label_lab.text = self.data['labour'][i]
|
||||
self.label_lib.text = self.data['liberal'][i]
|
||||
self.label_oth.text = self.data['others'][i]
|
||||
url = f"https://en.wikipedia.org/wiki/{self.data['year'][i]}_United_Kingdom_general_election"
|
||||
self.link_more_info.text = url
|
||||
self.link_more_info.url = url
|
||||
```
|
||||
|
||||
这是一种相当极端的交互性,从开发人员的角度来看,也是一种极端的可定制性。这都要归功于 Plotly 的架构 —— 它有一个简洁的接口,明确的设计是为了让你建立自己的API。如果到处都能看到这种伟大的设计,那将会很有帮助!
|
||||
|
||||
### 使用 Bokeh 进行自定义交互
|
||||
|
||||
现在你已经了解了 Plotly 如何使用 JavaScript 来创建动态图,并且可以使用 Anvil 的客户端编写 Python 代码在浏览器中实时编辑它们。
|
||||
|
||||
Bokeh 是另一个 Python 绘图库,它可以输出可嵌入 Web 应用程序的 HTML 文档,并获得与 Plotly 提供的功能类似的动态功能(如果你想知道如何发音,那就是 “BOE-kay”)。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/plotly-python
|
||||
|
||||
作者:[Shaun Taylor-Morgan][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[MjSeven](https://github.com/MjSeven)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/shaun-taylor-morgan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph)
|
||||
[2]: https://opensource.com/resources/python
|
||||
[3]: https://linux.cn/article-12327-1.html
|
||||
[4]: https://opensource.com/article/20/4/install-python-linux
|
||||
[5]: thttps://opensource.com/article/19/5/python-3-default-mac
|
||||
[6]: https://opensource.com/article/19/8/how-install-python-windows
|
||||
[7]: https://opensource.com/article/20/5/matplotlib-python
|
||||
[8]: https://opensource.com/sites/default/files/uploads/plotly.png (A multi-bar plot made using Graph Objects)
|
||||
[9]: https://anvil.works/blog/plotting-in-plotly
|
||||
[10]: https://opensource.com/sites/default/files/uploads/plotly-pio.png (A multi-bar plot made using JSON-like data structures)
|
||||
[11]: https://plot.ly/python/plotly-express/
|
||||
[12]: https://anvil.works/blog/tidy-data
|
||||
[13]: https://opensource.com/article/20/5/seaborn-visualization-python
|
||||
[14]: https://opensource.com/sites/default/files/uploads/plotly-express.png (A multi-bar plot made using Plotly Express)
|
||||
[15]: https://anvil.works/blog/escape-hatches-and-ejector-seats
|
||||
[16]: https://d3js.org/
|
||||
[17]: http://stack.gl/
|
||||
[18]: https://opensource.com/sites/default/files/uploads/plotly-arch.png (Plotly uses a JavaScript library to create plots, driven by libraries in other languages via JSON)
|
||||
[19]: https://anvil.works/docs/client/components/plots
|
||||
[20]: https://opensource.com/sites/default/files/uploads/plotting-in-anvil.gif (The election plot on the web using Anvil's client-side-Python Plotly library)
|
||||
[21]: https://anvil.works/docs/client/python
|
||||
[22]: https://anvil.works/login?app-name=Plotting%20in%20Plotly&app-author=shaun%40anvil.works
|
||||
[23]: https://opensource.com/sites/default/files/uploads/plotly-tooltips.png (A multi-bar plot with custom tool-tips)
|
||||
[24]: https://opensource.com/sites/default/files/uploads/plotly-event-handling.gif (A multi-bar plot with a hover event handler)
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12329-1.html)
|
||||
[#]: subject: (Add interactivity to your Python plots with Bokeh)
|
||||
[#]: via: (https://opensource.com/article/20/5/bokeh-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
@ -10,13 +10,13 @@
|
||||
使用 Bokeh 为你的 Python 绘图添加交互性
|
||||
======
|
||||
|
||||
> Bokeh 中的绘图比其他一些绘图库要复杂一些,但付出额外的努力是有回报的。
|
||||
> 在 Bokeh 中绘图比其他一些绘图库要复杂一些,但付出额外的努力是有回报的。
|
||||
|
||||
![Hands on a keyboard with a Python book ][1]
|
||||

|
||||
|
||||
在这一系列文章中,我通过在每个 Python 绘图库中制作相同的多条形绘图,来了解不同 Python 绘图库的特点。这次我重点介绍的是 [Bokeh][2](读作“BOE-kay”)。
|
||||
在这一系列文章中,我通过在每个 Python 绘图库中制作相同的多条形绘图,来研究不同 Python 绘图库的特性。这次我重点介绍的是 [Bokeh][2](读作 “BOE-kay”)。
|
||||
|
||||
Bokeh 中的绘图比[其它一些绘图库][3]要复杂一些,但额外的努力是有回报的。Bokeh 的设计既允许你在网络上创建自己的交互式绘图,又能让你详细控制交互性如何工作。我将通过给我在这个系列中使用的多条形图添加一个工具提示来展示这一点。它绘制了 1966 年到 2020 年之间英国选举结果的数据。
|
||||
Bokeh 中的绘图比[其它一些绘图库][3]要复杂一些,但付出的额外努力是有回报的。Bokeh 的设计既允许你在 Web 上创建自己的交互式绘图,又能让你详细控制交互性如何工作。我将通过给我在这个系列中一直使用的多条形图添加工具提示来展示这一点。它绘制了 1966 年到 2020 年之间英国选举结果的数据。
|
||||
|
||||
![][4]
|
||||
|
||||
@ -26,10 +26,10 @@ Bokeh 中的绘图比[其它一些绘图库][3]要复杂一些,但额外的努
|
||||
|
||||
在我们继续之前,请注意你可能需要调整你的 Python 环境来让这段代码运行,包括以下:
|
||||
|
||||
- 运行最新版本的 Python ([Linux][11]、[Mac][12] 和 [Windows][13] 的说明)
|
||||
- 运行最新版本的 Python (在 [Linux][11]、[Mac][12] 和 [Windows][13] 上的说明)
|
||||
- 确认你运行的 Python 版本能与这些库一起工作。
|
||||
|
||||
网上有数据,可以用 pandas 导入。
|
||||
数据可在线获得,可以用 Pandas 导入。
|
||||
|
||||
```
|
||||
import pandas as pd
|
||||
@ -62,23 +62,20 @@ df = pd.read_csv('https://anvil.works/blog/img/plotting-in-python/uk-election-re
|
||||
|
||||
你可以把数据看成是每一个可能的 `(year, party)` 组合的一系列 `seats` 值。这正是 Bokeh 处理的方式。你需要做一个 `(year, party)` 元组的列表:
|
||||
|
||||
|
||||
```
|
||||
# Get a tuple for each possible (year, party) combination
|
||||
# 得到每种可能的 (year, party) 组合的元组
|
||||
x = [(str(r[1]['year']), r[1]['party']) for r in df.iterrows()]
|
||||
|
||||
# This comes out as [('1922', 'Conservative'), ('1923', 'Conservative'), ... ('2019', 'Others')]
|
||||
```
|
||||
|
||||
这些将是 x 值。y 值是简单的席位。
|
||||
|
||||
这些将是 `x` 值。`y` 值就是席位(`seats`)。
|
||||
|
||||
```
|
||||
y = df['seats']
|
||||
```
|
||||
|
||||
现在你的数据看起来像这样:
|
||||
|
||||
现在你的数据看起来应该像这样:
|
||||
|
||||
```
|
||||
x y
|
||||
@ -95,8 +92,7 @@ x y
|
||||
('2019', 'Others') 72
|
||||
```
|
||||
|
||||
Bokeh 需要你将数据封装在它提供的一些对象中,这样它就能给你提供交互功能。将你的 x 和 y 数据结构封装在一个 `ColumnDataSource` 对象中。
|
||||
|
||||
Bokeh 需要你将数据封装在它提供的一些对象中,这样它就能给你提供交互功能。将你的 `x` 和 `y` 数据结构封装在一个 `ColumnDataSource` 对象中。
|
||||
|
||||
```
|
||||
from bokeh.models import ColumnDataSource
|
||||
@ -104,8 +100,7 @@ Bokeh 需要你将数据封装在它提供的一些对象中,这样它就能
|
||||
source = ColumnDataSource(data={'x': x, 'y': y})
|
||||
```
|
||||
|
||||
然后构造一个 `Figure` 对象,并传入你的用 `FactorRange` 对象封装的 x 数据。
|
||||
|
||||
然后构造一个 `Figure` 对象,并传入你用 `FactorRange` 对象封装的 `x` 数据。
|
||||
|
||||
```
|
||||
from bokeh.plotting import figure
|
||||
@ -114,7 +109,7 @@ Bokeh 需要你将数据封装在它提供的一些对象中,这样它就能
|
||||
p = figure(x_range=FactorRange(*x), width=2000, title="Election results")
|
||||
```
|
||||
|
||||
你需要让 Bokeh 创建一个颜色表--这是一个特殊的 `DataSpec` 字典,它根据你给它的颜色映射生成。在这种情况下,颜色表是一个简单的党派名称和一个十六进制值之间的映射。
|
||||
你需要让 Bokeh 创建一个颜色表,这是一个特殊的 `DataSpec` 字典,它根据你给它的颜色映射生成。在这种情况下,颜色表是一个简单的党派名称和一个十六进制值之间的映射。
|
||||
|
||||
```
|
||||
from bokeh.transform import factor_cmap
|
||||
@ -130,16 +125,14 @@ Bokeh 需要你将数据封装在它提供的一些对象中,这样它就能
|
||||
|
||||
现在你可以创建条形图了:
|
||||
|
||||
|
||||
```
|
||||
p.vbar(x='x', top='y', width=0.9, source=source, fill_color=fill_color, line_color=fill_color)
|
||||
```
|
||||
|
||||
Bokeh 图表上数据的可视化表示被称为“<ruby>字形<rt>glyphs</rt></ruby>”,因此你已经创建了一组条形字形。
|
||||
Bokeh 图表上数据的可视化形式被称为“<ruby>字形<rt>glyphs</rt></ruby>”,因此你已经创建了一组条形字形。
|
||||
|
||||
调整图表的细节,让它看起来像你想要的样子。
|
||||
|
||||
|
||||
```
|
||||
p.y_range.start = 0
|
||||
p.x_range.range_padding = 0.1
|
||||
@ -150,7 +143,6 @@ Bokeh 图表上数据的可视化表示被称为“<ruby>字形<rt>glyphs</rt></
|
||||
|
||||
最后,告诉 Bokeh 你现在想看你的绘图:
|
||||
|
||||
|
||||
```
|
||||
from bokeh.io import show
|
||||
|
||||
@ -163,18 +155,17 @@ Bokeh 图表上数据的可视化表示被称为“<ruby>字形<rt>glyphs</rt></
|
||||
|
||||
*Bokeh 中的多条形绘图(©2019年[Anvil][5])*
|
||||
|
||||
这已经有了一些互动功能,比如方框缩放。
|
||||
它已经有了一些互动功能,比如盒子缩放。
|
||||
|
||||
![][7] 。
|
||||
|
||||
*Bokeh 内置的方框缩放(©2019[Anvil][5])*
|
||||
*Bokeh 内置的盒子缩放(©2019[Anvil][5])*
|
||||
|
||||
但 Bokeh 的厉害之处在于你可以添加自己的交互性。在下一节中,我们通过在条形图中添加工具提示来探索这个问题。
|
||||
|
||||
### 给条形图添加工具提示
|
||||
|
||||
要在条形图上添加工具提示,你只需要创建一个 `HoverTool` 对象并将其添加到你的图中。
|
||||
|
||||
要在条形图上添加工具提示,你只需要创建一个 `HoverTool` 对象并将其添加到你的绘图中。
|
||||
|
||||
```
|
||||
h = HoverTool(tooltips=[
|
||||
@ -192,20 +183,15 @@ Bokeh 图表上数据的可视化表示被称为“<ruby>字形<rt>glyphs</rt></
|
||||
|
||||
*选举图,现在带有工具提示(© 2019 [Anvil][5])*
|
||||
|
||||
多亏了 Bokeh 的 HTML 输出,当你将绘图嵌入到 Web 应用中时,你可以获得完整的交互体验。你可以把这个例子复制为一个 Anvil 应用[这里][9](注:Anvil 需要注册才能使用)。
|
||||
借助 Bokeh 的 HTML 输出,将绘图嵌入到 Web 应用中时,你可以获得完整的交互体验。你可以在[这里][9]把这个例子复制为 Anvil 应用(注:Anvil 需要注册才能使用)。
|
||||
|
||||
现在,你可以看到在 Bokeh 中用 `ColumnDataSource` 等对象包装所有数据而付出额外努力的原因了。作为回报,你可以相对轻松地添加交互性。
|
||||
现在,你可以看到付出额外努力在 Bokeh 中将所有数据封装在 `ColumnDataSource` 等对象的原因了。作为回报,你可以相对轻松地添加交互性。
|
||||
|
||||
### 回归简单:Altair
|
||||
|
||||
Bokeh 是四大最流行的绘图库之一,本系列将研究[它们各自的特别之处][3]。
|
||||
|
||||
我也在研究几个因其有趣的方法而脱颖而出的库。接下来,我将看看 [Altair][10],它的声明式 API 意味着它可以做出非常复杂的情节,而不会让你头疼。
|
||||
|
||||
* * *
|
||||
|
||||
*本文根据 Anvil 博客上的[如何使用 Bokeh 制作绘图][5]改编,经允许后转载。*
|
||||
|
||||
我也在研究几个因其有趣的方法而脱颖而出的库。接下来,我将看看 [Altair][10],它的声明式 API 意味着它可以做出非常复杂的绘图,而不会让你头疼。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -214,7 +200,7 @@ via: https://opensource.com/article/20/5/bokeh-python
|
||||
作者:[Shaun Taylor-Morgan][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
@ -222,7 +208,7 @@ via: https://opensource.com/article/20/5/bokeh-python
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book )
|
||||
[2]: https://bokeh.org/
|
||||
[3]: https://opensource.com/article/20/4/plot-data-python
|
||||
[3]: https://linux.cn/article-12327-1.html
|
||||
[4]: https://opensource.com/sites/default/files/uploads/bokeh-closeup.png (A zoomed-in view on the plot)
|
||||
[5]: https://anvil.works/blog/plotting-in-bokeh
|
||||
[6]: https://opensource.com/sites/default/files/uploads/bokeh_0.png (A multi-bar plot in Bokeh)
|
298
published/202006/20200601 How to write a VS Code extension.md
Normal file
298
published/202006/20200601 How to write a VS Code extension.md
Normal file
@ -0,0 +1,298 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12310-1.html)
|
||||
[#]: subject: (How to write a VS Code extension)
|
||||
[#]: via: (https://opensource.com/article/20/6/vs-code-extension)
|
||||
[#]: author: (Ashique Hussain Ansari https://opensource.com/users/uidoyen)
|
||||
|
||||
如何编写 VS Code 扩展
|
||||
======
|
||||
|
||||
> 通过为流行的代码编辑器编写自己的扩展来添加缺失的功能。
|
||||
|
||||

|
||||
|
||||
Visual Studio Code(VS Code)是微软为 Linux、Windows 和 macOS 创建的跨平台代码编辑器。遗憾的是,微软版本的 [VS Code][2] 是在 [Microsoft Software License][3] 下发布的,这不是一个开源的许可证。然而,它的源代码是开源的,在 MIT 许可证下由 [VSCodium][4] 项目发布。
|
||||
|
||||
VSCodium 和 VS Code一样,支持扩展、内嵌式 Git 控制、GitHub 集成、语法高亮、调试、智能代码补完、代码片段等。换句话说,对于大多数用户来说,使用 VS Code 和 VSCodium 没有什么区别,而且后者是完全开源的!
|
||||
|
||||
### 什么是 VS Code 扩展?
|
||||
|
||||
<ruby>扩展<rt>extension</rt></ruby>可以让你为 VS Code 或 VSCodium 添加功能。你可以在 GUI 中或从终端安装扩展。
|
||||
|
||||
你也可以构建自己的扩展。有几个你可能想学习如何构建扩展的原因:
|
||||
|
||||
1. **想要添加一些功能:** 如果缺失你想要的功能,你可以创建一个扩展来添加它。
|
||||
2. **为了乐趣和学习:** 扩展 API 允许你探索 VSCodium 是如何工作的,这是一件有趣的事情。
|
||||
3. **为了提高您的技能:** 创建扩展可以提高你的编程技能。
|
||||
4. **为了成名:** 创建一个对他人有用的扩展可以提高你的公众形象。
|
||||
|
||||
### 安装工具
|
||||
|
||||
在你开始之前,你必须已经安装了 [Node.js][5]、[npm][6] 和 VS Code 或 [VSCodium][4]。
|
||||
|
||||
要生成一个扩展,你还需要以下工具:[Yeoman][7],是一个开源的客户端脚手架工具,可以帮助你搭建新项目;以及 [vscode-generator-code][8],是 VS Code 团队创建的 Yeoman 生成器。
|
||||
|
||||
### 构建一个扩展
|
||||
|
||||
在本教程中,你将构建一个扩展,它可以为应用程序初始化一个 Docker 镜像。
|
||||
|
||||
#### 生成一个扩展骨架
|
||||
|
||||
要在全局范围内安装并运行 Yeoman 生成器,请在命令提示符或终端中输入以下内容:
|
||||
|
||||
```
|
||||
npm install -g yo generator-code
|
||||
```
|
||||
|
||||
导航到要生成扩展的文件夹,键入以下命令,然后按回车:
|
||||
|
||||
```
|
||||
yo code
|
||||
```
|
||||
|
||||
根据提示,你必须回答一些关于你的扩展的问题:
|
||||
|
||||
* **你想创建什么类型的扩展?** 使用上下箭头选择其中一个选项。在本文中,我将只介绍第一个选项,`New Extension (TypeScript)`。
|
||||
* **你的扩展名称是什么?** 输入你的扩展名称。我的叫 `initdockerapp`。(我相信你会有一个更好的名字。)
|
||||
* **你的扩展的标识符是什么?** 请保持原样。
|
||||
* **你的扩展的描述是什么?** 写一些关于你的扩展的内容(你可以现在填写或稍后编辑它)。
|
||||
* **初始化 Git 仓库?** 这将初始化一个 Git 仓库,你可以稍后添加 `set-remote`。
|
||||
* **使用哪个包管理器?** 你可以选择 `yarn` 或 `npm`;我使用 `npm`。
|
||||
|
||||
按回车键后,就会开始安装所需的依赖项。最后显示:
|
||||
|
||||
> "Your extension **initdockerapp** has been created!"
|
||||
|
||||
干的漂亮!
|
||||
|
||||
### 检查项目的结构
|
||||
|
||||
检查你生成的东西和项目结构。导航到新的文件夹,并在终端中键入 `cd initdockerapp`。
|
||||
|
||||
一旦你进入该目录,键入 `.code`。它将在你的编辑器中打开,看起来像这样。
|
||||
|
||||
![Project file structure in VSCodium][9]
|
||||
|
||||
(Hussain Ansari, [CC BY-SA 4.0][10])
|
||||
|
||||
最需要注意的两个文件是 `src` 文件夹内的 `package.json` 和 `extension.ts`。
|
||||
|
||||
#### package.json
|
||||
|
||||
首先来看看 `package.json`,它应该是这样的。
|
||||
|
||||
```
|
||||
{
|
||||
"name": "initdockerapp",
|
||||
"displayName": "initdockerapp",
|
||||
"description": "",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.44.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:initdockerapp.initialize"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "initdockerapp.initialize",
|
||||
"title": "Initialize A Docker Application"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint src --ext ts",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"test": "node ./out/test/runTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.44.0",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^13.11.0",
|
||||
"eslint": "^6.8.0",
|
||||
"@typescript-eslint/parser": "^2.26.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
||||
"glob": "^7.1.6",
|
||||
"mocha": "^7.1.1",
|
||||
"typescript": "^3.8.3",
|
||||
"vscode-test": "^1.3.0"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "initdockerapp",
|
||||
"displayName": "initdockerapp",
|
||||
"description": "",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.44.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:initdockerapp.initialize"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "initdockerapp.initialize",
|
||||
"title": "Initialize A Docker Application"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint src --ext ts",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"test": "node ./out/test/runTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.44.0",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^13.11.0",
|
||||
"eslint": "^6.8.0",
|
||||
"@typescript-eslint/parser": "^2.26.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
||||
"glob": "^7.1.6",
|
||||
"mocha": "^7.1.1",
|
||||
"typescript": "^3.8.3",
|
||||
"vscode-test": "^1.3.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
如果你是 Node.js 开发者,其中一些可能看起来很熟悉,因为 `name`、`description`、`version` 和 `scripts` 是 Node.js 项目的常见部分。
|
||||
|
||||
有几个部分是非常重要的:
|
||||
|
||||
* `engines`:说明该扩展将支持哪个版本的 VS Code / VSCodium。
|
||||
* `categories`:设置扩展类型;你可以从 `Languages`、`Snippets`、`Linters`、`Themes`、`Debuggers`、`Formatters`、`Keymaps` 和 `Other` 中选择。
|
||||
* `contributes`:可用于与你的扩展一起运行的命令清单。
|
||||
* `main`:扩展的入口点。
|
||||
* `activationEvents`:指定激活事件发生的时间。具体来说,这决定了扩展何时会被加载到你的编辑器中。扩展是懒加载的,所以在激活事件触发之前,它们不会被激活。
|
||||
|
||||
#### src/extension.ts
|
||||
|
||||
接下来看看 `src/extension.ts`,它应该是这样的:
|
||||
|
||||
```
|
||||
// The module 'vscode' contains the VSCodium extensibility API
|
||||
// Import the module and reference it with the alias vscode in your code below
|
||||
import * as vscode from "vscode";
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
// this method is called when your extension is activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
// Use the console to output diagnostic information (console.log) and errors (console.error)
|
||||
// This line of code will only be executed once when your extension is activated
|
||||
console.log('Congratulations, your extension "initdockerapp" is now active!');
|
||||
|
||||
// The command has been defined in the package.json file
|
||||
// Now provide the implementation of the command with registerCommand
|
||||
// The commandId parameter must match the command field in package.json
|
||||
let disposable = vscode.commands.registerCommand('initdockerapp.initialize', () => {
|
||||
// The code you place here will be executed every time your command is executed
|
||||
|
||||
let fileContent =`
|
||||
FROM node:alpine
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["npm", "start"]
|
||||
`;
|
||||
|
||||
fs.writeFile(path.join(vscode.workspace.rootPath, "Dockerfile"), fileContent, (err:any) => {
|
||||
if (err) {
|
||||
return vscode.window.showErrorMessage("Failed to initialize docker file!");
|
||||
}
|
||||
vscode.window.showInformationMessage("Dockerfile has been created!");
|
||||
});
|
||||
});
|
||||
|
||||
context.subscriptions.push(disposable);
|
||||
}
|
||||
|
||||
// this method is called when your extension is deactivated
|
||||
export function deactivate() {}
|
||||
```
|
||||
|
||||
这是为你的扩展写代码的地方。已经有一些自动生成的代码了,我再来分析一下。
|
||||
|
||||
注意,`vscode.command.registerCommand` 里面的 `initdockerapp.initialize` 和 `package.json` 里面的命令是一样的。它需要两个参数。
|
||||
|
||||
1. 要注册的命令名称
|
||||
2. 执行命令的功能
|
||||
|
||||
另一个需要注意的函数是 `fs.writeFile`,这是你写在 `vscode.command.registerCommand` 函数里面的。这将在你的项目根目录下创建一个 Dockerfile,并在其中附加代码来创建一个 Docker 镜像。
|
||||
|
||||
### 调试扩展
|
||||
|
||||
现在你已经写好了扩展,是时候调试它了。点击“Run”菜单,选择“Start Debugging”(或者直接按 `F5`)打开调试窗口。
|
||||
|
||||
在调试窗口里面点击“Add Folder”或“Clone Repository”按钮,打开该项目。
|
||||
|
||||
接下来,用 `Ctrl+Shift+P`(在 macOS 上,用 `Command` 键代替 `Ctrl`)打开命令面板,运行 `Initialize A Docker Application`。
|
||||
|
||||
* 第一次运行此命令时,自 VSCodium 启动后,激活函数尚未执行。因此,调用激活函数,并由激活 函数注册该命令。
|
||||
* 如果命令已注册,那么它将被执行。
|
||||
|
||||
你会看到右下角有一条信息,上面写着:`Dockerfile has been created!`。这就创建了一个 Dockerfile,里面有一些预定义的代码,看起来是这样的:
|
||||
|
||||
![Running the new extension command][11]
|
||||
|
||||
(Hussain Ansari, [CC BY-SA 4.0][10])
|
||||
|
||||
### 总结
|
||||
|
||||
有许多有用的 API 可以帮助你创建你想要构建的扩展。VS Code 扩展 API 还有许多其他强大的方法可以使用。
|
||||
|
||||
你可以在 VS Code 扩展 API 文档中了解更多关于 VS Code API 的信息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/vs-code-extension
|
||||
|
||||
作者:[Ashique Hussain Ansari][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/uidoyen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
|
||||
[2]: https://code.visualstudio.com/
|
||||
[3]: https://code.visualstudio.com/license
|
||||
[4]: https://vscodium.com/
|
||||
[5]: https://nodejs.org/en/
|
||||
[6]: https://www.npmjs.com/
|
||||
[7]: https://yeoman.io/
|
||||
[8]: https://github.com/Microsoft/vscode-generator-code
|
||||
[9]: https://opensource.com/sites/default/files/uploads/vscode-tree.png (Project file structure in VSCodium)
|
||||
[10]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/vscode-run-command.png (Running the new extension command)
|
133
published/202006/20200602 Using pandas to plot data in Python.md
Normal file
133
published/202006/20200602 Using pandas to plot data in Python.md
Normal file
@ -0,0 +1,133 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12333-1.html)
|
||||
[#]: subject: (Using pandas to plot data in Python)
|
||||
[#]: via: (https://opensource.com/article/20/6/pandas-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
|
||||
使用 Pandas 在 Python 中绘制数据
|
||||
======
|
||||
|
||||
> Pandas 是一个非常流行的 Python 数据操作库。学习怎样使用它的 API 绘制数据。
|
||||
|
||||

|
||||
|
||||
在有关基于 Python 的绘图库的系列文章中,我们将对使用 Pandas 这个非常流行的 Python 数据操作库进行绘图进行概念性的研究。Pandas 是 Python 中的标准工具,用于对进行数据可扩展的转换,它也已成为[从 CSV 和 Excel 格式导入和导出数据][2]的流行方法。
|
||||
|
||||
除此之外,它还包含一个非常好的绘图 API。这非常方便,你已将数据存储在 Pandas DataFrame 中,那么为什么不使用相同的库进行绘制呢?
|
||||
|
||||
在本系列中,我们将在每个库中制作相同的多条形柱状图,以便我们可以比较它们的工作方式。我们使用的数据是 1966 年至 2020 年的英国大选结果:
|
||||
|
||||
![Matplotlib UK election results][3]
|
||||
|
||||
### 自行绘制的数据
|
||||
|
||||
在继续之前,请注意你可能需要调整 Python 环境来运行此代码,包括:
|
||||
|
||||
* 运行最新版本的 Python(用于 [Linux][4]、[Mac][5] 和 [Windows][6] 的说明)
|
||||
* 确认你运行的是与这些库兼容的 Python 版本
|
||||
|
||||
数据可在线获得,并可使用 Pandas 导入:
|
||||
|
||||
```
|
||||
import pandas as pd
|
||||
df = pd.read_csv('https://anvil.works/blog/img/plotting-in-python/uk-election-results.csv')
|
||||
```
|
||||
|
||||
现在我们已经准备好了。在本系列文章中,我们已经看到了一些令人印象深刻的简单 API,但是 Pandas 一定能夺冠。
|
||||
|
||||
要在 x 轴上绘制按年份和每个党派分组的柱状图,我只需要这样做:
|
||||
|
||||
```
|
||||
import matplotlib.pyplot as plt
|
||||
ax = df.plot.bar(x='year')
|
||||
plt.show()
|
||||
```
|
||||
|
||||
只有四行,这绝对是我们在本系列中创建的最棒的多条形柱状图。
|
||||
|
||||
我以[宽格式][7]使用数据,这意味着每个党派都有一列:
|
||||
|
||||
```
|
||||
year conservative labour liberal others
|
||||
0 1966 253 364 12 1
|
||||
1 1970 330 287 6 7
|
||||
2 Feb 1974 297 301 14 18
|
||||
.. ... ... ... ... ...
|
||||
12 2015 330 232 8 80
|
||||
13 2017 317 262 12 59
|
||||
14 2019 365 202 11 72
|
||||
```
|
||||
|
||||
这意味着 Pandas 会自动知道我希望如何分组,如果我希望进行不同的分组,Pandas 可以很容易地[重组 DataFrame][8]。
|
||||
|
||||
与 [Seaborn][9] 一样,Pandas 的绘图功能是 Matplotlib 之上的抽象,这就是为什么要调用 Matplotlib 的 `plt.show()` 函数来实际生成绘图的原因。
|
||||
|
||||
看起来是这样的:
|
||||
|
||||
![pandas unstyled data plot][10]
|
||||
|
||||
看起来很棒,特别是它又这么简单!让我们对它进行样式设置,使其看起来像 [Matplotlib][11] 的例子。
|
||||
|
||||
#### 调整样式
|
||||
|
||||
我们可以通过访问底层的 Matplotlib 方法轻松地调整样式。
|
||||
|
||||
首先,我们可以通过将 Matplotlib 颜色表传递到绘图函数来为柱状图着色:
|
||||
|
||||
```
|
||||
from matplotlib.colors import ListedColormap
|
||||
cmap = ListedColormap(['#0343df', '#e50000', '#ffff14', '#929591'])
|
||||
ax = df.plot.bar(x='year', colormap=cmap)
|
||||
```
|
||||
|
||||
我们可以使用绘图函数的返回值设置坐标轴标签和标题,它只是一个 [Matplotlib 的 Axis 对象][12]。
|
||||
|
||||
```
|
||||
ax.set_xlabel(None)
|
||||
ax.set_ylabel('Seats')
|
||||
ax.set_title('UK election results')
|
||||
```
|
||||
|
||||
这是现在的样子:
|
||||
|
||||
![pandas styled plot][13]
|
||||
|
||||
这与上面的 Matplotlib 版本几乎相同,但是只用了 8 行代码而不是 16 行!我内心的[代码高手][14]非常高兴。
|
||||
|
||||
### 抽象必须是可转义的
|
||||
|
||||
与 Seaborn 一样,向下访问 Matplotlib API 进行细节调整的能力确实很有帮助。这是给出抽象[紧急出口][15]使其既强大又简单的一个很好的例子。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/pandas-python
|
||||
|
||||
作者:[Shaun Taylor-Morgan][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/shaun-taylor-morgan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/panda.png?itok=0lJlct7O (Two pandas sitting in bamboo)
|
||||
[2]: https://anvil.works/docs/data-tables/csv-and-excel
|
||||
[3]: https://opensource.com/sites/default/files/uploads/matplotlib_2.png (Matplotlib UK election results)
|
||||
[4]: https://opensource.com/article/20/4/install-python-linux
|
||||
[5]: https://opensource.com/article/19/5/python-3-default-mac
|
||||
[6]: https://opensource.com/article/19/8/how-install-python-windows
|
||||
[7]: https://anvil.works/blog/tidy-data
|
||||
[8]: https://anvil.works/blog/tidy-data#converting-between-long-and-wide-data-in-pandas
|
||||
[9]: https://anvil.works/blog/plotting-in-seaborn
|
||||
[10]: https://opensource.com/sites/default/files/uploads/pandas-unstyled.png (pandas unstyled data plot)
|
||||
[11]: https://opensource.com/article/20/5/matplotlib-python
|
||||
[12]: https://matplotlib.org/api/axis_api.html#axis-objects
|
||||
[13]: https://opensource.com/sites/default/files/uploads/pandas_3.png (pandas styled plot)
|
||||
[14]: https://en.wikipedia.org/wiki/Code_golf
|
||||
[15]: https://anvil.works/blog/escape-hatches-and-ejector-seats
|
||||
[16]: https://anvil.works/blog/plotting-in-pandas
|
@ -0,0 +1,174 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12353-1.html)
|
||||
[#]: subject: (Using the Lightweight Apt Package Manager Synaptic in Ubuntu and Other Debian-based Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/synaptic-package-manager/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
在 Ubuntu 中使用轻量的 Apt 软件包管理器 Synaptic
|
||||
======
|
||||
|
||||

|
||||
|
||||
这周推荐的开源软件是 Synaptic。学习这个经过时光积淀的软件包管理器能做哪些现代软件管理器做不到的事情。
|
||||
|
||||
### Synaptic 软件包管理器是什么?
|
||||
|
||||
[Synaptic][1] 是一个轻量级的 [apt 软件包管理器系统][2]的 GUI 前端,使用在 Debian、Ubuntu、Linux Mint 以及其它很多基于 Debian/Ubuntu 发行版中。
|
||||
|
||||
总的来说,所有你可以 [在终端中使用 apt-get 命令][3] 来做的事,都可以通过 Synaptic 来实现。
|
||||
|
||||
![][4]
|
||||
|
||||
曾几何时,Synaptic 几乎是所有基于 Debian Linux 发行版的默认图形化软件包管理器。它被认为是一种用户友好的、易于使用的管理应用程序的方法。
|
||||
|
||||
随着像 [GNOME “软件”][5] 和 [KDE “发现”][6] 等现代软件包管理器工具带来更现代和直观的图形用户界面,事情发生了变化。这些软件包管理器有更好的界面,以一种更友好的方式显示软件包信息,带有缩略图、评分和评论。
|
||||
|
||||
最后,Synaptic [的使用被局限于在大多数的轻量级 Linux 发行版][7] 中。
|
||||
|
||||
#### 为什么你要使用像 Synaptic 软件包管理器这样的 “古老的” 软件?
|
||||
|
||||
当然,在多大数的情况下,你没有必要这样做。
|
||||
|
||||
但是,Synaptic 仍然比 GNOME “软件” 的功能要很多。记住,它基本上是 `apt` 的 GUI 前端,这意味着它(几乎)可以做任何你能够 [在终端中使用 apt 命令][8] 所做的事。
|
||||
|
||||
例如,如果你想 [在 Ubuntu 中阻止特定的软件包更新][9],你可以在 Synaptic 中做到这一点,但是你却不能 GNOME/Ubuntu 的软件中心中实现。
|
||||
|
||||
![][10]
|
||||
|
||||
另外,我注意到 Ubuntu 20.04 的软件中心存在一些问题。它加载速度缓慢,它搜索软件包时缓慢,并且它充满了 snap 应用程序(不是每个人都喜欢)。
|
||||
|
||||
Synaptic 也是 [Ubuntu 中一个轻量级应用程序][7],使用可以可以让你感觉你的系统快一点。
|
||||
|
||||
#### Synaptic 软件包管理器的功能
|
||||
|
||||
下面是对 Synaptic 的概况:
|
||||
|
||||
* 更新软件包缓存
|
||||
* 升级整个系统
|
||||
* 管理软件包包存储库
|
||||
* 通过名称、描述、维护者、版本、依赖项等搜索软件包
|
||||
* 通过组、状态(安装与否)、源或更多信息列出软件包
|
||||
* 通过名称、状态、大小或版本排序软件包
|
||||
* 获取与软件包相关的信息
|
||||
* 锁定软件包版本
|
||||
* 安装指定版本的软件包
|
||||
|
||||
还有很多功能,大家可以自己去探索。
|
||||
|
||||
### 如何在 Ubuntu 上安装 Synaptic 软件包管理器
|
||||
|
||||
Synaptic 软件包管理器可在 Ubuntu 的 Universe 存储库中获得。如果 Universe 存储库未启用,你可以在软件中心中找到Synaptic:
|
||||
|
||||
![Synaptic 在 Ubuntu 软件中心][11]
|
||||
|
||||
你也可以通过命令行来安装 Synaptic 。先确保启用 universe 存储库:
|
||||
|
||||
```
|
||||
sudo add-apt-repository univers
|
||||
```
|
||||
|
||||
然后更新缓存(在 Ubuntu 18.04 及更高版本中不需要):
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
现在,使用下面的命令来安装 synaptic 软件包管理器:
|
||||
|
||||
```
|
||||
sudo apt install synaptic
|
||||
```
|
||||
|
||||
这就是所有的安装过程。
|
||||
|
||||
### 如何使用 Synaptic 软件包管理器
|
||||
|
||||
在安装后,你可以在菜单中开始搜索 Synaptic 并启动它:
|
||||
|
||||
![][12]
|
||||
|
||||
可以看到,这个界面不是最好看的界面之一。注意复选框的颜色。白色意味着软件包未安装,绿色意味软件包已安装。
|
||||
|
||||
![][4]
|
||||
|
||||
你可以搜索一个应用程序并单击复选框将标记其为安装。它也将(以绿色的形式)高亮将被作为依赖关系项目的软件包。单击应用来安装选择的软件包:
|
||||
|
||||
![][13]
|
||||
|
||||
你可以使用 Synaptic [查看在 Ubuntu 中安装的所有软件包][14] 。你也可以从这个视图中选择移除软件包。
|
||||
|
||||
![][15]
|
||||
|
||||
你可以根据源显示各个存储库中可用的软件包。这是查看 [哪个 PPA 提供什么软件包][16]的好方法。你可以通过如上所述的方法来安装或移除软件包。
|
||||
|
||||
![][17]
|
||||
|
||||
通常,当你更新 Ubuntu 时,所有的软件包都会同时更新。使用 Synaptic,你可以轻松地选择你需要更新/升级到较新版本的软件包。
|
||||
|
||||
![][18]
|
||||
|
||||
你也可以锁定软件包的版本,以便它们就不会随着系统更新而被更新。
|
||||
|
||||
![][10]
|
||||
|
||||
你也可以使用 Synaptic 搜索软件包。这类似于 [使用 apt-cache search 命令搜索软件包][19]。
|
||||
|
||||
![][20]
|
||||
|
||||
如果你认为你做了错误的选择,你可以从“编辑”菜单中单击撤销。
|
||||
|
||||
你可以使用 Synaptic 做很多事,我无法涵盖所有可能的用法。我在这里已经涵盖了最常见的一些方法,如果你将要去使用 Synaptic 的话,我留给你去探索。
|
||||
|
||||
### Synaptic 并不适合所有的人
|
||||
|
||||
如果你不喜欢 Synaptic,你可以在软件中心中移除它,或在终端中使用这个命令:
|
||||
|
||||
```
|
||||
sudo apt remove synaptic
|
||||
```
|
||||
|
||||
Ubuntu 还有另一个被称为 [AppGrid][21] 的轻量级软件包管理器。据我所知,它已经有一段时间没有更新了。
|
||||
|
||||
Synaptic 当然并不适合所有的人。它列出了你在常规软件中心中看不到的库和包。如果你移除了一个你不知道的库,那么它可能会引起问题。
|
||||
|
||||
我认为 Synaptic 更适合于中高级用户,他们既想更好地控制软件包管理器又不想使用命令行方法。
|
||||
|
||||
你有什么要说的吗?你使用过 Synaptic 软件包管理器吗?你是使用软件中心还是你只在终端中探索?请在评论区中分享你的喜好。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/synaptic-package-manager/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.comrobsean)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.nongnu.org/synaptic/
|
||||
[2]: https://en.wikipedia.org/wiki/APT_(software)
|
||||
[3]: https://itsfoss.com/apt-get-linux-guide/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/synaptic-interface.png?ssl=1
|
||||
[5]: https://wiki.gnome.org/Apps/Software
|
||||
[6]: https://userbase.kde.org/Discover
|
||||
[7]: https://itsfoss.com/lightweight-alternative-applications-ubuntu/
|
||||
[8]: https://itsfoss.com/apt-command-guide/
|
||||
[9]: https://itsfoss.com/prevent-package-update-ubuntu/
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/lock-version-synaptic.png?ssl=1
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/synaptic-ubuntu-software-center.png?ssl=1
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/synaptic-package-manager-ubuntu.jpg?ssl=1
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/install-packages-in-synaptic.png?ssl=1
|
||||
[14]: https://itsfoss.com/list-installed-packages-ubuntu/
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/remove-packages-using-synaptic.png?ssl=1
|
||||
[16]: https://itsfoss.com/ppa-guide/
|
||||
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/see-packages-by-repositories-synaptic.png?ssl=1
|
||||
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/upgrade-packages-synaptic.png?ssl=1
|
||||
[19]: https://itsfoss.com/apt-search-command/
|
||||
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/search-results-synaptic.png?ssl=1
|
||||
[21]: https://itsfoss.com/app-grid-lighter-alternative-ubuntu-software-center/
|
@ -0,0 +1,97 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12308-1.html)
|
||||
[#]: subject: (Devuan Beowulf 3.0 is the Latest Stable Release Based on Debian 10.4 Buster)
|
||||
[#]: via: (https://itsfoss.com/devuan-3-release/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
没有 systemd 的 Devuan Beowulf 3.0 发布
|
||||
======
|
||||
|
||||
[Devuan GNU+Linux][1] 是 [Debian][2] 的分支,它不含有 [systemd][3]。如果你想知道 systemd 有什么问题,我们可以改天再讨论这个话题。
|
||||
|
||||
不过,如果你想要一个没有 systemd 的 Linux 发行版,那么 Devuan Beowulf 3.0 的发布对你来说应该是个好消息。
|
||||
|
||||
### Devuan Beowulf 3.0 有什么新增功能?
|
||||
|
||||

|
||||
|
||||
Devuan 通常因其提供了替代性的[初始化][5]系统(如 [SysV][6])而受到喜爱。
|
||||
|
||||
在本文中,我们将介绍 Devuan Beowulf 3.0 中的主要亮点。
|
||||
|
||||
#### 基于 Debian 10.4 Buster
|
||||
|
||||
[Debian 10 Buster][7] 无疑是一款令人印象深刻的发行版系列,它的最新版本是 Debian 10.4。
|
||||
|
||||
而 Devuan Beowulf 3.0,是基于最新的 Debian 10.4 Buster 更新版本的。如果你不了解,可以查看 [Debian 10.4 Buster 的官方公告][8],以了解更多信息。
|
||||
|
||||
#### Linux Kernel 4.19
|
||||
|
||||
在它的最新版本中装有 [Linux Kernel 4.19 LTS][9] 也是一个很好的加分项。
|
||||
|
||||
当然,这不是最新的内核,因为我们身处 “Debian 领域”,这里的事物并非总是最新的,但更加稳定。这个新内核应该可以解决以前版本中可能遇到的几个问题。
|
||||
|
||||
#### 支持 ppc64el 架构
|
||||
|
||||
对 [ppc64el][10] 的支持在大多数时候都不是大事,但支持 PowerPC 和 Power ISA 处理器是一个优势。
|
||||
|
||||
顺便提一句,Devuan GNU+Linux 已经支持 i386、amd64、armel、armhf 和 arm64 架构。
|
||||
|
||||
#### 添加 runit 和 OpenRC 作为可选项
|
||||
|
||||
想要更多替代的的初始化系统吗?现在最新版本中可选 [runit][11] 和 [openrc][12]。
|
||||
|
||||
#### 其他变化
|
||||
|
||||
除了上面的这样亮点外,你还可以发现它添加了独立守护进程 [eudev][13] 和 [elogind][14]。
|
||||
|
||||
启动页面、显示管理器和桌面主题也有了细微的变化。例如,启动菜单显示的是 “Debian” 而不是 “Devuan”。
|
||||
|
||||
如果你想了解有关 Devuan Beowulf 3.0.0 变更的更多技术详细信息,那么可以查看[官方发行说明][15]。
|
||||
|
||||
> 花絮
|
||||
>
|
||||
> Devuan 的发布版本以小行星命名。Beowulf 是一个[编号为 38086 的小行星][16]。
|
||||
|
||||
### 总结
|
||||
|
||||
最新稳定版本的 Devuan Beowulf 3.0 是提供无 systemd 的发行版的很好的进展。
|
||||
|
||||
如果你想支持 Devuan 项目,请[在财务上为他们的项目捐款][17]或[通过其他方式][18]。
|
||||
|
||||
你觉得这个版本怎么样?请在下面评论让我知道你的想法!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/devuan-3-release/
|
||||
|
||||
作者:[Ankush Das][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://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://devuan.org
|
||||
[2]: https://www.debian.org
|
||||
[3]: https://en.wikipedia.org/wiki/Systemd
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/devuan-beowulf.jpg?ssl=1
|
||||
[5]: https://en.wikipedia.org/wiki/Init
|
||||
[6]: https://wiki.archlinux.org/index.php/SysVinit
|
||||
[7]: https://itsfoss.com/debian-10-buster/
|
||||
[8]: https://www.debian.org/News/2020/20200509
|
||||
[9]: https://itsfoss.com/linux-kernel-4-19-lts-release/
|
||||
[10]: https://en.wikipedia.org/wiki/Ppc64
|
||||
[11]: https://en.wikipedia.org/wiki/Runit
|
||||
[12]: https://en.wikipedia.org/wiki/OpenRC
|
||||
[13]: https://wiki.gentoo.org/wiki/Eudev
|
||||
[14]: https://wiki.gentoo.org/wiki/Elogind
|
||||
[15]: https://files.devuan.org/devuan_beowulf/Release_notes.txt
|
||||
[16]: https://en.wikipedia.org/wiki/Meanings_of_minor_planet_names:_38001%E2%80%9339000#086
|
||||
[17]: https://devuan.org/os/donate
|
||||
[18]: https://dev1galaxy.org/viewtopic.php?pid=1380#p1380
|
@ -0,0 +1,112 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12313-1.html)
|
||||
[#]: subject: (How to generate an EPUB file on Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/how-to-generate-an-epub-file-on-fedora/)
|
||||
[#]: author: (John Paul Wohlscheid https://fedoramagazine.org/author/johnblood/)
|
||||
|
||||
如何在 Fedora 上生成 EPUB 电子书
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
在智能手机上阅读内容正在变得越来越流行。每一部手机都有它自己的电子书阅读器。可能你不知道,在 Fedora 创建你自己的电子书文件是非常容易的。
|
||||
|
||||
这篇文章展示了使用两种不同的方法来创建一个 [EPUB][2] 文件。EPUB 格式是最流行的格式之一,并且被很多开源软件所支持。
|
||||
|
||||
绝大数的人们将会询问 “在很容易创建 PDF 文件的情况下,为什么要花费时间和精力来创建 EPUB 文件?” 答案是: “你曾经尝试看过每次只能看到一张纸的一小部分的吗?”为阅读一个 PDF 文件,你不得不经常缩放和移动文档,或者将其缩放到一个小尺寸来适合屏幕大小。在另一方面,EPUB 文件则被设计成可以适合很多不同的屏幕类型。
|
||||
|
||||
### 方法 1: ghostwriter 和 pandoc
|
||||
|
||||
第一种方法创建一个速成版的电子书文件。它使用一个名为 [ghostwriter][3] 的 Markdown 编辑器,和一个名为 [pandoc][4] 的命令行文档转换工具。
|
||||
|
||||
你可以从软件中心搜查和安装它们,也可以从终端中安装它们。如果你使用终端来安装它们,运行这个命令:
|
||||
|
||||
```
|
||||
sudo dnf install pandoc ghostwriter
|
||||
```
|
||||
|
||||
对于那些不知道 [Markdown][5] 是什么的人们来说,在这里有一个简要的解释:它是一个大约在 15 年前创建的简单的标记语言。它使用简单的语法来格式化纯文本。Markdown 文件可以随后转换成很多其它文档格式的文件。
|
||||
|
||||
![ghostwriter][6]
|
||||
|
||||
对于工具,ghostwriter 是一个跨平台的易于使用的 Markdown 编辑器。pandoc 是一个非常易于使用的文档转换工具,可以处理数百种不同的格式。
|
||||
|
||||
要创建你的电子书,打开 ghostwriter,开始编写你的文档。如果你以前使用过 Markdown,你可能习惯于在文档的“标题 1”的前面放置一个 `#` 符号来作为标题。像这样: `# My Man Jeeves`。然而,pandoc 将不会识别其为标题,并将在你的电子书的顶部放置一个一个大的 “UNTITLED” 。相反地在你的标题前放置一个 `%` 来作为标题。例如,`% My Man Jeeves` 。章节应该被格式为“标题 2”,例如,`## Leave It to Jeeves`。如果你有子章节,使用“标题 3”(`###`)。
|
||||
|
||||
![][7]
|
||||
|
||||
在你的文档完成后,单击“文件 -> 导出”(或按 `Ctrl+E` 键)。在对话框中,在几个 Markdown 转换器中进行选择。如果这是你第一次使用 ghostwriter ,默认选择的是 Sundown 转换器。从对话框中,选择 pandoc 。接下来单击“导出”。现在你的 EPUB 文件已经创建好了。
|
||||
|
||||
![ghostwriter 导出对话框][8]
|
||||
|
||||
注意: 如果你得到一个与 pandoc 有关的错误,关闭“智能排版”,并再试一次。
|
||||
|
||||
### 方法 2: calibre
|
||||
|
||||
如果你想要一个更完美的电子书,那这就是你正在寻找的方法。它需要更多的步骤,但是是值得的。
|
||||
|
||||
![][9]
|
||||
|
||||
首先,安装一个名为 [calibre][10] 的应用程序。calibre 不仅仅是一个电子书阅读器,它也是一个电子书管理器系统。你可以从软件中心安装它,也可以从终端安装它:
|
||||
|
||||
```
|
||||
sudo dnf install calibre
|
||||
```
|
||||
|
||||
在这个方法中,你可以在 LibreOffice、ghostwriter,或者其它你选择的编辑器中编写你的文档。确保书籍的标题被格式为“标题 1”,章节被格式为“标题 2”,子章节被格式为“标题 3”。
|
||||
|
||||
接下来,导出你的文档为一个 HTML 文件。
|
||||
|
||||
现在添加该文件到 calibre 。打开 calibre ,并单击 “添加书籍”。calibre 会用几秒钟来添加文件。
|
||||
|
||||
![][11]
|
||||
|
||||
在文件导入后,通过单击 “编辑元数据” 按钮来编辑文件的元数据。在这里你可以填写书的标题和作者的姓名。你也可以上传一个封面图片(如果你有的话),或者 calibre 将为你生成一个封面。
|
||||
|
||||
![][12]
|
||||
|
||||
接下来,单击 “转换书籍” 按钮。在新的对话框中,选择 “界面与外观” 部分的 “布局” 标签页。勾选 “删除段间空行” 选项。这将更加严格地缩进每一段的内容。
|
||||
|
||||
![][13]
|
||||
|
||||
现在,设置目录。选择 “内容目录” 部分。这里有三个需要注意的选项: “一级目录”、“二级目录” 和 “三级目录”。对于每一个选项点击其末尾处的魔法棒按钮。在新的对话框中,选择应用于目录表项的 HTML 标记。例如,为“一级目录”选择 “h1”。
|
||||
|
||||
![][14]
|
||||
|
||||
接下来,告诉 calibre 包含内容目录。选择 “输出 EPUB” 部分并勾选 “插入内联目录”。单击“确定“ 创建 epub 文件。
|
||||
|
||||
![][15]
|
||||
|
||||
现在,你有了一个看起来很专业的电子书文件。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/how-to-generate-an-epub-file-on-fedora/
|
||||
|
||||
作者:[John Paul Wohlscheid][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://fedoramagazine.org/author/johnblood/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/05/epub-how_to-816x345.png
|
||||
[2]: https://en.wikipedia.org/wiki/EPUB
|
||||
[3]: https://github.com/wereturtle/ghostwriter
|
||||
[4]: https://pandoc.org/
|
||||
[5]: https://fedoramagazine.org/applications-for-writing-markdown/
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/05/ghostwriter-1024x640.jpg
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/05/ghostwriter-menu-1024x640.jpg
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/05/ghostwriter-export-1024x640.jpg
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-pre-1024x640.jpg
|
||||
[10]: https://calibre-ebook.com/
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-metadata-1024x640.jpg
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-lookandfeel-1024x640.jpg
|
||||
[13]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-toc2-1024x640.jpg
|
||||
[14]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-epub-output-1024x640.jpg
|
||||
[15]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-post-1024x640.jpg
|
@ -0,0 +1,100 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12317-1.html)
|
||||
[#]: subject: (Using AppImage for Linux package management)
|
||||
[#]: via: (https://opensource.com/article/20/6/appimages)
|
||||
[#]: author: (David Clinton https://opensource.com/users/dbclinton)
|
||||
|
||||
使用 AppImage 进行 Linux 软件包管理
|
||||
======
|
||||
|
||||
> AppImage 在自足的环境中分发应用, 它适用于任何 Linux 发行版。
|
||||
|
||||

|
||||
|
||||
管理 Linux 机器(尤其是远程机器)的一个重要分就是管理和安装软件。当本地应用程序出现问题时,或者文件系统上的某些文件损坏需要修复时,你通常会希望推送更新,而不必走很多路坐在物理屏幕前。正如我在 Pluralsight 课程《[Linux 系统维护和故障排除][2]》中所解释的那样,许多问题当然可以通过 Bash 脚本解决,但是仍有很多情况下,除了老式的二进制文件外,没有其他选择。
|
||||
|
||||
想象一下,你的某些远程系统需要安装新的应用程序,这样使用这些计算机的团队成员就能够执行某些业务。能够利用 Debian 或 RPM 之类的主要 Linux 仓库系统的集成和自动化,可以使你的管理任务变得更加容易。
|
||||
|
||||
正如 Linus Torvalds 永不厌倦地提醒我们的那样,太多的 Linux 软件管理系统的问题是 [Linux 软件管理系统太多了][3]。多年来,应用开发甚至是 Linux 的采用都变得愈加复杂起来,因为你为了提供你的软件(比如,放到 Debian 仓库)而投入的所有时间和工作,对于你想让它们进入 RPM 系统并没有什么帮助,对于 SUSE 的 Zypper 管理器也一样,没有什么帮助。
|
||||
|
||||
解决软件孤岛问题的一种有前途的方案是分发具有自足环境的应用,它们可以在任何 Linux 发行版上运行。在这个年轻且不断发展的领域中,选择之一是 [AppImage][4]。
|
||||
|
||||
### 使用 AppImage
|
||||
|
||||
我全面投入到了 AppImage。就像我提到的其他软件包管理系统一样,如果你需要的话,有很多复杂的功能可以使用。但是,从本质上讲,AppImage 非常简单。AppImage 不像大多数其他包管理器一样通过仓库工作,它使用单个、独立的文件,可以直接发送或通过网站共享。
|
||||
|
||||
下面是个展示它的美妙之处的例子。当我在用 AppImage 时,我在一个技术论坛上看到了一个很老的讨论,它让我找到了一个同样久远且废弃的 GitHub 项目以及相关的 YAML 和配方文件。它们旨在自动构建准备生成 AppImage 包所需的相当复杂的基础架构。尽管该基础架构全部是在 5 年前的 Ubuntu 版本上构建的,但是当我将它们放在一起并运行 `appimagetool` 命令时,它创建了一个 AppImage 文件,它可在我当前的桌面上无缝运行。我不认为有很多有五年历史的 GitHub 复杂项目可以使用其他技术运行,而无需认真重做。
|
||||
|
||||
但是这里我我不会介绍这个案例。相反,我将用一个简单的 Hello World 程序向你展示它是如何工作的。首先,请确保本地已安装 AppStream 包。
|
||||
|
||||
对于基于 Debian 的系统,运行:
|
||||
|
||||
```
|
||||
$ sudo apt install appstream
|
||||
```
|
||||
|
||||
对于 RPM 系统,请使用:
|
||||
|
||||
```
|
||||
$ sudo dnf install appstream
|
||||
```
|
||||
|
||||
克隆[这篇文章][5]中提及的 Git 仓库,我会基于它示例:
|
||||
|
||||
```
|
||||
$ git clone <https://github.com/boolean-world/appimage-resources>
|
||||
$ cd appimage-resources
|
||||
$ ls hello-world-appimage
|
||||
```
|
||||
|
||||
接下来,使用 `cd` 进入 Git 新创建的目录。这里有两个目录。请使用 `hello-world-appimage`。另一个是更复杂的项目,你也应该考虑尝试一下。
|
||||
|
||||
Linux GUI 系统会读取 `helloworld.desktop` 文件来知道如何呈现桌面图标。事实证明,当前的这个文件会在以后给你带来点麻烦,因此请进行一些小修改:添加 `Categories=` 这行并为其赋予值 `GNOME`。不要忘记最后的分号:
|
||||
|
||||
|
||||
```
|
||||
$ nano hello-world-appimage/helloworld.desktop
|
||||
add Categories=GNOME;
|
||||
```
|
||||
|
||||
从 [AppImage GitHub 项目][6]下载 `appimagetool` 预编译的二进制文件。访问 GitHub 的原因之一:那里有很多出色的文档和资源。下载二进制文件后,使文件可执行,并将 `hello-world-appimage` 目录传给它。但是首先,你需要告诉它你想要的架构。由于某些原因,一个名字以 x86\_64 结尾的工具都不能自行确定是否该使用 x86\_64 来构建应用程序(我不知道这是怎么回事)。
|
||||
|
||||
```
|
||||
$ wget <https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage>
|
||||
$ chmod +x appimagetool-x86_64.AppImage
|
||||
$ ARCH=x86_64 ./appimagetool-x86_64.AppImage hello-world-appimage
|
||||
```
|
||||
|
||||
如果你没有看到任何错误消息,那么表示完成了,请运行:
|
||||
|
||||
```
|
||||
$ ls
|
||||
$ ./hello-world-appimage-x86_64.AppImage
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
AppImage 是软件包管理的非常有效的选择。当你探索它时,我想你会发现它是 Linux 发行版默认软件包系统的很好的替代品。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/appimages
|
||||
|
||||
作者:[David Clinton][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/dbclinton
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out)
|
||||
[2]: https://pluralsight.pxf.io/VMKQj
|
||||
[3]: https://itsfoss.com/desktop-linux-torvalds/
|
||||
[4]: https://appimage.org/
|
||||
[5]: https://www.booleanworld.com/creating-linux-apps-run-anywhere-appimage/
|
||||
[6]: https://github.com/AppImage/AppImageKit/releases
|
@ -0,0 +1,89 @@
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "lxbwolf"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-12320-1.html"
|
||||
[#]: subject: "5 ways to boost your Kubernetes knowledge"
|
||||
[#]: via: "https://opensource.com/article/20/6/kubernetes-anniversary"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
|
||||
提升你 Kubernetes 技能的 5 种方式
|
||||
======
|
||||
|
||||
> 值此周年纪念之际,来通过这些深度文章和实践项目了解下 Kubernetes。
|
||||
|
||||

|
||||
|
||||
在云原生的成长期,开发者们发现在一个小型的、原子化的、精简的 Linux 镜像里编写应用程序很方便,这些镜像与它们所运行的服务器共享资源。从技术上讲,这些基于内核命名空间的小环境定义被称为[容器][2]。随着容器的激增,系统管理员们很快意识到,开发一个不仅能帮助他们管理容器,还能帮助他们管理下面的虚拟化基础设施的工具变得至关重要。于是,[Kubernetes][3] 应运而生。
|
||||
|
||||
Kubernetes 是一个可扩展开源平台,用于管理容器。它可以帮助管理员和开发者们围绕容器管理工作负载、服务和进程。它促进了声明式配置,更容易实现自动化。在它相对较短的生命周期中,它已经催生了一个迅速成长的生态系统,其中包括来自大量公司和项目的服务、支持和工具。
|
||||
|
||||
如果你想对这项重要的云技术有更多的了解,这里有一些能帮忙你更深入学习的文章。还有 5 个项目可以帮你把学到的东西付诸实践。
|
||||
|
||||
### 遏制容器乱象
|
||||
|
||||
2016 年,我们发布了《[使用 Kubernetes 遏制容器乱象][4]》,这是一篇由 Terry Ryan 写的关于 Kubernetes 的介绍性文章,讲述了 Kubernetes 如何帮助管理员和架构师们努力应对容器。如果你想找一篇从底层介绍容器是做什么的以及 Kubernetes 是如何实现容器管理的,那么你应该先读下本文。本文适合零基础的读者,解释了所有重要的概念,因此你能迅速了解相关技术。
|
||||
|
||||
如果想进阶了解内核层面发生的一些神奇的事情,请阅读 Jessica Cherry 对 [Kubernetes 命名空间][5]的解释。
|
||||
|
||||
延伸阅读:
|
||||
|
||||
- [一文了解 Kubernetes 是什么?](https://linux.cn/article-8800-1.html)
|
||||
- [Kubernetes 是什么?](https://linux.cn/article-8858-1.html)
|
||||
|
||||
### Kubernetes:为什么它很重要?
|
||||
|
||||
Kubernetes 提供了<ruby>基础设施即服务<rt>Infrastructure-as-a-Service</rt></ruby>(IaaS)解决方案(类似 OpenStack)的便利和一个完整的<ruby>平台即服务<rt>Platform as a Service</rt></ruby>(PaaS)。它为你提供了管理基础设施的抽象能力,以及在裸金属基础层面进行故障排除所需的工具。如果你执着于使用单一的裸金属服务器,你可能需要阅读下 Tim Potter 写的《[你为什么需要 Kubernetes][6]》。他的文章对比了 IaaS 和 PaaS,解释了为什么 Kubernetes 如此广泛地被使用。你可能并不是一定需要 Kubernetes 或容器,但是重要的是知道什么情况下需要。
|
||||
|
||||
延伸阅读:
|
||||
|
||||
- [使用 Kubernetes 的 5 个理由](https://linux.cn/article-10973-1.html)
|
||||
- [你(多半)不需要 Kubernetes](https://linux.cn/article-10469-1.html)
|
||||
|
||||
### 在树莓派上运行 Kubernetes
|
||||
|
||||
熟悉 Kubernetes 的最好方法莫过于自己运行它。不幸的是,不是每个人都有一个云服务基层设施(或者有足够的钱来租用一个)可供其支配。而幸运的是,Chris Collins 提供了《[在树莓派上运行 Kubernetes][7]》的教程。结合他的另外几篇关于《[Cloud-init][8]》和《[Cloud-init 服务][9]》的教程(也是在树莓派上运行),你可以搭建任何你想要的家庭实验室,这样你就可以学习如何管理属于自己的开放混合云。
|
||||
|
||||
### Kubernetes 命令
|
||||
|
||||
一旦你运行起 Kubernetes 后,可以看看 Jessica Cherry 的文章和附带的备忘清单,这个清单列出了所有的[基本的 Kubernetes 命令][10]。在她的文章中,她解释了 `kubectl` 命令的语法,简单讲述了每个命令和子命令是用来做什么的。
|
||||
|
||||
### 有趣的 Kubernetes 项目
|
||||
|
||||
没有什么比拥有技术却不知道该怎么用它更令人沮丧的了。例如,在你的办公桌上有一个树莓派是一回事,但是决定它的 CPU 应该用来做什么工作却完全是另一回事。我们发布了很多教程,来指导你完成你的 Kubernetes 之路的探索:
|
||||
|
||||
* [Helm][11] 是一个 Kubernetes 的包管理器。你可以在它的帮助下,很快熟悉 Kubernetes 环境。
|
||||
* 学习下 [Operator SDK][12] 的所有内容,来熟悉 Kubernetes 的对象和操作器。
|
||||
* [在 Kubernetes 之上搭建网络文件系统(NFS)][13]
|
||||
* 学习如何使用 [Skipper][14] 或 [Traefik][15] 进行流量调度。
|
||||
|
||||
最重要的,花点时间来熟悉容器和 Kubernetes。不论你先把容器化的应用放到服务器、云上还是桌面,它们都是能帮助你理解的重要的范例,因为它们是一个强大的构造,可以让 Linux 的应用变得更好、更健壮、鲁棒性更好、更简单。一定要投入精力去学习它们,你不会后悔的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/kubernetes-anniversary
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[lxbwolf](https://github.com/lxbwolf)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [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/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek "Ship captain sailing the Kubernetes seas"
|
||||
[2]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[3]: https://opensource.com/resources/what-is-kubernetes
|
||||
[4]: https://opensource.com/life/16/9/containing-container-chaos-kubernetes
|
||||
[5]: https://linux.cn/article-11749-1.html
|
||||
[6]: https://linux.cn/article-8902-1.html
|
||||
[7]: https://linux.cn/article-8499-1.html
|
||||
[8]: https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab
|
||||
[9]: https://opensource.com/article/20/5/create-simple-cloud-init-service-your-homelab
|
||||
[10]: https://opensource.com/article/20/5/kubectl-cheat-sheet
|
||||
[11]: https://linux.cn/article-12007-1.html
|
||||
[12]: https://opensource.com/article/20/3/kubernetes-operator-sdk
|
||||
[13]: https://opensource.com/article/20/6/kubernetes-nfs-client-provisioning
|
||||
[14]: https://opensource.com/article/20/4/http-kubernetes-skipper
|
||||
[15]: https://opensource.com/article/20/3/kubernetes-traefik
|
@ -0,0 +1,119 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12364-1.html)
|
||||
[#]: subject: (Style your data plots in Python with Pygal)
|
||||
[#]: via: (https://opensource.com/article/20/6/pygal-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
|
||||
使用 Pygal 在 Python 中设置数据图的样式
|
||||
======
|
||||
|
||||
> 介绍一种更时尚的 Python 绘图库。
|
||||
|
||||

|
||||
|
||||
[Python][2] 有很多可以将数据可视化的库。其中一个互动性较强的库是 Pygal,我认为这个库适合喜欢漂亮事物的人。它可以生成用户可以与之交互的漂亮的 SVG(可缩放矢量图形)文件。SVG 是交互式图形的标准格式,仅使用几行 Python 就可以带来丰富的用户体验。
|
||||
|
||||
### 使用 Pygal 进行时尚的 Python 绘图
|
||||
|
||||
在本文中,我们要重新创建多柱状图,用来表示 1966 年至 2020 年英国大选的结果:
|
||||
|
||||
![Pygal plot][3]
|
||||
|
||||
在继续之前,请注意你可能需要调整 Python 环境以使此代码运行,包括:
|
||||
|
||||
* 运行最新版本的 Python([Linux][4]、[Mac][5] 和 [Windows][6] 的说明)
|
||||
* 确认你运行的是与这些库兼容的 Python 版本
|
||||
|
||||
数据可在线获得,并可使用 pandas 导入:
|
||||
|
||||
```
|
||||
import pandas as pd
|
||||
df = pd.read_csv('https://anvil.works/blog/img/plotting-in-python/uk-election-results.csv')
|
||||
```
|
||||
|
||||
现在我们可以继续进行了。。数据如下所示:
|
||||
|
||||
```
|
||||
year conservative labour liberal others
|
||||
0 1966 253 364 12 1
|
||||
1 1970 330 287 6 7
|
||||
2 Feb 1974 297 301 14 18
|
||||
.. ... ... ... ... ...
|
||||
12 2015 330 232 8 80
|
||||
13 2017 317 262 12 59
|
||||
14 2019 365 202 11 72
|
||||
```
|
||||
|
||||
在 Pygal 中进行绘制会以一种易于阅读的方式显示。首先,我们以一种简化柱状图定义的方式定义样式对象。然后我们将自定义样式以及其他元数据传递给 `Bar` 对象:
|
||||
|
||||
```
|
||||
import pygal
|
||||
from pygal.style import Style
|
||||
|
||||
custom_style = Style(
|
||||
colors=('#0343df', '#e50000', '#ffff14', '#929591'),
|
||||
font_family='Roboto,Helvetica,Arial,sans-serif',
|
||||
background='transparent',
|
||||
label_font_size=14,
|
||||
)
|
||||
|
||||
c = pygal.Bar(
|
||||
title="UK Election Results",
|
||||
style=custom_style,
|
||||
y_title='Seats',
|
||||
width=1200,
|
||||
x_label_rotation=270,
|
||||
)
|
||||
```
|
||||
|
||||
然后,我们将数据添加到 `Bar` 对象中:
|
||||
|
||||
```
|
||||
c.add('Conservative', df['conservative'])
|
||||
c.add('Labour', df['labour'])
|
||||
c.add('Liberal', df['liberal'])
|
||||
c.add('Others', df['others'])
|
||||
|
||||
c.x_labels = df['year']
|
||||
```
|
||||
|
||||
最后,我们将图另存为 SVG 文件:
|
||||
|
||||
```
|
||||
c.render_to_file('pygal.svg')
|
||||
```
|
||||
|
||||
结果是一个交互式 SVG 图,你可以在此 gif 中看到:
|
||||
|
||||
![The Python pygal library can generate rich SVG files as seen here][7]
|
||||
|
||||
精美简单,并且效果漂亮。
|
||||
|
||||
### 总结
|
||||
|
||||
Python 中的某些绘图工具需要非常详细地构建每个对象,而 Pygal 从一开始就为你提供这些。如果你手边有数据并且想做一个干净、漂亮、简单的交互式图表,请尝试一下 Pygal。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/pygal-python
|
||||
|
||||
作者:[Shaun Taylor-Morgan][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/shaun-taylor-morgan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_python.jpg?itok=G04cSvp_ (Python in a coffee cup.)
|
||||
[2]: https://opensource.com/article/20/4/plot-data-python
|
||||
[3]: https://opensource.com/sites/default/files/uploads/pygal_1.png (Pygal plot)
|
||||
[4]: https://opensource.com/article/20/4/install-python-linux
|
||||
[5]: https://opensource.com/article/19/5/python-3-default-mac
|
||||
[6]: https://opensource.com/article/19/8/how-install-python-windows
|
||||
[7]: https://opensource.com/sites/default/files/uploads/pygal-interactive_3.gif (The Python pygal library can generate rich SVG files as seen here)
|
||||
[8]: https://anvil.works/blog/plotting-in-pygal
|
@ -0,0 +1,241 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12340-1.html)
|
||||
[#]: subject: (5 ways to examine the content of files on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3561490/5-ways-to-examine-the-content-of-files-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
在 Linux 上查看文件内容的 5 种方法
|
||||
======
|
||||
|
||||
> 如何使用 cat、more、head 和 tail 命令查看 Linux 文件的内容,而不仅仅是文本文件。
|
||||
|
||||

|
||||
|
||||
Linux 提供了许多命令来查看文件的内容,包 括 `cat`、`more`、`head` 和 `tail`,但这只是一个开始。
|
||||
|
||||
一方面,即使是最显而易见的命令也有很多许多用户不会去使用的选项。还有一些普普通通的命令提供了一些独特的功能。在本文中,我们将介绍查看文件内容的命令,以及如何定制这些视图以更好地满足你的需求的选项。
|
||||
|
||||
### cat
|
||||
|
||||
`cat` 命令将文本文件的全部内容发送到终端窗口以供查看。实际上,如果你输入 `cat`,然后输入包含数千行内容的文件名,那么这些行将以极快的速度在你的窗口中滚动,你将无法看到除了最后一屏外的其他文本。对于 Linux 用户来说 `cat` 命令很熟悉,但即使是这个基本命令也提供了许多有用的选项,例如对输出中的行进行编号,这是我们许多人可能从未使用过的。更进一步,你不仅可以对行进行编号,还可以选择如何编号。
|
||||
|
||||
对每行进行编号就像这样:
|
||||
|
||||
```
|
||||
$ cat -n msg
|
||||
1 Hello --
|
||||
2
|
||||
3 I hope you are having a wonderful day!
|
||||
4
|
||||
5
|
||||
6 That's it for ... now
|
||||
7
|
||||
8 bye!
|
||||
9
|
||||
10 s.
|
||||
```
|
||||
|
||||
你也可以只对有内容的行编号。请注意,对于此命令,仅包含空格的行不被视为“空”,而是会被编号。
|
||||
|
||||
```
|
||||
$ cat -b msg
|
||||
1 Hello --
|
||||
|
||||
2 I hope you are having a wonderful day!
|
||||
|
||||
|
||||
3 That's it for ... now
|
||||
|
||||
4 bye!
|
||||
|
||||
5 s.
|
||||
```
|
||||
|
||||
`cat` 命令允许你使用 `-s` 选项忽略重复的空白行,但是要完全忽略空白行你必须添加另一个命令。
|
||||
|
||||
```
|
||||
$ cat -s msg
|
||||
Hello --
|
||||
|
||||
I hope you are having a wonderful day!
|
||||
|
||||
That's it for ... now
|
||||
|
||||
bye!
|
||||
|
||||
s.
|
||||
```
|
||||
|
||||
要忽略所有空白行,只需如下将 `cat` 的输出通过管道传递给 `grep` 命令。 点(`.`)匹配包含任意字符的文本,因此它将显示任意非空的行,用于结束一行的回车换行做匹配(LCTT 译注:此处原文有误,径改)。
|
||||
|
||||
```
|
||||
$ cat msg | grep .
|
||||
Hello --
|
||||
I hope you are having a wonderful day!
|
||||
That's it for ... now
|
||||
bye!
|
||||
s.
|
||||
```
|
||||
|
||||
`-E` 选项通过在每行末尾加 `$` 符提供视觉提示,来显示行尾是否还有多余的空格。
|
||||
|
||||
```
|
||||
$ cat -E msg
|
||||
Hello --$
|
||||
$
|
||||
I hope you are having a wonderful day! $
|
||||
$
|
||||
$
|
||||
That's it for ... now$
|
||||
$
|
||||
bye!$
|
||||
$
|
||||
s.$
|
||||
```
|
||||
|
||||
使用 `-A` 时,既可以在每行的末尾显示 `$` 字符,并且制表符会显示为 `^I` 而不是空白。
|
||||
|
||||
```
|
||||
$ cat -A msg
|
||||
Hello --$
|
||||
$
|
||||
I hope you are having a wonderful day!$
|
||||
$
|
||||
$
|
||||
That’s it for ...^Inow$
|
||||
$
|
||||
bye!$
|
||||
$
|
||||
s.$
|
||||
```
|
||||
|
||||
### 使用 head 和 tail 显示文件部分内容
|
||||
|
||||
`head` 和 `tail` 显示文件的头部或尾部,默认为十行。 你可以使用 `-3`(显示 3 行)或 `-11`(显示 11 行)之类的字符串来指定要查看的其它行数。`tail` 命令与 `head` 的工作方式相同,但是显示文件的尾部而不是头部。
|
||||
|
||||
```
|
||||
$ head -3 msg
|
||||
Hello --
|
||||
I hope you are having a wonderful day!
|
||||
$ tail -3 msg
|
||||
bye!
|
||||
|
||||
s.
|
||||
```
|
||||
|
||||
你还可以结合使用 `head` 和 `tail` 命令来查看文件中间的文本。你只需要选择起点和想要查看行数即可。在此例中,命令将在文件中显示第二个一百行,并在 `cat` 的帮助下为这些行编号。
|
||||
|
||||
```
|
||||
$ cat -b mybigfile | head -200 | tail -100
|
||||
101 Invoice #2020-06-07a sent to vendor
|
||||
...
|
||||
```
|
||||
|
||||
### 使用 more 或者 less 浏览一屏文本
|
||||
|
||||
`more` 命令是一次浏览一屏内容的自然之选,而 `less` 通过使用上下键盘箭头增加了在文件中上下移动的能力,这样你就可以遍历内容,然后在文件中回退。
|
||||
|
||||
### 使用 od 查看文本的两种方法
|
||||
|
||||
`od`(八进制转储)命令能够以常规文本和一系列 ASCII 值(即该文本在文件中的实际编码方式)的形式查看文件。在下面的例子中可以看到,带编号的行显示了 ASCII 数字值,而其他行则显示了文本和不可打印的字符。
|
||||
|
||||
```
|
||||
$ od -bc msg
|
||||
0000000 110 145 154 154 157 040 055 055 012 012 111 040 150 157 160 145
|
||||
H e l l o - - \n \n I h o p e
|
||||
0000020 040 171 157 165 040 141 162 145 040 150 141 166 151 156 147 040
|
||||
y o u a r e h a v i n g
|
||||
0000040 141 040 167 157 156 144 145 162 146 165 154 040 144 141 171 041
|
||||
a w o n d e r f u l d a y !
|
||||
0000060 012 012 012 124 150 141 164 047 163 040 151 164 040 146 157 162
|
||||
\n \n \n T h a t ' s i t f o r
|
||||
0000100 040 056 056 056 011 156 157 167 012 012 142 171 145 041 012 012
|
||||
. . . \t n o w \n \n b y e ! \n \n
|
||||
0000120 163 056 012
|
||||
s . \n
|
||||
```
|
||||
|
||||
请注意,换行符显示为 `\n`(八进制 `012`),而制表符显示为 `\t`(八进制 `011`)。
|
||||
|
||||
`od` 命令特别有用的用途之一是查看非文本文件以获取可以标识文件类型的信息。在这里,我们看到 `JFIF`(JPEG 文件交换格式)标签,该标签让 `file` 之类报告文件类型的命令将它标示为 jpg 文件。这里还有很多其他有用的信息,特别是如果你对这些文件的格式感到好奇的话。
|
||||
|
||||
在接下来的命令中,我们查看 jpg 文件的开始部分。
|
||||
|
||||
```
|
||||
$ od -bc arrow.jpg | head -12
|
||||
0000000 377 330 377 340 000 020 112 106 111 106 000 001 001 000 000 001
|
||||
377 330 377 340 \0 020 J F I F \0 001 001 \0 \0 001
|
||||
0000020 000 001 000 000 377 333 000 103 000 003 002 002 002 002 002 003
|
||||
\0 001 \0 \0 377 333 \0 C \0 003 002 002 002 002 002 003
|
||||
0000040 002 002 002 003 003 003 003 004 006 004 004 004 004 004 010 006
|
||||
002 002 002 003 003 003 003 004 006 004 004 004 004 004 \b 006
|
||||
0000060 006 005 006 011 010 012 012 011 010 011 011 012 014 017 014 012
|
||||
006 005 006 \t \b \n \n \t \b \t \t \n \f 017 \f \n
|
||||
0000100 013 016 013 011 011 015 021 015 016 017 020 020 021 020 012 014
|
||||
\v 016 \v \t \t \r 021 \r 016 017 020 020 021 020 \n \f
|
||||
0000120 022 023 022 020 023 017 020 020 020 377 333 000 103 001 003 003
|
||||
022 023 022 020 023 017 020 020 020 377 333 \0 C 001 003 003
|
||||
```
|
||||
|
||||
如果我们要 `file` 命令提供有关此图像的信息,我们可能会看到类似下面这样的信息。`file` 命令从文件开头的数据中提取了所有这些描述性信息:
|
||||
|
||||
```
|
||||
$ file arrow.jpg
|
||||
arrow.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 500x375, components 3
|
||||
```
|
||||
|
||||
### 使用 jp2a 将文件视为基于文本的图像
|
||||
|
||||
如果你只能在命令行工作,并且想了解特定图像包含的内容,那么可以使用 `jp2a`(jpeg to ascii)之类的工具提供字符渲染。图像在这种格式下的识别程度取决于文件。不要有太多期待,因为你将看到的图像版本是“低分辨率”下的测试!这是一只分辨率很低的帝王企鹅。(请离远点看)
|
||||
|
||||
```
|
||||
$ jp2a Emperor_Penguin.jpg
|
||||
MMMMMMMMWOdkNMMMMMMMMMMMMMMMMMMM
|
||||
MMMXK0kc.... ,OKMMMMMMMMMMMMMMMM
|
||||
MMNK0Ol... :Xx'dNMMMMMMMMMMMMM
|
||||
MMMMMMMd;lx00Oo. ..xMMMMMMMMMMMM
|
||||
MMMMMMK.OXMMMMMN,...lMMMMMMMMMMM
|
||||
MMMMMMx'KXNNMMMMK....0MMMMMMMMMM
|
||||
MMMMMMx:kkKNWWMMMl.. 'NMMMMMMMMM
|
||||
MMMMMMddx0NNNWMMMK'...;NMMMMMMMM
|
||||
MMMMMMck0NNWWWWWMMd ..lMMMMMMMM
|
||||
MMMMMM.d0KXNWWWWMMo ...WMMMMMMM
|
||||
MMMMMM.xOXNNWNMMMW. ....KMMMMMMM
|
||||
MMMMMM'kKNKWXWMMMK ..'.0MMMMMMM
|
||||
MMMMMMxckXNNNNMMMX .:..XMMMMMMM
|
||||
MMMMMMW;xKNWWWMMMM. .;. NMMMMMMM
|
||||
MMMMMMMok0NNWNWMMMx .l..MMMMMMMM
|
||||
MMMMMMMkxOKXWXNMMMMl.:'dMMMMMMMM
|
||||
MMMMMMM0dKOdKXXNMMMMNx,WMMMMMMMM
|
||||
MMMMMMMWoKxldXKNNMMMMM;MMMMMMMMM
|
||||
MMMMMMMMxxxxdNWNXNMMMM;MMMMMMMMM
|
||||
MMMMMMMMxOcoo0XOOOOWMW,kMMMMMMMM
|
||||
MMMMMMM0xK;.cO0dNX:0XXd;NMMMMMMM
|
||||
MMMNkdd:,'ldXXO0xl;x0kx:;lKMMMMM
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
Linux 上有很多命令可以通过各种方式查看文件的内容。其中一些选项在你需要处理文件内容时可能会非常有用。其它的只是……有趣。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3561490/5-ways-to-examine-the-content-of-files-on-linux.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://unsplash.com/photos/q65bNe9fW-w
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,126 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12311-1.html)
|
||||
[#]: subject: (How to Change Folder Color in Ubuntu 20.04)
|
||||
[#]: via: (https://itsfoss.com/folder-color-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
如何在 Ubuntu 20.04 中更改文件夹颜色
|
||||
======
|
||||
|
||||

|
||||
|
||||
[Ubuntu 20.04][1] 中默认的 Yaru 主题赋予它优美、现代的外观。默认 Yaru 主题中的文件夹是紫色的外观,以与 Ubuntu 的品牌保持一致。
|
||||
|
||||
如果你不喜欢紫色,可以在 Ubuntu 中自由更改颜色主题。你可以更改 Ubuntu 的主题以使其有不同的颜色,但这将意味着放弃 Yaru 主题。
|
||||
|
||||
如果你只想在 Ubuntu 20.04 中更改文件夹的颜色,可以有两种方法:
|
||||
|
||||
* 为选定的文件夹赋予不同的颜色和标志(以便更好地组织文件和文件夹)
|
||||
* 通过更改 Yaru 颜色主题来更改所有文件夹的颜色
|
||||
|
||||
让我向你展示两种方法。
|
||||
|
||||
### 更改所选文件和文件夹的颜色和标志
|
||||
|
||||
![][2]
|
||||
|
||||
我知道有些人将他们的文件夹使用不同的颜色或放在不同的位置,来表示工作正在进行中还是待处理或已完成。
|
||||
|
||||
如果你也是这样的,那么可以使用 [Folder Color 工具][3]更改文件夹的颜色。你还可以在文件夹中添加标志(绿色的勾号表示完成,加号表示新的,感叹号表示重要等)。你可以在上一张图片中看到一些例子。
|
||||
|
||||
你还可以在文件上使用 “Folder Color” 工具。你不能更改文件图标的颜色,但可以添加标志。
|
||||
|
||||
如果你在 Ubuntu 20.04 中[使用 Yaru 主题][4],你可以使用[官方 PPA][5]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:costales/yaru-colors-folder-color
|
||||
```
|
||||
|
||||
现在,使用 Yaru 兼容包安装 Folder Color。
|
||||
|
||||
```
|
||||
sudo apt install folder-color yaru-colors-folder-color
|
||||
```
|
||||
|
||||
安装后,你必须使用 `nautilus -q` 命令重启 Nautilus 文件管理器。之后,你可以进入文件管理器,右键单击文件夹或文件。你会在上下文菜单中看到 Folder Color 的选项。你将在此处看到颜色和标志选项。
|
||||
|
||||
![][6]
|
||||
|
||||
你还可以通过在菜单**通过选择“默认”恢复原始文件夹颜色**。
|
||||
|
||||
对于 Ubuntu 18.04 或更早版本,可以从软件中心安装 Folder Color。它还可用于 Linux Mint/Cinnamon 桌面的 Nemo 文件管理器和 MATE 桌面的 [Caja 文件管理器][7]。
|
||||
|
||||
#### 如何删除 Folder Color?
|
||||
|
||||
如果你不想使用 Folder Color,你可以删除应用并删除 PPA。首先删除该应用:
|
||||
|
||||
```
|
||||
sudo apt remove folder-color yaru-colors-folder-color
|
||||
```
|
||||
|
||||
现在[删除 PPA][8]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository -r ppa:costales/yaru-colors-folder-color
|
||||
```
|
||||
|
||||
### Yaru Colors 主题包更改 Yaru 主题颜色
|
||||
|
||||
![Yaru Colors Blue Theme Variant][9]
|
||||
|
||||
如果你想继续使用 Yaru 主题但使用不同的颜色,那么需要[Yaru Colors 主题包][10]。
|
||||
|
||||
Yaru Colors 由 12 种 Yaru 颜色变体组成。它们浅绿色、蓝色、棕色、深蓝色、绿色、灰色、MATE 绿、橙色、粉红色、紫色、红色和黄色。
|
||||
|
||||
主题包括 GTK 主题、图标、光标和 GNOME Shell 主题。
|
||||
|
||||
* 图标:更改文件夹的强调色
|
||||
* GTK 主题:更改应用窗口的强调色
|
||||
* 光标主题:向光标添加几乎可以忽略的色彩轮廓
|
||||
* GNOME Shell 主题:更改消息托盘和系统托盘中的强调色
|
||||
|
||||
你可以从它的 GitHub 仓库下载 Yaru Colors 主题包:
|
||||
|
||||
#### 下载 Yaru Colors 主题包
|
||||
|
||||
在提取内容时,你会发现图标、主题文件夹,这两个文件夹都包含上述十二种颜色。你可以分别在 `~/.local/share/.icons` 和 `~/.local/share/themes` 文件夹中复制图标和主题文件夹。
|
||||
|
||||
如果你不想亲自复制,那么你可以在解压文件夹中找到 `install.sh` 脚本。你可以运行它来通过交互式终端会话安装全部或选定的几个主题。
|
||||
|
||||
![][11]
|
||||
|
||||
要更改 GNOME Shell 主题,你必须[使用 GNOME Tweak 工具][12]。你也可以使用 GNOME Tweak 将图标和主题更改回默认。
|
||||
|
||||
![][13]
|
||||
|
||||
享受为你的 Ubuntu 生活增色 :)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/folder-color-ubuntu/
|
||||
|
||||
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/download-ubuntu-20-04/
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/folder-colors-yaru-ubuntu.png?ssl=1
|
||||
[3]: https://foldercolor.tuxfamily.org/
|
||||
[4]: https://itsfoss.com/ubuntu-community-theme/
|
||||
[5]: https://launchpad.net/folder-color
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/change-folder-color-ubuntu.png?ssl=1
|
||||
[7]: https://github.com/mate-desktop/caja
|
||||
[8]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
|
||||
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/yaru-colors-blue-theme-variant.jpg?ssl=1
|
||||
[10]: https://github.com/Jannomag/Yaru-Colors
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/yaru-colors-theme-install.png?resize=800%2C513&ssl=1
|
||||
[12]: https://itsfoss.com/gnome-tweak-tool/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/restore-yaru-gnome-tweak.png?resize=800%2C557&ssl=1
|
103
published/202006/20200610 How to write functions in Bash.md
Normal file
103
published/202006/20200610 How to write functions in Bash.md
Normal file
@ -0,0 +1,103 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12323-1.html)
|
||||
[#]: subject: (How to write functions in Bash)
|
||||
[#]: via: (https://opensource.com/article/20/6/bash-functions)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
如何在 Bash 中编写函数
|
||||
======
|
||||
|
||||
> 通过编写函数来减少代码的冗余和维护。
|
||||
|
||||

|
||||
|
||||
在编程时,实际上是在定义要由计算机执行的<ruby>过程<rt>procedure</rt></ruby>或<ruby>例程<rt>routine</rt></ruby>。一个简单的类比是将计算机编程与烤面包进行比较:你一次列出了要组建工作环境的配料,然后列出了烤面包所必须采取的步骤。在编程和烘烤中,必须以不同的间隔重复执行某些步骤。例如,在烤面包中,这可能是酵母培养的过程:
|
||||
|
||||
```
|
||||
STIR=100
|
||||
SNOOZE=86400
|
||||
|
||||
function feed_culture {
|
||||
remove_from(pantry)
|
||||
add(flour, water)
|
||||
stir($STIR)
|
||||
sleep($SNOOZE)
|
||||
}
|
||||
```
|
||||
|
||||
然后,揉面和醒发面团:
|
||||
|
||||
```
|
||||
KNEAD=600
|
||||
SNOOZE=7200
|
||||
|
||||
function process_dough {
|
||||
remove_from(proofing_drawer)
|
||||
knead($KNEAD)
|
||||
return_to_drawer($SNOOZE)
|
||||
}
|
||||
```
|
||||
|
||||
在编程中,这些<ruby>子例程<rt>subroutines</rt></ruby>可以表示为<ruby>函数<rt>function</rt></ruby>。函数对程序员很重要,因为它们有助于减少代码中的冗余,从而减少了所需的维护量。例如,在以编程方式烤制面包的假想场景中,如果你需要更改面团醒发的用时,只要你之前使用函数,那么你只需更改一次用时,或使用变量(在示例代码中为 `SNOOZE`)或直接在处理面团的子程序中更改用时。这样可以节省你很多时间,因为你不必通过你的代码库遍历每个可能正在醒发的面团,更不用说担心错过一个。许多 bug 是由未更改的缺失的值或执行不正确的 `sed` 命令引起的,它们希望捕获所有可能而不必手动寻找。
|
||||
|
||||
在 [Bash][2] 中,无论是在编写的脚本或在独立的文件中,定义函数和使用它们一样简单。如果将函数保存到独立的文件中。那么可以将它 `source` 到脚本中,就像 `include` C 语言或 C++ 中的库或将模块 `import` 到 Python 中一样。要创建一个 Bash 函数,请使用关键字 `function`:
|
||||
|
||||
```
|
||||
function foo {
|
||||
# code here
|
||||
}
|
||||
```
|
||||
|
||||
这是一个如何在函数中使用参数的例子(有些人为设计,因此可能会更简单):
|
||||
|
||||
```
|
||||
#!/usr/bin/env bash
|
||||
ARG=$1
|
||||
|
||||
function mimic {
|
||||
if [[ -z $ARG ]]; then
|
||||
ARG='world'
|
||||
fi
|
||||
echo "hello $ARG"
|
||||
}
|
||||
|
||||
mimic $ARG
|
||||
```
|
||||
|
||||
结果如下:
|
||||
|
||||
```
|
||||
$ ./mimic
|
||||
hello world
|
||||
$ ./mimic everybody
|
||||
hello everybody
|
||||
```
|
||||
|
||||
请注意脚本的最后一行,它会执行该函数。对于编写脚本的新手来说,这是一个普遍的困惑点:函数不会自动执行。它们作为*潜在的*例程存在,直到被调用。
|
||||
|
||||
如果没有调用该函数,那么函数只是被定义,并且永远不会运行。
|
||||
|
||||
如果你刚接触 Bash,请尝试在包含最后一行的情况下执行示例脚本一次,然后在注释掉最后一行的情况下再次执行示例脚本。
|
||||
|
||||
### 使用函数
|
||||
|
||||
即使对于简单的脚本,函数也是很重要的编程概念。你越适应函数,在面对一个不仅需要声明性的命令行,还需要更多动态的复杂问题时,你就会越容易。将通用函数保存在单独的文件中还可以节省一些工作,因为它将帮助你建立常用的程序,以便你可以在项目间重用它们。看看你的脚本习惯,看是否适合使用函数。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/bash-functions
|
||||
|
||||
作者:[Seth Kenlon][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/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
|
||||
[2]: https://opensource.com/resources/what-bash
|
@ -0,0 +1,137 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12347-1.html)
|
||||
[#]: subject: (How I stream video with OBS and WebSockets)
|
||||
[#]: via: (https://opensource.com/article/20/6/obs-websockets-streaming)
|
||||
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
|
||||
|
||||
如何用 OBS 和 WebSockets 播放视频流
|
||||
======
|
||||
|
||||
> 用这些简化了 WebSockets 的开源支持工具来控制你的流媒体。
|
||||
|
||||

|
||||
|
||||
[OBS][2] 是现在视频直播的主流之一。它是直播流媒体到 Twitch 的首选软件,Twitch 是近来最受欢迎的视频直播网站之一。有一些非常好的附加组件,可以让流媒体人从他们的手机或另一个屏幕上进行控制,而不影响正在运行的视频。事实证明,使用 [Node-RED][3] 和 [obs-websockets][4] 插件来构建自己的控制面板真的很容易。
|
||||
|
||||
![My OBS Control Dashboard][5]
|
||||
|
||||
*我的 OBS 控制仪表盘*
|
||||
|
||||
我知道你们很多人在想什么 —— “他在同一句话中提到了 WebSockets 和简单?”很多人在设置和使用 WebSockets 时遇到了困难,WebSockets 允许通过 Web 服务器的单一连接进行双向通信。Node-RED 内置了对 WebSockets 的支持,是让这一切变得简单的原因之一,至少与编写自己的客户端/服务器相比是如此。
|
||||
|
||||
在开始之前,请确保你已经安装和配置了 OBS。首先下载并安装[最新稳定版的 obs-websockets][6]插件。对于本文来说,默认的设置就可以了,但我强烈建议你之后按照说明来保护 obs-websockets 的安全。
|
||||
|
||||
接下来,[下载并安装 Node-RED][7],可以在同一个系统上,也可以在不同的系统上(比如树莓派)。同样,默认的安装对我们这篇文章来说是够了,但最好按照他们网站上的指示进行安全安装。
|
||||
|
||||
现在是有趣的部分。启动 Node-RED,打开网页界面(默认在 <http://localhost:1880>),你有了一个空白的画布。打开右边的“汉堡”菜单,选择“<ruby>管理口味<rt>Manage Palate</rt></ruby>”。然后点击“安装”标签,搜索 `node-red-contrib-dashboard` 和 `node-red-contrib-rbe` 模块。
|
||||
|
||||
安装好这些模块后,点击右侧列表,将以下模块拖拽到画布上。
|
||||
|
||||
* 1 Websocket Out
|
||||
* 1 Websocket In
|
||||
* 1 Debug
|
||||
* 1 Inject
|
||||
* 1 Switch
|
||||
* 1 Change
|
||||
* 2 JSON
|
||||
* 1 Catch
|
||||
|
||||
以下列顺序连接它们:
|
||||
|
||||
```
|
||||
Inject->Button->Change->JSON->Websocket Out
|
||||
|
||||
Websocket In->JSON->Switch->RBE->Debug
|
||||
|
||||
Catch->Debug
|
||||
```
|
||||
|
||||
![The basic flows][8]
|
||||
|
||||
*基本流程*
|
||||
|
||||
当 “Button” 被按下时(或 “Inject” 节点发送一个时间戳),有效载荷通过 “change” 节点发送,从 JSON 对象转换为字符串,然后发送到 “WebSocket Out” 节点。当 “WebSocket In” 节点收到消息后,会将其转换为 JSON 对象,如果不是重复的,则发送到 “Debug” 节点进行输出。而 “Catch” 节点会捕捉到任何错误,并将其放入 “Debug” 面板中。
|
||||
|
||||
那有效载荷里有什么呢?让我们设置好一切,一探究竟。
|
||||
|
||||
首先,双击 “Button” 打开设置对话框。先使用下拉菜单将有效载荷改为 “JSON”。在该字段中,添加以下内容:
|
||||
|
||||
```
|
||||
{"request-type":"GetVersion"}
|
||||
```
|
||||
|
||||
启用 “If msg arrives on input, emulate a button click” 复选框,然后点击 “Done” 关闭 “Button” 配置。当消息从 “Inject” 节点传来时,或者 UI 中的 “Button” 被按下,它将把 JSON 有效载荷发送到下一个节点。
|
||||
|
||||
![Setting up the button][9]
|
||||
|
||||
*设置 “Button”*
|
||||
|
||||
现在打开 “Change” 节点。我们要将 `msg.payload.message-id` 设置为 `msg._msgid`,方法是将第一个字段从 `payload` 改为 `payload.message-id`,然后使用第二个字段的下拉菜单将类型从 `String` 改为 `msg.`,然后我们将 `_msgid` 放入该字段。这样就会把唯一的消息 ID 复制到 JSON 对象的有效载荷中,这样每个请求就有一个唯一的 ID 进行跟踪。
|
||||
|
||||
然后将其发送到 “JSON” 节点,以便将 JSON 对象转换为字符串,然后传递给 “Websocket Out” 节点。打开 “Websocket Out” 节点,配置到 OBS 的连接。首先,将 `Type` 更改为 `Connect to`,然后单击铅笔图标以创建新的连接 URL。将其设置为 `ws://OBSMachine:4444/`,然后关闭对话框进行保存。`OBSMachine` 是 OBS 和 obs-websocket 运行的机器名称。例如,如果 Node-RED 运行在同一台机器上,则为 `ws://localhost:4444`,如果是在名为 `luxuria.local` 的机器上,则为 `ws://luxuria.local:4444`。关闭并更新 “Websocket Out” 节点。这将向 OBS 中的 WebSocket 发送有效载荷文本字符串。
|
||||
|
||||
![Websocket Out Node configuration][10]
|
||||
|
||||
*“Websocket Out” 节点配置*
|
||||
|
||||
进入 “WebSocket In” 流程!打开 “WebSocket In” 节点,并对其设置 `Type` 为 `Connect to` 和我们之前定义的连接的 URL(应自动填充)。接下来是第二个 “JSON” 节点,我们可以不用管它。它接受 OBS 的输出,并将其转换为有效载荷对象。
|
||||
|
||||
接下来,我们将从中过滤出常规的心跳和状态更新。打开 “Switch”,将 `Property` 值设置为 `payload["update-type"]`。现在从它下面的下拉菜单中选择 `Is Not Null`。点击 `+` 添加第二个选项,并从下拉菜单中选择 `otherwise`。
|
||||
|
||||
![Switch Node configuration][11]
|
||||
|
||||
*“Switch” 节点配置*
|
||||
|
||||
将 “Switch” 上的新输出直接连接到 “Debug” 节点的输入。
|
||||
|
||||
RBE 节点将过滤掉重复的内容,需要告诉它要观察什么字段。由于它应该连接到 “Switch” 的输出,而它只发送状态更新,所以这一点很重要,因为 obs-websocket 每隔几秒钟就会发送更新。默认情况下,RBE 会比较整个有效载荷对象,它将不断变化。打开 RBE 节点,将 `Property` 从 `payload` 改为 `payload.streaming`。如果 `payload` 的 `streaming` 值发生了变化,那么就把消息传递过去,否则就丢弃。
|
||||
|
||||
最后一步是将 “Debug” 节点的输出从 `msg.payload` 改为完整的 `msg` 对象。这使我们能够看到整个对象,有时在 `payload` 之外还有有用的信息。
|
||||
|
||||
现在,单击 “Deploy” 以激活更改。希望 WebSocket 节点下面会有绿色的 `Connected` 消息。如果它们是红色或黄色的,则连接 URL 可能不正确,需要更新,或者连接被阻止。请确保远程机器上的 4444 端口是开放的、可用的,并且 OBS 正在运行!
|
||||
|
||||
如果没有 RBE 节点对 `streaming` 值的过滤,调试面板(点击画布右侧的“虫子”图标)大约现在就会被心跳消息填满。点击 “Inject” 节点左边的按钮,发送一个模拟按钮点击的信号。如果一切顺利,你应该会看到一个对象到达,它有一个 `obs-websocket` 可以做的所有事情的列表。
|
||||
|
||||
![The response to "GetVersion"][12]
|
||||
|
||||
*对 “GetVersion” 的回应*
|
||||
|
||||
现在在另一个标签或窗口中打开 `http://localhost:1880/ui`。它应该显示一个单一的按钮。按下它! 调试面板应该会显示和之前一样的信息。
|
||||
|
||||
恭喜你!你已经发送了你的第一个(希望不是最后一个)WebSocket 消息!
|
||||
|
||||
这只是使用 obs-websockets 和 Node-RED 可以做的事情的起步。支持的完整文档记录在 obs-websockets 的 GitHub 仓库的 `protocol.md` 文件中。通过一点点的实验,你可以创建一个功能齐全的控制面板来启动和停止流媒体、改变场景,以及更多。如果你和我一样,在意识到之前,你就可以设置好各种控件了。
|
||||
|
||||
![OBS Websocket][13]
|
||||
|
||||
*如此多的能力让我有点疯*
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/obs-websockets-streaming
|
||||
|
||||
作者:[Kevin Sonney][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/ksonney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_film.png?itok=aElrLLrw (An old-fashioned video camera)
|
||||
[2]: https://obsproject.com/
|
||||
[3]: https://nodered.org/
|
||||
[4]: https://github.com/Palakis/obs-websocket
|
||||
[5]: https://opensource.com/sites/default/files/uploads/obscontrol-img1.png.jpg (My OBS Control Dashboard)
|
||||
[6]: https://github.com/palakis/obs-websocket/releases
|
||||
[7]: https://nodered.org/docs/getting-started/
|
||||
[8]: https://opensource.com/sites/default/files/uploads/obscontrol-img2.png.jpg (The basic flows)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/obscontrol-img3.png.jpg (Setting up the button)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/obscontrol-img4.png.jpg (Websocket Out Node configuration)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/obscontrol-img5.png.jpg (Switch Node configuration)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/obscontrol-img6.png.jpg (The response to "GetVersion")
|
||||
[13]: https://opensource.com/sites/default/files/uploads/obscontrol-img7.png.jpg (OBS Websocket)
|
@ -0,0 +1,126 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12346-1.html)
|
||||
[#]: subject: (Import functions and variables into Bash with the source command)
|
||||
[#]: via: (https://opensource.com/article/20/6/bash-source-command)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
使用 source 命令将函数和变量导入 Bash
|
||||
======
|
||||
|
||||
> source 就像 Python 的 import 或者 Java 的 include。学习它来扩展你的 Bash 能力。
|
||||
|
||||

|
||||
|
||||
登录 Linux shell 时,你将继承特定的工作环境。对于 shell 而言,“<ruby>环境<rt>environment</rt></ruby>”意味着已经为你设置了某些变量,以确保你的命令可以按预期工作。例如,[PATH][2] 环境变量定义 shell 从哪里查找命令。没有它,几乎在 Bash 中尝试执行的所有操作都会因“命令未发现” 错误而失败。在执行日常任务时,环境对你几乎是不可见的,但它很重要。
|
||||
|
||||
有多种方法可以影响你的 shell 环境。你可以在配置文件中进行修改,例如 `~/.bashrc` 和 `~/.profile`,你可以在启动时运行服务,还可以创建自己的自定义命令或编写自己的 [Bash 函数][3] 。
|
||||
|
||||
### 通过 source 添加到你的环境
|
||||
|
||||
Bash(以及其他一些 shell)有一个称为 `source` 的内置命令。这就是令人困惑的地方:`source` 执行与命令 `.` 相同的功能(是的,那只是一个点),而与 `Tcl` 命令的 `source` 不是同一个(如果你输入 `man source`,也许在屏幕上显示的是它)。实际上,内置的 `source` 命令根本不在你的 `PATH` 中。这是 Bash 附带的命令,要获取有关它的更多信息,可以输入 `help source`。
|
||||
|
||||
`.` 命令兼容 [POSIX][4]。 但 `source` 命令不是 POSIX 定义的,但可以与 `.` 命令互换使用。
|
||||
|
||||
根据 Bash `help`,`source` 命令在你当前的 shell 中执行一个文件。 “在你当前的 shell 中” 这句很重要,因为它表示它不会启动子 shell。因此,用 `source` 执行的任何操作都发生在内部并影响*当前*环境。
|
||||
|
||||
在探讨 `source` 对环境的影响之前,请用 `source` 命令导入一个测试文件,以确保其按预期执行代码。首先,创建一个简单的 Bash 脚本并将其保存为 `hello.sh`:
|
||||
|
||||
```
|
||||
#!/usr/bin/env bash
|
||||
echo "hello world"
|
||||
```
|
||||
|
||||
使用 `source`,即使该脚本不设置可执行也可以运行:
|
||||
|
||||
```
|
||||
$ source hello.sh
|
||||
hello world
|
||||
```
|
||||
|
||||
你也可以使用内置的 `.` 命令获得相同的结果:
|
||||
|
||||
```
|
||||
$ . hello.sh
|
||||
hello world
|
||||
```
|
||||
|
||||
`source` 和 `.` 命令成功地执行了测试文件的内容。
|
||||
|
||||
### 设置变量和导入函数
|
||||
|
||||
你可以使用 `source` 将文件 “导入” 到 shell 环境中,就像你可以在 C 或 C++ 中使用 `include` 关键字引用一个库,或者在 Python 中使用 `import` 关键字引入一个模块一样。这是 `source` 的最常见用法之一,它也是 `.bashrc` 中的一个默认包含方式,通过 `source` 导入 `.bash_aliases`,以便将任何你自定义的别名在登录时导入到你的环境。
|
||||
|
||||
这是导入 Bash 函数的示例。首先,在名为 `myfunctions` 的文件中创建一个函数。它将打印你的公共 IP 地址和本地 IP 地址:
|
||||
|
||||
```
|
||||
function myip() {
|
||||
curl <http://icanhazip.com>
|
||||
|
||||
ip addr | grep inet$IP | \
|
||||
cut -d"/" -f 1 | \
|
||||
grep -v 127\\.0 | \
|
||||
grep -v \:\:1 | \
|
||||
awk '{$1=$1};1'
|
||||
}
|
||||
```
|
||||
|
||||
将该函数导入你的 shell:
|
||||
|
||||
```
|
||||
$ source myfunctions
|
||||
```
|
||||
|
||||
测试新函数:
|
||||
|
||||
```
|
||||
$ myip
|
||||
93.184.216.34
|
||||
inet 192.168.0.23
|
||||
inet6 fbd4:e85f:49c:2121:ce12:ef79:0e77:59d1
|
||||
inet 10.8.42.38
|
||||
```
|
||||
|
||||
### source 的搜索
|
||||
|
||||
当你在 Bash 中使用 `source` 时,它将在当前目录中搜索你引用的文件。但并非所有 shell 都这样,因此,如果你不使用 Bash,请查看文档。
|
||||
|
||||
如果 Bash 找不到要执行的文件,它将搜索你的 `PATH`。同样,这并不是所有 shell 的默认设置,因此,如果你不使用 Bash,请查看文档。
|
||||
|
||||
这些都是 Bash 中不错的便利功能。这种出奇地强大,因为它允许你将常用函数保存在磁盘上的一个集中的位置,然后将你的环境视为集成开发环境 (IDE)。你不必担心函数的存储位置,因为你知道它们在你的本地位置等同于在 `/usr/include` 下,因此无论你在哪,当你导入它们时,Bash 都可以找到它们。
|
||||
|
||||
例如,你可以创建一个名为 `~/.local/include` 的目录作为常见函数存储区,然后将此代码块放入 `.bashrc` 文件中:
|
||||
|
||||
```
|
||||
for i in $HOME/.local/include/*;
|
||||
do source $i
|
||||
done
|
||||
```
|
||||
|
||||
这会将 `~/.local/include` 中所有包含自定义函数的文件“导入”到 shell 环境中。
|
||||
|
||||
当你使用 `source` 或 `.` 命令时,Bash 是唯一搜索当前目录和 `PATH` 的 shell。
|
||||
|
||||
### 将 source 用于开源
|
||||
|
||||
使用 `source` 或 `.` 来执行文件是影响环境同时保持变更模块化的一种便捷方法。在下次考虑将大量代码复制并粘贴到 `.bashrc` 文件中时,请考虑将相关函数或别名组放入专用文件中,然后使用 `source` 导入它们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/bash-source-command
|
||||
|
||||
作者:[Seth Kenlon][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/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background)
|
||||
[2]: https://opensource.com/article/17/6/set-path-linux
|
||||
[3]: https://opensource.com/article/20/6/how-write-functions-bash
|
||||
[4]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
|
154
published/202006/20200615 How to use Bash history commands.md
Normal file
154
published/202006/20200615 How to use Bash history commands.md
Normal file
@ -0,0 +1,154 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12344-1.html)
|
||||
[#]: subject: (How to use Bash history commands)
|
||||
[#]: via: (https://opensource.com/article/20/6/bash-history-commands)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
如何使用 Bash history 命令
|
||||
======
|
||||
|
||||
> Bash 的 history 命令在它提供的功能数量上超过了所有其他 Linux Shell 历史接口。
|
||||
|
||||

|
||||
|
||||
Bash 有丰富的历史。也就是说,它是一个古老的的 shell,还有一个更古老的 Shell (Bourne shell)的前辈,但是它还有一个很棒的 `history` 命令,它提供的功能数量超过了所有其他 shell 的历史接口。 [Bash][2] 版本的 `history` 可进行反向搜索、快速调用、重写历史记录等。
|
||||
|
||||
`history` 命令与许多其他命令不同。你可能习惯于将命令作为可执行文件放在常见的系统级位置,例如 `/usr/bin`、`/usr/local/bin` 或者 `~/bin`。 内置的 `history` 命令不在你的 `PATH` 中并且没有物理位置:
|
||||
|
||||
|
||||
```
|
||||
$ which history
|
||||
|
||||
which: no history in [PATH]
|
||||
```
|
||||
|
||||
相反,`history` 是 shell 本身的内置函数:
|
||||
|
||||
```
|
||||
$ type history
|
||||
history is a shell builtin
|
||||
$ help history
|
||||
history: history [-c] [-d offset] [n] or
|
||||
history -anrw [filename] or
|
||||
history -ps arg [arg...]
|
||||
|
||||
Display or manipulate the history list.
|
||||
[...]
|
||||
```
|
||||
|
||||
出于这个原因,每个 shell 中的历史功能都是独特的,因此你在 Bash 中使用的功能可能无法在 Tcsh 或 Fish 或 Dash 中使用,而在这些 shell 中使用的功能可能也无法在 Bash 中使用。在某些情况下,了解 Bash 可以做什么可能会激发其他 shell 的用户创建有趣的改造来复制 Bash 行为,并且可能会解锁你从未知道的 Bash 功能。
|
||||
|
||||
### 查看你的 Bash 历史
|
||||
|
||||
`history` 命令最基本、最频繁的用法是查看 shell 会话的历史记录:
|
||||
|
||||
|
||||
```
|
||||
$ echo "hello"
|
||||
hello
|
||||
$ echo "world"
|
||||
world
|
||||
$ history
|
||||
1 echo "hello"
|
||||
2 echo "world"
|
||||
3 history
|
||||
```
|
||||
|
||||
### 事件指示器
|
||||
|
||||
<ruby>事件指示器<rt>Event designator</rt></ruby>按事件搜索你的历史记录。在这里,“事件”是指记录在历史中的命令,以换行符划定。换句话说,一行一个事件,以索引号来标记。
|
||||
|
||||
事件指示器大多以感叹号开头,有时也称为 “bang”(`!`)。
|
||||
|
||||
要从你的历史记录中重新运行命令,请使用感叹号,之后紧跟(之间没有空格)所需命令的索引号。例如,假设第 1 行包含命令 `echo "hello"`,你想要想再次运行它:
|
||||
|
||||
|
||||
```
|
||||
$ !1
|
||||
echo "hello"
|
||||
hello
|
||||
```
|
||||
|
||||
你可以使用相对定位,提供基于你历史中当前位置向后的负数行号。例如,返回到历史中倒数第三个条目:
|
||||
|
||||
```
|
||||
$ echo "foo"
|
||||
foo
|
||||
$ echo "bar"
|
||||
bar
|
||||
$ echo "baz"
|
||||
baz
|
||||
$ !-3
|
||||
echo "foo"
|
||||
foo
|
||||
```
|
||||
|
||||
如果只想回去一行,那么可以使用速记 `!!` 代替 `!-1`。这节省了按键时间!
|
||||
|
||||
```
|
||||
$ echo "foo"
|
||||
$ !!
|
||||
echo "foo"
|
||||
foo
|
||||
```
|
||||
|
||||
### 字符串搜索
|
||||
|
||||
你也可以对条目搜索特定的字符串,反过来搜索要运行命令。要搜索以指定字符串*开始*的命令,请使用感叹号,之后紧跟(没有空格)要搜索的字符串:
|
||||
|
||||
```
|
||||
$ echo "foo"
|
||||
$ true
|
||||
$ false
|
||||
$ !echo
|
||||
echo "foo"
|
||||
foo
|
||||
```
|
||||
|
||||
你还可以在任意位置(不仅是开头)搜索包含该字符串的命令。为此,请像之前一样使用 `!` 加上要搜索的字符串,但在字符串的两端都用问号(`?`)围绕起来。如果你知道该字符串后紧跟一个换行符,那么可以省略最后的问号(就是在按*回车*之前输入的最后字符):
|
||||
|
||||
```
|
||||
$ echo "foo"
|
||||
$ true
|
||||
$ false
|
||||
$ !?foo?
|
||||
echo "foo"
|
||||
foo
|
||||
```
|
||||
|
||||
### 字符串替换
|
||||
|
||||
类似于在行首搜索字符串,你可以搜索字符串并用新字符串替换它,以更改命令:
|
||||
|
||||
```
|
||||
$ echo "hello"
|
||||
hello
|
||||
$ echo "world"
|
||||
world
|
||||
$ ^hello^foo
|
||||
echo "foo"
|
||||
foo
|
||||
```
|
||||
|
||||
### 让 history 有用
|
||||
|
||||
在 Bash 中,`history` 命令的功能远远超过此处介绍的内容,但这是一个很好的开始, 可以让你习惯使用你的历史记录, 而不是仅仅把它当作一个参考。经常使用 `history` 命令,并试试无需输入命令即可执行的操作。你可能会感到惊讶!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/bash-history-commands
|
||||
|
||||
作者:[Seth Kenlon][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/seth
|
||||
[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/resources/what-bash
|
@ -0,0 +1,221 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12338-1.html)
|
||||
[#]: subject: (Introduction to Homebrew: the painless way to install anything on a Mac)
|
||||
[#]: via: (https://opensource.com/article/20/6/homebrew-mac)
|
||||
[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg)
|
||||
|
||||
|
||||
Homebrew :在 Mac 上无痛安装软件
|
||||
======
|
||||
|
||||
> Homebrew 软件包管理器可以让你轻松地在 Mac 上安装和更新应用程序和实用程序。
|
||||
|
||||

|
||||
|
||||
在我追求“万物自动化”的过程中,我一直坚持走在用代码来管理我的 Mac 笔记本电脑的路上。与其用鼠标或触控板手动管理我的应用程序和实用程序,我更喜欢使用软件包管理软件来安装、更新和删除不需要的软件。
|
||||
|
||||
这对 Mac 用户来说是个挑战。Mac 的操作系统 macOS 始终落后于 Linux 的一个地方就是在包管理方面。Mac 用户没有默认的软件包管理器,而 Linux 用户则有很多选择 —— 从熟悉的 `yum` 和 `apt` 到现代的 [Flatpak][2]。但 Mac 呢?
|
||||
|
||||
这就是 [Homebrew][3] 的作用。Homebrew(自酿)填补了 MacOS 事实上的软件包管理器的空白(它也是 Linux 上的又一个可选的包管理器)。它为任何熟悉命令行的人提供了令人难以置信的流畅而直接的体验,如果你是新手,它是学习命令行的好方法。
|
||||
|
||||
(LCTT 译注:Homebrew 系统中采用了大量针对自酿啤酒相关的比喻,大家在使用过程中会发现这些有趣的形容。)
|
||||
|
||||
如果你在 Mac 上还没有 Homebrew,你可以这样来安装:
|
||||
|
||||
```
|
||||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||
```
|
||||
|
||||
该命令将执行 Homebrew 团队提供的安装程序脚本。如果你喜欢谨慎一点,可以 `curl` 下来这个文件,审核后再手动运行。
|
||||
|
||||
```
|
||||
$ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh --output homebrew_installer.sh
|
||||
$ more homebrew_installer.sh # 审核该脚本,直到你觉得没问题了
|
||||
$ bash homebrew_installer.sh
|
||||
```
|
||||
|
||||
### 使用“酿造”来管理你的命令行实用程序
|
||||
|
||||
Homebrew 号称它“可以安装苹果(或你的 Linux 系统)默认没有安装的必需之物”。安装是通过 `brew`(酿造)命令进行的,它使我们能够访问成千上万的命令行实用程序,但不是更复杂的应用程序。
|
||||
|
||||
对于我们这些搞技术的人来说,符合“必需之物”类别的实用工具包括显示目录结构的方便的 `tree` 命令和我用来 [管理多个 Python 版本][4] 的 `pyenv`。
|
||||
|
||||
你可以用 `search` 子命令看到 Homebrew 中所有的“<ruby>秘方<rt>formula</rt></ruby>”,我用 `wc` 命令显示有多少个“秘方”。
|
||||
|
||||
```
|
||||
# -l 统计行数
|
||||
$ brew search | wc -l
|
||||
5013
|
||||
```
|
||||
|
||||
有 5000 多个“秘方”,这是一个不可思议的软件数量。所以,在搜索那个庞大的清单之前,最好先对自己想要的东西有个概念。值得庆幸的是,浏览起来很方便。“秘方”被编入并集中存储到核心库中,核心库按操作系统划分(Mac 在 [Homebrew Core][5],Linux 在 [Linux Core][6])。它们也可以通过 Homebrew API 和[网站][7]列出。
|
||||
|
||||
口碑是另一个寻找实用工具的好方法。考虑到这一点,如果你正在寻找灵感,这里有一些我的最爱:
|
||||
|
||||
* `pyenv`、`rbenv` 和 `nodenv` 分别用于管理 Python、Ruby 和 Node.js 的版本
|
||||
* `imagemagick` 用于可脚本化的图像编辑
|
||||
* `pandoc` 用于可脚本化的文件转换(我经常从 .docx 切换到 .md 或 .html)
|
||||
* `hub` 为 GitHub 用户提供了[更好的 Git 体验][8]。
|
||||
* `tldr` 提供了解如何使用命令行工具的例子
|
||||
|
||||
举个例子,看看 [tldr 页面][9],这是一个用户友好的替代方式,可以滚动浏览应用程序的手册页。你可以通过再次运行 `search` 来确认它是否可用:
|
||||
|
||||
```
|
||||
$ brew search tldr
|
||||
==> Formulae
|
||||
tldr ✔
|
||||
```
|
||||
|
||||
成功了!这个对勾让你知道它是可用的。现在你可以安装它了:
|
||||
|
||||
```
|
||||
$ brew install tldr
|
||||
==> Downloading https://homebrew.bintray.com/bottles/tldr-1.3.0_2.catalina.bottle.tar.gz
|
||||
Already downloaded: /Users/mbbroberg/Library/Caches/Homebrew/downloads/901bc14594a9283e9ab20aec942dc5a9a2befb7e96e1b0fcccb4e3257918813c--tldr-1.3.0_2.catalina.bottle.tar.gz
|
||||
==> Installing tldr
|
||||
==> Pouring tldr-1.3.0_2.catalina.bottle.tar.gz
|
||||
🍺 /usr/local/Cellar/tldr/1.3.0_2: 6 files, 35.5KB
|
||||
```
|
||||
|
||||
值得庆幸的是,Homebrew 预先构建了二进制文件,所以你不必在本地机器上从源代码构建。这样就节省了很多时间,并免除了 CPU 风扇的噪音。我对 Homebrew 赞赏的另一件事是,你可以在不完全了解其含义的情况下欣赏此功能。
|
||||
|
||||
但如果你喜欢,看看复杂的东西也是很有趣的。对 `tldr` 运行 `info` 子命令,你可以看到所有的依赖管理、源代码,甚至公共分析。
|
||||
|
||||
```
|
||||
$ brew info tldr
|
||||
tldr: stable 1.3.0 (bottled), HEAD
|
||||
Simplified and community-driven man pages
|
||||
https://tldr.sh/
|
||||
Conflicts with:
|
||||
tealdeer (because both install `tldr` binaries)
|
||||
/usr/local/Cellar/tldr/1.3.0_2 (6 files, 35.5KB) *
|
||||
Poured from bottle on 2020-05-20 at 15:12:12
|
||||
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/tldr.rb
|
||||
==> Dependencies
|
||||
Build: pkg-config ✔
|
||||
Required: libzip ✔
|
||||
==> Options
|
||||
--HEAD
|
||||
Install HEAD version
|
||||
==> Analytics
|
||||
install: 2,811 (30 days), 7,875 (90 days), 27,105 (365 days)
|
||||
install-on-request: 2,806 (30 days), 7,860 (90 days), 27,080 (365 days)
|
||||
build-error: 0 (30 days)
|
||||
```
|
||||
|
||||
最后,和其他优秀的软件包管理器一样,Homebrew 的 `brew uninstall` 子命令可用于快速清理和删除未使用的实用程序。
|
||||
|
||||
### 用“酒桶”管理你的应用程序
|
||||
|
||||
命令行实用程序是一匹孤狼,但完整的应用程序呢?Homebrew 保持了其标准命令的简单性,只通过其默认的 `brew` 命令行界面安装单文件应用。而应用程序不符合这种结构。它们的目录层次比较复杂,比单一的二进制要复杂得多。
|
||||
|
||||
幸运的是,Mac 上的 Homebrew 包含了一个名为 `cask`(酒桶)的子命令,用于处理更复杂的多目录结构。特别好的是,`cask` 使用了与标准 `brew` 命令类似的命令结构,所以你可以使用类似的 `search`、`install` 和 `info` 子命令:
|
||||
|
||||
```
|
||||
brew search --cask | wc -l
|
||||
4772
|
||||
```
|
||||
|
||||
哇,有近 5000 个应用程序,在 [Homebrew 的网站][10]上浏览更方便。
|
||||
|
||||
我将用我新喜欢的一款应用来引导你完成 `cask`。[Meld][11](我[在 Opensource.com 上读到的][12])。这是一个功能丰富的编辑器,可以帮助管理合并冲突。在它的网站上有下载的链接,我可以运行安装程序,并将其拖放到我的应用程序文件夹中。但我不想再这样做了,我用的是 Homebrew。
|
||||
|
||||
首先,我可以通过稍微不同的语法确认它可以使用:
|
||||
|
||||
```
|
||||
$ brew search --casks meld
|
||||
==> Casks
|
||||
meld
|
||||
```
|
||||
|
||||
然后我使用 `cask` 子命令来安装它:
|
||||
|
||||
```
|
||||
$ brew cask install meld
|
||||
==> Downloading https://github.com/yousseb/meld/releases/download/osx-19/meldmerge.dmg
|
||||
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/28624006/66cb25
|
||||
######################################################################## 100.0%
|
||||
==> Verifying SHA-256 checksum for Cask 'meld'.
|
||||
==> Installing Cask meld
|
||||
==> Moving App 'Meld.app' to '/Applications/Meld.app'.
|
||||
==> Linking Binary 'meld.wrapper.sh' to '/usr/local/bin/meld'.
|
||||
🍺 meld was successfully installed!
|
||||
```
|
||||
|
||||
Homebrew 不仅安装了应用程序,而且还在我当前的路径 `/usr/local/bin/` 下提供了它。现在,我可以从命令行运行 `meld` 或从应用程序文件夹中启动应用程序。
|
||||
|
||||
### 更新一切的“酿造升级”
|
||||
|
||||
我一直使用软件包管理器的主要原因是,我可以不断升级我的软件,以避免已知的安全漏洞,并确保我总是有最新的功能。如果我手工安装所有的东西,我必须关注每一个工具和应用程序,以了解它是否有自动更新程序,如果没有,就得自己拉回最新的版本。
|
||||
|
||||
升级功能是优秀的软件包管理的闪光点。由于我没有什么特殊的版本要求,所以我只需要运行一个命令就可以顺利更新一切:
|
||||
|
||||
```
|
||||
$ brew upgrade
|
||||
==> Upgrading 6 outdated packages:
|
||||
helm 3.2.1 -> 3.2.2
|
||||
python@3.8 3.8.2_4 -> 3.8.3
|
||||
ipython 7.14.0 -> 7.15.0
|
||||
go 1.14.2_1 -> 1.14.3
|
||||
libzip 1.6.1 -> 1.6.1_1
|
||||
sqlite 3.31.1 -> 3.32.1
|
||||
```
|
||||
|
||||
如果你有更复杂的需求,或者想在安装升级前关注一下升级情况,有很多功能标志可供选择。例如,`-n` 提供了一个 “模拟运行”,列出了可用的升级,而不会进行安装。你也可以 “[钉][13]” 住应用程序版本来防止它升级。
|
||||
|
||||
### 备份你的安装
|
||||
|
||||
当该工具允许你像其它[点文件的版本控制方案][14]一样备份你的安装环境时,命令行实用程序和应用程序的管理就跳到了一个全新的水平。Homebrew 就有这样的功能,可以在 `dump` 子命令下使用。它会生成一个 `Brewfile`,这是一个可重复使用的当前所有安装的工具的列表。要从你的安装的环境中生成一个,进入你的合适的文件夹并运行:
|
||||
|
||||
```
|
||||
$ cd ~/Development/dotfiles # 这是我的点文件的文件夹
|
||||
$ brew bundle dump
|
||||
```
|
||||
|
||||
当我换了机器,想用 Homebrew 安装相同的应用程序时,我就会进入装有 `Brewfile` 的文件夹并运行。
|
||||
|
||||
```
|
||||
$ brew bundle
|
||||
```
|
||||
|
||||
它将在我的新机器上安装所有列出的“秘方”和“酒桶”。
|
||||
|
||||
### 用 Homebrew 进行软件包管理
|
||||
|
||||
Homebrew 是我常用的命令行工具和应用程序的管理器。它可以让我保持有条理和及时更新,它的设计在易用性和功能深度之间取得了美丽的平衡。Homebrew 将软件包管理的细节最小化到只需要你知道的程度,大多数用户都会从中受益。
|
||||
|
||||
如果你对 Linux 软件包管理器已经驾轻就熟,你可能会认为 Homebrew 太简单了,但不要误以为 Homebrew 的易用性是功能的缺乏。稍微深入一点看,就会发现很多高级选项,远远超出了我在这里向你展示的范围。将 `-h` 添加到任何 `brew` 子命令中,会显示可用来升级、删除、故障排除,甚至使用模板贡献新 “秘方” 的丰富功能。
|
||||
|
||||
总的来说,Homebrew 可以让一个重度命令行的 Mac 用户变得很开心。此外,它是开源的,所以如果你愿意,你可以[贡献代码][15]。尝试一下它,让我知道你的想法,在下面留下评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/homebrew-mac
|
||||
|
||||
作者:[Matthew Broberg][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/mbbroberg
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out)
|
||||
[2]: https://opensource.com/article/19/10/how-build-flatpak-packaging
|
||||
[3]: https://brew.sh
|
||||
[4]: https://opensource.com/article/20/4/pyenv
|
||||
[5]: https://github.com/Homebrew/homebrew-core
|
||||
[6]: https://github.com/Homebrew/linuxbrew-core
|
||||
[7]: https://formulae.brew.sh/formula/
|
||||
[8]: https://opensource.com/article/20/3/github-hub
|
||||
[9]: https://github.com/tldr-pages/tldr
|
||||
[10]: https://formulae.brew.sh/cask/
|
||||
[11]: https://meldmerge.org/
|
||||
[12]: https://opensource.com/article/20/3/meld
|
||||
[13]: https://docs.brew.sh/FAQ#how-do-i-stop-certain-formulae-from-being-updated
|
||||
[14]: https://opensource.com/article/19/3/move-your-dotfiles-version-control
|
||||
[15]: https://github.com/Homebrew/brew
|
@ -0,0 +1,99 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12350-1.html)
|
||||
[#]: subject: (How to dump the GOSSAFUNC graph for a method)
|
||||
[#]: via: (https://dave.cheney.net/2020/06/19/how-to-dump-the-gossafunc-graph-for-a-method)
|
||||
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
|
||||
|
||||
在 Go 中如何转储一个方法的 GOSSAFUNC 图
|
||||
======
|
||||
|
||||

|
||||
|
||||
Go 编译器的 SSA 后端包含一种工具,可以生成编译阶段的 HTML 调试输出。这篇文章介绍了如何为函数*和*方法打印 SSA 输出。
|
||||
|
||||
让我们从一个包含函数、值方法和指针方法的示例程序开始:
|
||||
|
||||
```
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Numbers struct {
|
||||
vals []int
|
||||
}
|
||||
|
||||
func (n *Numbers) Add(v int) {
|
||||
n.vals = append(n.vals, v)
|
||||
}
|
||||
|
||||
func (n Numbers) Average() float64 {
|
||||
sum := 0.0
|
||||
for _, num := range n.vals {
|
||||
sum += float64(num)
|
||||
}
|
||||
return sum / float64(len(n.vals))
|
||||
}
|
||||
|
||||
|
||||
func main() {
|
||||
var numbers Numbers
|
||||
numbers.Add(200)
|
||||
numbers.Add(43)
|
||||
numbers.Add(-6)
|
||||
fmt.Println(numbers.Average())
|
||||
}
|
||||
```
|
||||
|
||||
通过 `GOSSAFUNC` 环境变量控制 SSA 调试输出。此变量含有要转储的函数的名称。这*不是*函数的完全限定名。对于上面的 `func main`,函数名称为 `main` *而不是* `main.main`。
|
||||
|
||||
```
|
||||
% env GOSSAFUNC=main go build
|
||||
runtime
|
||||
dumped SSA to ../../go/src/runtime/ssa.html
|
||||
t
|
||||
dumped SSA to ./ssa.html
|
||||
```
|
||||
|
||||
在这个例子中,`GOSSAFUNC=main` 同时匹配了 `main.main` 和一个名为 `runtime.main` 的函数。[^1]这有点不走运,但是实际上可能没什么大不了的,因为如果你要对代码进行性能调整,它就不会出现在 `func main` 中的巨大的意大利面块中。
|
||||
|
||||
你的代码更有可能在*方法*中,你可能已经看到这篇文章,并寻找能够转储方法的 SSA 输出。
|
||||
|
||||
要为指针方法 `func (n *Numbers) Add` 打印 SSA 调试,等效函数名为 `(*Numbers).Add`:[^2]
|
||||
|
||||
```
|
||||
% env "GOSSAFUNC=(*Numbers).Add" go build
|
||||
t
|
||||
dumped SSA to ./ssa.html
|
||||
```
|
||||
|
||||
要为值方法 `func (n Numbers) Average` 打印 SSA 调试,等效函数名为 `(*Numbers).Average`,*即使这是一个值方法*:
|
||||
|
||||
```
|
||||
% env "GOSSAFUNC=(*Numbers).Average" go build
|
||||
t
|
||||
dumped SSA to ./ssa.html
|
||||
```
|
||||
|
||||
[^1]: 如果你没有从源码构建 Go,那么 `runtime` 软件包的路径可能是只读的,并且可能会收到错误消息。请不要使用 `sudo` 来解决此问题。
|
||||
[^2]: 请注意 shell 引用
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://dave.cheney.net/2020/06/19/how-to-dump-the-gossafunc-graph-for-a-method
|
||||
|
||||
作者:[Dave Cheney][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://dave.cheney.net/author/davecheney
|
||||
[b]: https://github.com/lujun9972
|
||||
|
@ -0,0 +1,240 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12361-1.html)
|
||||
[#]: subject: (How to Make Ubuntu Look Like macOS in 5 Easy Steps)
|
||||
[#]: via: (https://itsfoss.com/make-ubuntu-look-like-macos/)
|
||||
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
|
||||
|
||||
5 个简单步骤使你的 Ubuntu 看起来像 macOS
|
||||
======
|
||||
|
||||
定制是 [我为什么使用 Linux][1] 的一个主要原因。定制桌面 Linux 的道路是永无止境的。你可以更改图标、主题、字体、终端、添加屏幕小工具、[指示器小程序][2]、扩展等诸如此类的东西。
|
||||
|
||||
我们已经介绍了很多桌面环境定制的建议和技巧。在这篇文章中,我将向你展示如何使 Ubuntu 看起来像 macOS。
|
||||
|
||||
很多人使用 macOS,是因为它的简单和优雅的外观。你可能不同意这一点,但这仍然是一个流行的观点。甚至有的 Linux 发行版也有类似 macOS 外观和感觉。
|
||||
|
||||
一位读者要求我们展示如何使 Ubuntu 看起来像 macOS,因此我们写了这篇教程。事实上,这是一个用来展示桌面 Linux 定制能力的很好的示例。
|
||||
|
||||
不过,你没有必要为定制外观而安装一个新的发行版。你可以在你自己的系统上做一些调整来给予你一个类似 macOS 的外观。
|
||||
|
||||
### 如何给你的 Ubuntu Linux 进行 macOS 改造
|
||||
|
||||
![][3]
|
||||
|
||||
尽管这篇文章是对 Ubuntu 的建议,但是你也可以在其它使用 GNOME 桌面环境的发行版中使用这些建议,几乎可以不做任何改动。请确保[检查一下你的桌面环境][4]。
|
||||
|
||||
说实话,即使你使用的是其它的桌面环境,你仍然可以得到一些关于要做哪些更改的提示。但是你必须确保使用你的桌面环境的工具按照步骤进行。
|
||||
|
||||
#### 必要条件: GNOME Tweaks 和 GNOME 扩展
|
||||
|
||||
请确保 [安装 GNOME Tweaks 工具][5]。你需要它来更改主题和图标。
|
||||
|
||||
你也需要 [启用 GNOME 扩展][6] 来更改 GNOME Shell 和添加重要的要点。
|
||||
|
||||
在你启用 GNOME 扩展后,你需要从 [GNOME 扩展][7] 网站安装“用户主题” 扩展,或者只需要转到 [这个超链接][8] ,并单击开关来将其打开。
|
||||
|
||||
我也希望你对 [在 Ubuntu 上安装主题][9] 有一定的了解。不过,我还是简单的谈了一下这个主题。
|
||||
|
||||
让我们依次看看每个步骤。
|
||||
|
||||
#### 步骤 1: 安装一个 macOS 风格的 GTK 主题
|
||||
|
||||
因为重点是使 GNOME 看起来像 macOS,所以你应该选择一个像 macOS 一样的主题。有很多主题都是像 macOS 一样的。
|
||||
|
||||
##### 下载一个你选择的主题
|
||||
|
||||
你可以转到 [Gnome-look][10] 站点,并搜索关于 GTK3 的主题。如果你在 Gnome-look 网站上看到 “Pling” 字样,不用担心,它们都是来自同一个供应商。
|
||||
|
||||
你可以选择任何你想要的主题。下面是一些我认为你应该看看的macOS主题:
|
||||
|
||||
- [mcOS 11][11]
|
||||
- [McHigh Sierra][12]
|
||||
- [Catalina][13]
|
||||
- [McMojave][14]
|
||||
|
||||
在这篇文章中,我将使用 “[McMojave][14]”。你可以选择任何你想要的主题。你将在网站的右侧找到下拉式的下载按钮,单击它。
|
||||
|
||||
![McMojave 暗黑主题][15]
|
||||
|
||||
在这里你可以找到各种 “.tar.xz” 文件。这些不同的文件包含了相同的主题,但有一些小的差异。像在 “McMojave” 中,我们有像暗黑主题和明亮主题的变体。你可以尝试所有的主题,或者从之间随意选择一个你喜欢的。
|
||||
|
||||
##### 设置下载的主题
|
||||
|
||||
提取下载的主题,并复制这些提取的主题文件夹到 `.local/share/themes` 文件夹下。
|
||||
|
||||
打开 GNOME Tweak 工具,并更改应用程序和 Shell 的主题。在你更改主题的同时,你可以看到黄色、绿色和红色三个按钮,以及左上角的苹果标志。你也可以看到在面板项上的一些更改。
|
||||
|
||||
![McMojave GTK 和 Shell 主题][16]
|
||||
|
||||
#### 步骤 2: 安装像 macOS 一样的图标
|
||||
|
||||
macOS 外观改造的下一步骤是使用像 macOS 一样的图标。
|
||||
|
||||
##### 下载图标集合
|
||||
|
||||
这里有一些我建议使用的图标集合,你可以从 Gnome-look 网站下载:
|
||||
|
||||
- [McMojave-circle][17]
|
||||
- [Mojave CT-icons][18]
|
||||
- [Cupertino icons][19]
|
||||
|
||||
在这篇文章中,我将使用 “[McMojave-circle][17]” ,你可以随意使用任何你喜欢的图标。
|
||||
|
||||
就像主题一样,你可以从右侧的下拉式的 “下载” 按钮下载图标集合。在这里你也可以找到同一种图标的不同版本。
|
||||
|
||||
![Mcmojave Circle][20]
|
||||
|
||||
##### 设置图标
|
||||
|
||||
现在设置下载的图标。为此,提取下载文件中的文件夹并复制它到你的家目录下的 `.icons` 文件夹。 查看这篇关于 [在 Ubuntu 中安装图标主题][9] 的文章。
|
||||
|
||||
这是这种图标看起来的样子:
|
||||
|
||||
![McMojave Circle 图标外观][21]
|
||||
|
||||
#### 步骤 3: 添加类似 macOS 样子的坞站
|
||||
|
||||
没有类似 macOS 样子的<ruby>坞站<rt>dock</rt></ruby>,你的 Ubuntu 就看起来不像 macOS。在 Linux 上有很多可用的坞站。我喜欢 “[Dash to Dock][22]”,我会在这里使用它。
|
||||
|
||||
“Dash to Dock” 是一个 GNOME 扩展。到现在为止,你已经熟悉 GNOME 扩展。只需要转到 [这个超链接][23] ,并单击切换按钮来安装它。你的原本的坞站将自动被 “Dash to Dock” 所替换。
|
||||
|
||||
你可以通过右键单击 “show applications” 按钮(最右边的菜单按钮)并选择 “Dash to dock settings” 来更改设置。
|
||||
|
||||
![Dash To Dock][24]
|
||||
|
||||
#### 步骤 4: 使用 macOS 壁纸
|
||||
|
||||
大多数复杂的东西已经完成。现在是时候设置 macOS 壁纸了。你可以从下面的超链接下载 macOS 默认壁纸:
|
||||
|
||||
- [下载 macOS 壁纸][25]
|
||||
|
||||
##### 更改桌面背景
|
||||
|
||||
我将使用 “Mojave Day” 壁纸。右键单击已下载的的图像,并选择 “设置为壁纸” 选项来更改壁纸。
|
||||
|
||||
在设置这个壁纸后,这是我系统外观的样子:
|
||||
|
||||
![][26]
|
||||
|
||||
##### 更改锁屏壁纸
|
||||
|
||||
锁屏壁纸选项已经从 [Ubuntu 20.04][27] 的设置中移除。现在它使用一个模糊的桌面壁纸作为锁屏壁纸。
|
||||
|
||||
要设置一个自定义锁屏壁纸,你可以使用 “[Lock screen background][28]” 扩展。
|
||||
|
||||
打开 “Lock screen background” 扩展设置,并设置锁屏壁纸。
|
||||
|
||||
![锁屏背景设置][29]
|
||||
|
||||
这是锁屏现在的样子。如果你感到好奇话,这里是 [如何在 Ubuntu 中截图锁屏][30]。
|
||||
|
||||
![锁屏][31]
|
||||
|
||||
![登录屏幕][32]
|
||||
|
||||
#### 步骤 5: 更改系统字体
|
||||
|
||||
这几年,macOS 的主要系统字体是 “San Francisco” 。但是,这个字体并不是公共领域的,而是像苹果生态系统中的许多其他东西一样,是专有字体。基于这个原因,你不能使用这种字体。
|
||||
|
||||
你能做的就是使用一种看起来像 San Francisc 字体一样的开源字体。我建议使用 Google 的 [Roboto][33] 字体,或 Adobe 的 [Source Sans Pro][34] 。
|
||||
|
||||
[在 Ubuntu 中安装字体是很简单的][35] 。下载 字体的 zip 文件,只需要在提取出来的文件夹中双击 ttf 文件。它会给你一个选项来逐一安装字体。
|
||||
|
||||
如果你想节省时间并一次安装所有的字体,提取其中所有的字体到你的家目录(`~/.fonts`)下的 `.fonts` 目录中。
|
||||
|
||||
![安装字体][36]
|
||||
|
||||
在你安装字体后,你可以使用 GNOME Tweaks 工具来更改系统字体。
|
||||
|
||||
![设置字体][37]
|
||||
|
||||
#### 额外提示:Spotlight 式的应用程序启动器(如果你像更进一步的话)
|
||||
|
||||
如果你是 macOS Spotlight 启动器的粉丝,那么你在 Linux 上也能找到类似的东西。我最喜欢的这类启动器的软件包是 “[Albert][38]”。
|
||||
|
||||
你可以 [在 Albert 网站上找到它的安装说明][39] 。
|
||||
|
||||
安装完成后,打开 Albert 并设置快捷键(你想打开该启动器的组合键)就可以了。我想,在 macOS 中 `Command + Space` 键是来启动 Spotlight;在 Ubuntu 中,你可以设置 `Super+Space` [快捷键][40]。
|
||||
|
||||
你会会得到很多内置的主题,在下面的图片中,我使用 “Spotlight dark” 主题。
|
||||
|
||||
Albert 不能直接启动应用程序,你必须授予它在哪里可以进行搜索的权限。
|
||||
|
||||
![Albert 设置][41]
|
||||
|
||||
在设置后,这是它看起来的样子:
|
||||
|
||||
![Albert 暗黑主题][42]
|
||||
|
||||
这是我的 Ubuntu 20.04 在完成所有定制后的样子。它看起来像 macOS 吗? 仁者见仁,智者见智。
|
||||
|
||||
![macOS 主题][43]
|
||||
|
||||
![Ubuntu 使用 macOS 外观改造][44]
|
||||
|
||||
如此,这就是你如何使你的 GNOME 桌面看起来像 macOS 一样的步骤。正如我在开始时所说的,这是一个很好的 Linux 桌面定制功能的示例。
|
||||
|
||||
如果你有新的注意或有任何疑问;评论区全是你的地盘。
|
||||
|
||||
本文由 Sumeet 编写,并由 Abhishek Prakash 提供补充输入信息。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/make-ubuntu-look-like-macos/
|
||||
|
||||
作者:[Sumeet][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://itsfoss.com/why-use-linux/
|
||||
[2]: https://itsfoss.com/best-indicator-applets-ubuntu/
|
||||
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Make-Ubuntu-Look-like-MacOS.png?ssl=1
|
||||
[4]: https://linux.cn/article-12124-1.html
|
||||
[5]: https://itsfoss.com/gnome-tweak-tool/
|
||||
[6]: https://linux.cn/article-9447-1.html
|
||||
[7]: https://extensions.gnome.org/
|
||||
[8]: https://extensions.gnome.org/extension/19/user-themes/
|
||||
[9]: https://itsfoss.com/install-themes-ubuntu/
|
||||
[10]: https://www.gnome-look.org/
|
||||
[11]: https://www.pling.com/p/1220826
|
||||
[12]: https://www.pling.com/p/1013714
|
||||
[13]: https://www.pling.com/p/1226871
|
||||
[14]: https://www.pling.com/p/1275087
|
||||
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/McMojave-dark-theme.png?ssl=1
|
||||
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/McMojave-Desktop.png?ssl=1
|
||||
[17]: https://www.gnome-look.org/p/1305429/
|
||||
[18]: https://www.gnome-look.org/p/1210856/
|
||||
[19]: https://www.gnome-look.org/p/1102582/
|
||||
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/McMojave-circle-.png?ssl=1
|
||||
[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/McMojave-circle-icons-look.png?fit=800%2C494&ssl=1
|
||||
[22]: https://github.com/micheleg/dash-to-dock
|
||||
[23]: https://extensions.gnome.org/extension/307/dash-to-dock/
|
||||
[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Dash-to-dock-1.png?ssl=1
|
||||
[25]: https://oswallpapers.com/category/mac-os/
|
||||
[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Wallpaper.png?fit=800%2C450&ssl=1
|
||||
[27]: https://itsfoss.com/ubuntu-20-04-release-features/
|
||||
[28]: https://extensions.gnome.org/extension/1476/unlock-dialog-background/
|
||||
[29]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Lock-screen-background-setting.png?ssl=1
|
||||
[30]: https://itsfoss.com/screenshot-login-screen-ubuntu-linux/
|
||||
[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Lock-screen-1.png?ssl=1
|
||||
[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Login-screen-1.png?ssl=1
|
||||
[33]: https://fonts.google.com/specimen/Roboto?query=robot
|
||||
[34]: https://adobe-fonts.github.io/source-sans-pro/
|
||||
[35]: https://itsfoss.com/install-fonts-ubuntu/
|
||||
[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Fonts.png?ssl=1
|
||||
[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Set-fonts.png?ssl=1
|
||||
[38]: https://albertlauncher.github.io/
|
||||
[39]: https://albertlauncher.github.io/docs/installing/
|
||||
[40]: https://itsfoss.com/ubuntu-shortcuts/
|
||||
[41]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Albert-settings.png?ssl=1
|
||||
[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Albert-look.png?ssl=1
|
||||
[43]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/macOS-theme.png?fit=800%2C450&ssl=1
|
||||
[44]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/macOS-theme-2.png?fit=800%2C450&ssl=1
|
@ -0,0 +1,263 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (nophDog)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12358-1.html)
|
||||
[#]: subject: (Make the switch from Mac to Linux easier with Homebrew)
|
||||
[#]: via: (https://opensource.com/article/20/6/homebrew-linux)
|
||||
[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg)
|
||||
|
||||
Homebrew 让你从 Mac 切换到 Linux 更轻松
|
||||
======
|
||||
|
||||
> 不管你是想要更舒服地从 Mac 搬到 Linux,还是不满意常规的 Linux 包管理器,都可以试试 Homebrew。
|
||||
|
||||

|
||||
|
||||
[Homebrew][2] 项目最初是为了给 Mac 用户提供一个非官方的 Linux 式的包管理器。用户很快就爱上了它友好的界面以及帮助性的提示,而且,它已经被移植到 Linux 系统 —— 这看起来像是一个奇怪的命运转折。
|
||||
|
||||
一开始,有两个分开的项目分别针对 macOS 和 Linux (Homebrew 与 Linuxbrew),但是现在是由 Homebrew 核心管理着这两个操作系统。由于我正 [从 Mac 切换到 Linux][3],所以一直在研究我在 macOS 最常用的开源软件在 Linux 表现如何,最终,我很高兴地发现 Homebrew 对 Linux 的支持太赞了!
|
||||
|
||||
### 为什么要在 Linux 使用 Homebrew 呢?
|
||||
|
||||
长期使用 Linux 的用户对 Homebrew 的第一反应是:“为什么不直接使用……呢”,省略号代表他们喜欢的某个 Linux 包管理器。基于 Debian 的系统早就有了 `apt`,基于 Fedora 的系统则有 `dnf` 和 `yum`,并且像 Flatpak 跟 AppImage 这样的项目,在两种系统上都能流畅运行。我花了不少时间尝试这些技术,不得不说,它们都有其强大之处。
|
||||
|
||||
那我为什么还要 [坚持使用 Homebrew][4] 呢?首先,我对它非常熟悉。在为我过去使用的专有软件寻找开源替代品的过程中,我已经学会了许多使用方法,而保持一些熟悉的东西,比如 Homebrew,可以让我专注于一次学习一件事情,而不是被不同系统间的差异搞垮。
|
||||
|
||||
此外,我没有看到哪一个包管理器像 Homebrew 一样,对用户如此友好。正如默认的帮助命令一样,命令井然有序:
|
||||
|
||||
```
|
||||
$ brew -h
|
||||
Example usage:
|
||||
brew search [TEXT|/REGEX/]
|
||||
brew info [FORMULA...]
|
||||
brew install FORMULA...
|
||||
brew update
|
||||
brew upgrade [FORMULA...]
|
||||
brew uninstall FORMULA...
|
||||
brew list [FORMULA...]
|
||||
|
||||
Troubleshooting:
|
||||
brew config
|
||||
brew doctor
|
||||
brew install --verbose --debug FORMULA
|
||||
|
||||
Contributing:
|
||||
brew create [URL [--no-fetch]]
|
||||
brew edit [FORMULA...]
|
||||
|
||||
Further help:
|
||||
brew commands
|
||||
brew help [COMMAND]
|
||||
man brew
|
||||
<https://docs.brew.sh>
|
||||
```
|
||||
|
||||
过于简短的输出可能会被误解为它功能局限,但是你简单看看每一个子命令,都有很丰富的功能。虽然上面的列表只有短短 23 行,但对高级用户来说,光是子命令 `install` 就包含整整 79 行的帮助信息:
|
||||
|
||||
```
|
||||
$ brew --help | wc -l
|
||||
23
|
||||
$ brew install --help | wc -l
|
||||
79
|
||||
```
|
||||
|
||||
它可以选择忽略或者安装依赖关系,也可以选择用源代码编译以及用什么编译器来编译某个确切的上游 Git 提交,或者选择应用的官方 “灌装” 版。总而言之,Homebrew 即适合新手,也同样能满足老鸟。
|
||||
|
||||
### 开始在 Linux 使用 Homebrew
|
||||
|
||||
如果你想要试着使用 Homebrew,可以用这个单行脚本在 Mac 或者 Linux 上进行安装:
|
||||
|
||||
```
|
||||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||
```
|
||||
|
||||
这条命令会立即开始安装 Homebrew。如果你比较谨慎,可以使用 `curl` 将该文件下载到本地,检查完毕之后再运行。
|
||||
|
||||
```
|
||||
$ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh --output homebrew_installer.sh
|
||||
$ more homebrew_installer.sh # 审核该脚本,直到你觉得没问题了
|
||||
$ bash homebrew_installer.sh
|
||||
```
|
||||
|
||||
对 Linux 的安装步骤还包括如何配置点文件,对于 Debian 系统来说是 `~/.profile`,对于 Fedora 系统是 `~/.bash_profile`。
|
||||
|
||||
```
|
||||
$ test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
|
||||
$ test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
|
||||
$ echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
|
||||
```
|
||||
|
||||
为了确认已经安装好,Homebrew 团队提供一个空的 `hello` “秘方” 供测试:
|
||||
|
||||
```
|
||||
$ brew install hello
|
||||
==> Downloading https://linuxbrew.bintray.com/bottles/hello-2.10.x86_64_linux.bottle.tar.gz
|
||||
######################################################################## 100.0%
|
||||
==> Pouring hello-2.10.x86_64_linux.bottle.tar.gz
|
||||
🍺 /home/linuxbrew/.linuxbrew/Cellar/hello/2.10: 52 files, 595.6KB
|
||||
```
|
||||
|
||||
看起来安装毫无问题,让我来试试更多操作。
|
||||
|
||||
### 命令行工具 Brew
|
||||
|
||||
Homebrew 宣称自己是一款默认只 “安装你需要而 [Linux] 没有的东西”的应用程序。
|
||||
|
||||
你可以用 `brew` 命令安装任何打包在 Homebrew 中的命令行软件。这些包的定义文件叫做 “<ruby>秘方<rt>formula</rt></ruby>”,而且它们通过“<ruby>瓶子<rt>bottle</rt></ruby>”来编译并分享。在 Homebrew 的世界里,还有许多 “啤酒方面” 的术语,但这个包管理器主要目的是让软件便于使用。
|
||||
|
||||
都有些什么样的软件呢?对我这样的技术玩家(既然你已经在读这篇文章,估计你也是)来说最方便的东西。例如,便利的 `tree` 命令,可以展示目录结构,或者 `pyenv`,我用它来 [在 Mac 管理不同版本 Python][5]。
|
||||
|
||||
你可以用 `search` 命令查看所有可以安装的“秘方”,在后面加上 `wc` 命令看看一共有多少:
|
||||
|
||||
```
|
||||
# -l 选项统计行数
|
||||
$ brew search | wc -l
|
||||
5087
|
||||
```
|
||||
|
||||
迄今为止,一共有 5000 多个 “秘方”,这囊括了很多软件。需要注意的是:并非所有 “秘方” 都能在 Linux 运行。在 `brew search --help` 输出中有一节提到可以按软件运行的操作系统来筛选软件。它会在浏览器打开用于每个操作系统的软件仓库。我运行的是 Fedora,所以我会用它来试一试:
|
||||
|
||||
```
|
||||
$ brew search --fedora tree
|
||||
```
|
||||
|
||||
浏览器打开了网址 `https://apps.fedoraproject.org/packages/s/tree`,向我展示了所有 Fedora 的可用选项。你也可以通过其它方法进行浏览。“秘方” 被集中整理到由操作系统划分的核心仓库当中(Mac 在 [Homebrew Core][6],Linux 在 [Linux Core][7])。同样也可以通过 Homebrew API [在网页显示][8]。
|
||||
|
||||
即使有这些选择,我还是通过其它用户的推荐找到很多新工具。我列出一些我最喜欢的工具,你可以在里面找点灵感:
|
||||
|
||||
* `pyenv`、`rbenv` 和 `nodenv` 用来管理(相应的) Python、Ruby 和 Node.js 版本
|
||||
* `imagemagick` 用于脚本化编辑图片
|
||||
* `pandoc` 用于脚本化转换文档格式(我通常将 .docx 文件转成 .md 或者 .html)
|
||||
* `hub` 为 GitHub 用户提供 [更好的 Git 体验][9]
|
||||
* `tldr` 展示了命令工具的使用范例
|
||||
|
||||
想要深入了解 Homebrew,可以去 [trldr 页面][10] 看看,比起应用的 man 页面,它要友好得多。使用 `search` 命令确认你可以安装:
|
||||
|
||||
```
|
||||
$ brew search tldr
|
||||
==> Formulae
|
||||
tldr ✔
|
||||
```
|
||||
|
||||
太好了!对勾说明你可以安装。那么继续吧:
|
||||
|
||||
```
|
||||
$ brew install tldr
|
||||
==> Downloading https://linuxbrew.bintray.com/bottles/tldr-1.3.0_2.x86_64_linux.bottle.1.tar.gz
|
||||
######################################################################## 100.0%
|
||||
==> Pouring tldr-1.3.0_2.x86_64_linux.bottle.1.tar.gz
|
||||
🍺 /home/linuxbrew/.linuxbrew/Cellar/tldr/1.3.0_2: 6 files, 63.2KB
|
||||
```
|
||||
|
||||
Homebrew 提供了编译好的二进制文件,所以你不必在本地机器上从源码编译。这能节省很多时间,也不用听 CPU 风扇的噪声。我很欣赏 Homebrew 的另外一点是,你不完全理解每一个选项的含义也不会影响正常使用。若你想自己编译,可以在 `brew install` 命令后面加上 `-s` 或者 `--build-from-source` 标识,这样就能从源码编译 “秘方”(即便已经有一个 “瓶子” 存在)。
|
||||
|
||||
同样,软件底层的复杂性也很有意思。使用 `info` 可以查看 `tldr` 软件的依赖管理,“秘方” 的源代码存放在磁盘上的何处,甚至还能查看公开分析。
|
||||
|
||||
```
|
||||
$ brew info tldr
|
||||
tldr: stable 1.3.0 (bottled), HEAD
|
||||
Simplified and community-driven man pages
|
||||
https://tldr.sh/
|
||||
Conflicts with:
|
||||
tealdeer (because both install `tldr` binaries)
|
||||
/home/linuxbrew/.linuxbrew/Cellar/tldr/1.3.0_2 (6 files, 63.2KB) *
|
||||
Poured from bottle on 2020-06-08 at 15:56:15
|
||||
From: https://github.com/Homebrew/linuxbrew-core/blob/master/Formula/tldr.rb
|
||||
==> Dependencies
|
||||
Build: pkg-config ✔
|
||||
Required: libzip ✔, curl ✔
|
||||
==> Options
|
||||
--HEAD
|
||||
Install HEAD version
|
||||
==> Analytics
|
||||
install: 197 (30 days), 647 (90 days), 1,546 (365 days)
|
||||
install-on-request: 197 (30 days), 646 (90 days), 1,546 (365 days)
|
||||
build-error: 0 (30 days)
|
||||
```
|
||||
|
||||
### 从 Mac 到 Linux 的一点不足
|
||||
|
||||
在 macOS,Homebrew 的 `cask`(“酒桶”)子命令可以让用户使用命令行安装、管理整个应用软件。不幸的是,`cask` 还不能在任何 Linux 发行版上使用。我在安装一个开源工具时发现了这点:
|
||||
|
||||
```
|
||||
$ brew cask install tusk
|
||||
Error: Installing casks is supported only on macOS
|
||||
```
|
||||
|
||||
我在 [论坛上][11] 问了一下,很快得到其他用户的反馈。总结一下,方案如下:
|
||||
|
||||
* 复刻 Homebrew 项目,构建这个特性,然后像别人展示其价值
|
||||
* 给该软件写一个 “秘方”,然后从源代码编译
|
||||
* 为该软件创建一个第三方仓库
|
||||
|
||||
最后一个是我最感兴趣的。Homebrew 通过 [创建并维护 “<ruby>水龙头<rt>tap</rt></ruby>”][12] (另一个受啤酒影响的术语)管理第三方仓库。随着你对系统越来越熟悉,并想加入生态系统, “水龙头” 是值得研究的。
|
||||
|
||||
### 备份 Homebrew 的安装记录
|
||||
|
||||
我最中意的 Homebrew 特性之一就是你可以像其它任何 [用版本控制工具来备份点文件][13] 一样备份你的安装记录。为了实现这个目的,Homebrew 提供 `bundle`(“捆扎”)子命令,它可以控制一个叫 `dump`(“倾倒”)的子命令生成一个 `Brewfile`。这个文件包含你目前所有安装的工具列表,可以重复使用。进入你想使用的目录然后运行命令,它会根据你所安装的软件生成 `Brewfile`:
|
||||
|
||||
```
|
||||
$ cd ~/Development/dotfiles # This is my dotfile folder
|
||||
$ brew bundle dump
|
||||
$ ls Brewfile
|
||||
Brewfile
|
||||
```
|
||||
|
||||
当我换了一台机器,想要安装一样的软件时,进入含有 `Brewfile` 的文件夹,然后重新安装:
|
||||
|
||||
```
|
||||
$ ls Brewfile
|
||||
Brewfile
|
||||
$ brew bundle
|
||||
```
|
||||
|
||||
它会在我的新机器上安装所有列出的 “秘方”。
|
||||
|
||||
#### 在 Mac 和 Linux 同时管理 Brewfile
|
||||
|
||||
`Brewfile` 非常适合备份你目前的安装记录,但是如果某些在 Mac 上运行的软件无法运行在 Linux 呢?或者刚好相反?我发现不管是 Mac 还是 Linux,如果软件无法在当前操作系统运行,Homebrew 会优雅地忽略那一行。如果它遇到不兼容的请求(比如使用 `brew` 在 Linux 安装 “<ruby>酒桶<rt>cask</rt></ruby>” 时),它会选择跳过,继续安装过程:
|
||||
|
||||
```
|
||||
$ brew bundle --file=Brewfile.example
|
||||
|
||||
Skipping cask licecap (on Linux)
|
||||
Skipping cask macdown (on Linux)
|
||||
Installing fish
|
||||
Homebrew Bundle complete! 1 Brewfile dependency now installed.
|
||||
```
|
||||
|
||||
为了保持配置文件的简洁,我在两个操作系统上使用同一份 `Brewfile`,因为它只安装与操作系统相关的版本,所以我一直没有遇到任何问题。
|
||||
|
||||
### 使用 Homebrew 管理软件包
|
||||
|
||||
Homebrew 已经成了我必备的命令行工具,由于我很熟悉它,所以在 Linux 上的体验也充满乐趣。Homebrew 让我的工具井然有序,并且时刻保持更新,我愈发欣赏它在实用性与功能上找到的平衡点。我更喜欢将软件包管理的细节保持在用户需要了解的最小程度,大多数人都会从中受益。如果你已经很熟悉 Linux 包管理器了,Homebrew 可能会让你觉得很基础,但稍微深入一点看,就会发现它的高级选项远远超过本文的内容。
|
||||
|
||||
对 Linux 用户来说,他们有很多包管理器可以选择。如果你来自 MacOS,Homebrew 会让你宾至如归。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/homebrew-linux
|
||||
|
||||
作者:[Matthew Broberg][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[nophDog](https://github.com/nophDog)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/mbbroberg
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop)
|
||||
[2]: https://brew.sh/
|
||||
[3]: https://opensource.com/article/19/10/why-switch-mac-linux
|
||||
[4]: https://opensource.com/article/20/6/homebrew-mac
|
||||
[5]: https://opensource.com/article/20/4/pyenv
|
||||
[6]: https://github.com/Homebrew/homebrew-core
|
||||
[7]: https://github.com/Homebrew/linuxbrew-core
|
||||
[8]: https://formulae.brew.sh/formula/
|
||||
[9]: https://opensource.com/article/20/3/github-hub
|
||||
[10]: https://github.com/tldr-pages/tldr
|
||||
[11]: https://discourse.brew.sh/t/add-linux-support-to-existing-cask/5766
|
||||
[12]: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
|
||||
[13]: https://opensource.com/article/19/3/move-your-dotfiles-version-control
|
@ -0,0 +1,107 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Yufei-Yan)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12365-1.html)
|
||||
[#]: subject: (Customize your Raspberry Pi operating system for everyday use)
|
||||
[#]: via: (https://opensource.com/article/20/6/custom-raspberry-pi)
|
||||
[#]: author: (Patrick H. Mullins https://opensource.com/users/pmullins)
|
||||
|
||||
定制用于日常使用的树莓派系统
|
||||
======
|
||||
|
||||
> 安装精简版树莓派系统,让你的树莓派更加轻盈。
|
||||
|
||||

|
||||
|
||||
你有一个运行<ruby>[树莓派系统][2]<rt>Raspberry Pi OS</rt></ruby>(以前称为 Raspbian)操作系统的<ruby>树莓派<rt>Raspberry Pi</rt></ruby>,你肯定知道,它是一个非常棒的小型电脑,有一个很好的操作系统,对于初学者来说,它包括了你可能想要的一切。然而,一旦你熟悉了它,并且想用它干一些别的事情的时候,你可能不想要那个默认囊括了一切组件的操作系统。
|
||||
|
||||
在这种情况下,你两个选择:要么你可以绞尽脑汁地把所有你不需要的东西都删干净,要么你还可以用<ruby>精简版树莓派系统<rt>Raspberry Pi OS Lite</rt></ruby>来构建专门为你的需求而定制的轻量级操作系统。我的建议是,用第二种方法,既简便又节省时间。
|
||||
|
||||
### Raspberry Pi OS Lite
|
||||
|
||||
“<ruby>精简版<rt>Lite</rt></ruby>”的<ruby>树莓派系统<rt>Raspberry Pi OS</rt></ruby>其实没什么特别的,就是一个基于最新版本的 [Debian][3] 的最小化镜像。这个镜像仅包含了操作系统核心和启动到命令行的部分,而不会进入图形桌面。可以将这个作为你的定制树莓派系统的基础。这之后的所有东西都是建立在这个核心之上的。
|
||||
|
||||
前往树莓派基金会的网站上[下载][2]这个轻量级镜像。下载完成后,查看详细的[安装指南][4],这里面介绍了在 Linux、Windows 或者 macOS 下如何烧制树莓派操作系统的 SD 卡。
|
||||
|
||||
如果你计划用树莓派作为一个极简系统来运行一些脚本和服务的话,差不多这么多就够了。如果你还想干更多事,那继续往下读。
|
||||
|
||||
### X Window
|
||||
|
||||
首先,如果偶尔需要通过图形用户界面(GUI)连接到你的树莓派,安装一个窗口系统还是不错的。
|
||||
|
||||
[X Window 系统][5],有时候称为 X11,是 Unix 操作系统上一个常见的基本窗口系统。X11 提供了一套 GUI 桌面环境的基本框架。它可以让你通过窗口、鼠标和键盘与计算机交互。
|
||||
|
||||
#### 安装 X Window
|
||||
|
||||
下面这一行安装了能让 X11 运行的最少的包。
|
||||
|
||||
```
|
||||
sudo apt install -y --no-install-recommends xserver-xorg-core xserver-xorg xfonts-base xinit
|
||||
```
|
||||
|
||||
如果使用 `--no-install-recommends`,则只安装了主要的一些依赖(`Depends` 字段中的包)。这样可以节省很多空间,因为没有安装那些建议却不一定需要的包。
|
||||
|
||||
### 进阶:使用 Xfce 桌面环境
|
||||
|
||||
如果你愿意,可以就此停下了,然后开始使用 X Window 作为你的桌面。不过,我并不建议这么做。X Window 自带的这种最小化的窗口管理工具走的是极简主义风格,某种程度上让人感觉过时了。相反,我建议安装现代化的桌面环境,比如说像 Xfce、GNOME 或者 KDE。当用在微型计算机上时,我更倾向于 [Xfce][6] 而不是其他的,因为它就是为资源有限的系统设计的,而且你可以通过主题、图标或者其他东西对它进行定制。
|
||||
|
||||
#### 安装 Xfce
|
||||
|
||||
安装 Xfce 桌面环境相当简单。只需要:
|
||||
|
||||
```
|
||||
sudo apt install -y --no-install-recommends xfce4 desktop-base lightdm
|
||||
```
|
||||
|
||||
这就够了。你现在安装了 X Window(X11)和 Xfce 了。现在是时候来定制一下环境并且安装一些核心应用了。
|
||||
|
||||
### 核心应用
|
||||
|
||||
目前为止,你已经安装了 X Window(X11)、Xfce 桌面环境和 LightDM(一个 Xfce 自带的显示管理器)。现在,你已经有了一个可以启动并且正常使用的轻量级的完整系统。不过,在彻底完成之前,我还是喜欢装一些核心应用。
|
||||
|
||||
下面这条命令安装了一个终端程序、[Audacious][7] 音频播放器、[Ristretto][8] 图像浏览器、[Mousepad][9] 文本编辑器、[File Roller][10] 存档管理器和 [Thunar][11] 容量管理器。
|
||||
|
||||
```
|
||||
sudo apt install -y --no-install-recommends xfce4-terminal audacious ristretto
|
||||
sudo apt install -y --no-install-recommends mousepad file-roller thunar-volman
|
||||
```
|
||||
|
||||
#### 其他可选项
|
||||
|
||||
其他一些你可能想安装的东西,包括一个好的网络管理器、任务管理器、PDF 阅读器和通知工具,以及桌面背景管理器、截图工具、一些新的图标和光标主题。简单来说,如果树莓派是你的首选系统,这些都算是日常工作的一些补充。
|
||||
|
||||
```
|
||||
sudo apt install -y --no-install-recommends network-manager xfce4-taskmanager xfce4-notifyd
|
||||
sudo apt install -y --no-install-recommends xpdf gnome-icon-theme dmz-cursor-theme
|
||||
```
|
||||
|
||||
### 下一步该做什么?
|
||||
|
||||
如果一切都正常工作的话,你现在就有一个基于 Xfce 和 Debian Lite 超轻量级操作系统的树莓派了。我建议现在你去 Xfce 网站上查看其它很酷的好东西,这些你都可以安装并使用。下一步做什么完全由你决定!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/custom-raspberry-pi
|
||||
|
||||
作者:[Patrick H. Mullins][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Yufei-Yan](https://github.com/Yufei-Yan)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/pmullins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi_cartoon.png?itok=m3TcBONJ (Cartoon graphic of Raspberry Pi board)
|
||||
[2]: https://www.raspberrypi.org/downloads/raspberry-pi-os/
|
||||
[3]: https://www.debian.org/
|
||||
[4]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md
|
||||
[5]: https://en.wikipedia.org/wiki/X_Window_System
|
||||
[6]: http://xfce.org
|
||||
[7]: https://audacious-media-player.org/
|
||||
[8]: https://docs.xfce.org/apps/ristretto/start
|
||||
[9]: https://github.com/codebrainz/mousepad
|
||||
[10]: https://gitlab.gnome.org/GNOME/file-roller
|
||||
[11]: https://docs.xfce.org/xfce/thunar/thunar-volman
|
||||
[12]: https://goodies.xfce.org/
|
@ -0,0 +1,141 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (nophDog)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12375-1.html)
|
||||
[#]: subject: (How to know if you're ready to switch from Mac to Linux)
|
||||
[#]: via: (https://opensource.com/article/20/6/mac-to-linux)
|
||||
[#]: author: (Marko Saric https://opensource.com/users/markosaric)
|
||||
|
||||
你是否已经准备好从 Mac 切换到 Linux 了?
|
||||
======
|
||||
|
||||
> 你几乎可以在 Linux 上做任何你在 Mac 上可以做的事情 —— 这是你拥有一个开源操作系统的自由。
|
||||
|
||||

|
||||
|
||||
我[从 Mac 转到 Linux][2] 已经两年了。在使用 Linux 之前,我用的 Apple 的系统用了 15 年,而当我在 2018 年安装第一个 Linux 发行版时,还只是一个纯粹的新手。
|
||||
|
||||
这些日子以来,我只用 Linux,我可以用它完成任何任务。浏览网页、观看 Netflix 影片、写作以及编辑我的 Wordpress [博客][3],甚至还在上面跑我的[开源网页分析项目][4]。
|
||||
|
||||
我甚至还不是一个开发者!Linux 被认为不适合日常使用,对非技术人员也不够友好的日子已经一去不返了。
|
||||
|
||||
最近有很多关于 Mac 的讨论,越来越多的人已经在考虑转到 Linux。我打算分享我的切换过程中的一些经验,帮助其它新手也能从容转移。
|
||||
|
||||
### 你该不该换?
|
||||
|
||||
在换系统之前,最好想清楚,因为有时候 Linux 可能跟你预期不一样。如果你仍希望跟 Apple Watch 无缝配对、可以用 FaceTime 给朋友打电话、或者你想打开 iMovie 看视频,那最好还是不要换了。这些都是 Apple 的专有产品,你只能在 Apple 的“围墙花园”里面使用。如果离不开 Apple 的生态系统,那么 Linux 可能不太适合你。
|
||||
|
||||
我对 Apple 生态没有太多挂念,我不用 iPhone,所以跟手机的协作没那么必要。我也不用 iCloud、FaceTime,当然也包括 Siri。我早就对开源充满兴趣,只是一直没有行动。
|
||||
|
||||
### 检查你的必备软件清单
|
||||
|
||||
我还在使用 Mac 的时候,就已经开始探索开源软件,我发现大部分在 Mac 上使用的软件,在 Linux 也可以运行。
|
||||
|
||||
很熟悉用火狐浏览网页吗?在 Linux 上它也可以运行。想用 VLC 看视频?它也有 Linux 版本。喜欢用 Audacity 录制、编辑音频?它正在 Linux 上等着你呢。你用 OBS Studio 直播?在 Linux 直接下载安装吧。一直用 Telegram 跟朋友和家人保持联系吗?Linux 上当然少不了它。
|
||||
|
||||
此外,Linux 不仅仅意味着开源软件。你最喜欢的大部分(也可能是所有)非 Apple 专有软件,都能在 Linux 见到它们的身影。Spotify、Slack、Zoom、Stream、Discord、Skype、Chrome 以及很多闭源软件,都可以使用。而且,在你 Mac 浏览器里面运行的任何东西,同样能够运行在 Linux 浏览器。
|
||||
|
||||
你能在 Linux 找到你的必备软件,或者更好的替代品吗?请再三确认,做到有备无患。用你最常用的搜索引擎,在网上检索一下。搜索“软件名 + Linux” 或者“软件名 + Linux 替代品”,然后再去 [Flathub][5] 网站查看你能在 Linux 用 Flatpak 安装的专有软件有哪些。
|
||||
|
||||
### 请牢记:Linux 不等于 Mac
|
||||
|
||||
如果你希望能够从 Mac 轻松转移到 Linux,我相信有一点很重要,你需要保持包容的思想以及愿意学习新操作系统的心态。Linux 并不等于 Mac,所以你需要给自己一些时间去接触并了解它。
|
||||
|
||||
如果你想让 Linux 用起来、看起来跟你习惯的 macOS 一模一样,那么 Linux 可能也不适合你。尽管你可以通过各种方法[把 Linux 桌面环境打造得跟 macOS 相似][14],但我觉得要想成功转移到 Linux,最好的办法是从拥抱 Linux 开始。
|
||||
|
||||
试试新的工作流,该怎么用就怎么用。不要总想着把 Linux 变成其它东西。你会跟我一样,像享受 Mac 一样享受 Linux,甚至能有更好的体验感。
|
||||
|
||||
还记得你第一次使用 Mac 吧:你肯定花了不少时间去习惯它的用法。那么请给 Linux 同样多的时间和关怀。
|
||||
|
||||
### 选择一个 Linux 发行版
|
||||
|
||||
有别于 Windows 和 macOS,Linux 不止一个单一的操作系统。不同的 Linux 操作系统被称作发行版,开始使用 Linux 之后,我尝试过好几个不同的发行版。我也用过不同的桌面环境,或者图形界面。在美观度、易用性、工作流以及集成软件上,它们有很大差异。
|
||||
|
||||
尽管作为 Mac 的替代品,被提及最多的是 [ElementaryOS][6] 和 [Pop!_OS][7],但我仍建议从 [Fedora 工作站][8] 开始,理由如下:
|
||||
|
||||
- 使用 [Fedora 介质写入器][9],容易安装
|
||||
- 几乎可以支持你所有的硬件,开箱即用
|
||||
- 支持最新的 Linux 软件
|
||||
- 运行原生无改动的 GNOME 桌面环境
|
||||
- 有一个大型开发团队以及一个庞大的社区在背后支持
|
||||
|
||||
在我看来,对从 macOS 过来的新手来说,[GNOME][10] 是易用性、一致性、流畅性和用户体验最好的桌面环境。它拥有 Linux 世界中最多的开发资源和用户基数,所以你的使用体验会很好。
|
||||
|
||||
Fedora 可以为你打开一扇 Linux 的大门,当你适应之后,就可以开始进一步探索各个发行版、桌面环境,甚至窗口管理器之类的玩意了。
|
||||
|
||||
### 熟悉 GNOME
|
||||
|
||||
GNOME 是 Fedora 和许多其它 Linux 发行版的默认窗口管理器。它最近 [升级到 GNOME 3.36][11],带来了 Mac 用户会喜欢的现代设计。
|
||||
|
||||
一定要做好心理准备,Linux、Fedora 工作站和 GNOME 并不是 Apple 和 macOS。GNOME 非常干净、简约、现代、独创。它不会分散你的注意力,没有桌面图标,没有可见的坞站,窗口上甚至没有最小化和最大化按钮。但是不要慌张,如果你去尝试,它会证明这是你用过最好、最有生产力的操作系统。
|
||||
|
||||
GNOME 不会给你带来困扰。启动之后,你唯一能看到的东西只有顶栏和背景图片。顶栏由这几样东西组成,“活动”在左边,时间和日期在中间(这也是你的通知中心),右边是网络、蓝牙、VPN、声音、亮度、电池等托盘图标之类的东西。
|
||||
|
||||
#### 为什么 GNOME 像 Mac
|
||||
|
||||
你会注意到一些跟 macOS 的相似之处,例如窗口吸附、空格预览(用起来跟 “Quick Look” 一模一样)。
|
||||
|
||||
如果你把鼠标光标移动到左上角,点击顶栏的“活动”,或者按下键盘上超级键(`Super` 键,也就是 Mac 上的 `ஐ` 键),你会看到“活动概览”。它有点像 macOS 系统上“调度中心”和“聚焦搜索”的结合体。它会在屏幕中间展示已打开软件和窗口的概览。在左手边,你可以看到坞站,上面有你打开的软件和常用软件。所有打开的软件下面会有一个指示标志,在右手边,你可以看到不同的工作区。
|
||||
|
||||
在顶栏中间,有一个搜索框。只要你开始输入,焦点就会转移到搜索框。它能搜索你已经安装的软件和文件内容,可以在软件中心搜索指定的软件、进行计算、向你展示时间或者天气,当然它能做的还有很多。它就像“聚焦”一样。只需开始输入你要搜索的内容,按下回车就可以打开软件或者文件。
|
||||
|
||||
你也能看到一列安装好的软件(更像 Mac 上的“启动台”),点击坞站中的“显示应用”图标,或者按 `Super + A` 就行。
|
||||
|
||||
总体来说,Linux 是一个轻量级的系统,即使在很老的硬件上也能跑得很顺畅,跟 macOS 比起来仅仅占用很少的磁盘空间。并且不像 macOS,你可以删除任何你不想要或不需要的预装软件。
|
||||
|
||||
#### 自定义你的 GNOME 设置
|
||||
|
||||
浏览一下 GNOME 设置,熟悉它的选项,做一些更改,让它用起来更舒服。下面是一些我装好 GNOME 必做的事情。
|
||||
|
||||
- 在“鼠标和触摸板”中,我禁用“自然滚动”、启用“轻触点击”。
|
||||
- 在“显示”中,我打开“夜光”功能,在晚上,屏幕会让颜色变暖,减少眼睛疲劳。
|
||||
- 我也安装了 [GNOME 优化][12],因为它可以更改额外的设置选项。
|
||||
- 在“GNOME 优化”中,我启用了 “Over-Amplification” 设置,这样就能获得更高的音量。
|
||||
- 在“GNOME 优化”中,相比默认的亮色主题,我更喜欢 “Adwaita Dark” 主题。
|
||||
|
||||
#### 习惯使用键盘操作
|
||||
|
||||
GNOME 是以一个极度以键盘为中心的操作系统,所以尽量多使用键盘。在 GNOME 设置中的“键盘快捷键”部分,你可以找到各个快捷键。
|
||||
|
||||
你也可以根据自己的理想工作流程来设置键盘快捷键。我将我最常用的应用程序设置为使用超级键打开。比如说,`Super + B` 打开我的浏览器,`Super + F` 打开“文件”,`Super + T` 打开终端。我还把 `Ctrl + Q` 设置成关闭窗口。
|
||||
|
||||
我使用 `Super + Tab` 在打开的应用程序之间切换,`Super + H` 隐藏一个窗口,`F11` 全屏打开软件,`Super + Left` 把窗口吸附到屏幕左边,`Super + Right` 把窗口吸附到屏幕左边,等等。
|
||||
|
||||
### 在 Mac 上尝试 Linux 之后再做决定
|
||||
|
||||
在完全安装 Linux 之前,在你的 Mac 上先尝试 Fedora。从 [Fefora 官网][9]下载 ISO 镜像。使用 [Etcher][13] 将 ISO 镜像写入 USB 驱动器,然后在启动时点击 `Option` 键,这样你就可以在即用模式下尝试了。
|
||||
|
||||
现在您无需在 Mac 上安装任何东西就可以探索 Fedora 工作站了。试试各种东西,能否正常工作:能不能连接 WiFi?触控板是否正常?有没有声音?等等。
|
||||
|
||||
也记得花时间来尝试 GNOME。测试我上面提到的不同功能。打开一些安装好的软件。如果一切看起来都还不错,如果你喜欢这样的 Fedora 工作站和 GNOME,并且很肯定这就是你想要的,那么把它安装到你的 Mac 吧。
|
||||
|
||||
尽情探索 Linux 世界吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/mac-to-linux
|
||||
|
||||
作者:[Marko Saric][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[nophDog](https://github.com/nophDog)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/markosaric
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_browser_web_desktop.png?itok=Bw8ykZMA (Digital images of a computer desktop)
|
||||
[2]: https://markosaric.com/linux/
|
||||
[3]: https://markosaric.com/how-start-blog/
|
||||
[4]: https://plausible.io/open-source-website-analytics
|
||||
[5]: https://flathub.org/apps
|
||||
[6]: https://opensource.com/article/20/2/macbook-linux-elementary
|
||||
[7]: https://support.system76.com/articles/pop-basics/
|
||||
[8]: https://getfedora.org/
|
||||
[9]: https://getfedora.org/en/workstation/download/
|
||||
[10]: https://www.gnome.org/
|
||||
[11]: https://www.gnome.org/news/2020/03/gnome-3-36-released/
|
||||
[12]: https://wiki.gnome.org/Apps/Tweaks
|
||||
[13]: https://www.balena.io/etcher/
|
||||
[14]: https://linux.cn/article-12361-1.html
|
143
published/20200616 How to loop forever in bash on Linux.md
Normal file
143
published/20200616 How to loop forever in bash on Linux.md
Normal file
@ -0,0 +1,143 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12368-1.html)
|
||||
[#]: subject: (How to loop forever in bash on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3562576/how-to-loop-forever-in-bash-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
如何在 Linux 的 bash 中永远循环
|
||||
======
|
||||
|
||||
![tine ivanic][1]
|
||||
|
||||
在 Linux 中有很多永远循环(或直到你决定停止)的方法,你可以在命令行或脚本中执行此操作。
|
||||
|
||||
`for` 和 `while` 命令使这件事非常容易。关于相应的语法和策略,只有几件事要牢记。
|
||||
|
||||
### 使用 while
|
||||
|
||||
最简单的永远循环之一是使用 `while` 命令,后面跟上条件 `true`。 你不必使用诸如 `while [ 1 -eq 1 ]` 之类的逻辑或类似的测试。 `while true` 测试表示循环将一直运行,直到你使用 `CTRL-C` 停止循环、关闭终端窗口或注销为止。这是一个例子:
|
||||
|
||||
```
|
||||
$ while true
|
||||
> do
|
||||
> echo Keep running
|
||||
> sleep 3
|
||||
> done
|
||||
Keep running
|
||||
Keep running
|
||||
Keep running
|
||||
^C
|
||||
```
|
||||
|
||||
你也可以使用 `while :` 做同样的事情。这里的关键是 `:` 总是返回成功,因此就像 `while true` 一样,此测试永远不会失败,并且循环会继续运行:
|
||||
|
||||
```
|
||||
$ while :
|
||||
> do
|
||||
> echo Keep running
|
||||
> sleep 3
|
||||
> done
|
||||
Keep running
|
||||
Keep running
|
||||
^C
|
||||
```
|
||||
|
||||
如果你在脚本中插入了无限循环,并想提醒使用它的人如何退出脚本,那么可以使用 `echo` 命令添加提示:
|
||||
|
||||
```
|
||||
while :
|
||||
do
|
||||
echo Keep running
|
||||
echo "Press CTRL+C to exit"
|
||||
sleep 1
|
||||
done
|
||||
```
|
||||
|
||||
### 使用 for
|
||||
|
||||
`for` 命令还提供了一种永远循环的简便方法。虽然不如 `while true` 明显,但语法相当简单。你只需要在有界循环中替换参数即可,它通常类似于 “c 从等于 1 开始递增,直到 5”:
|
||||
|
||||
```
|
||||
$ for (( c=1; c<=5; c++ ))
|
||||
```
|
||||
|
||||
不指定任何参数的情况下:
|
||||
|
||||
```
|
||||
$ for (( ; ; ))
|
||||
```
|
||||
|
||||
没有起始值、增量或退出测试,此循环将永远运行或被强制停止:
|
||||
|
||||
```
|
||||
$ for (( ; ; ))
|
||||
> do
|
||||
> echo Keep running
|
||||
> echo “Press CTRL+C to exit”
|
||||
> sleep 2
|
||||
> done
|
||||
Keep your spirits up
|
||||
Keep your spirits up
|
||||
Keep your spirits up
|
||||
```
|
||||
|
||||
### 为什么要永远循环?
|
||||
|
||||
在现实中,你不会想永远循环下去,但一直运行直到想要回家、工作完成或者遇到问题才退出并不罕见。任何构造为无限循环的循环都可以设置为根据各种情况退出。
|
||||
|
||||
该脚本将一直处理数据直到下午 5 点,或者说检查发现第一次超过 5 点的时间:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
while true
|
||||
do
|
||||
if [ `date +%H` -ge 17 ]; then
|
||||
exit # exit script
|
||||
fi
|
||||
echo keep running
|
||||
~/bin/process_data # do some work
|
||||
done
|
||||
```
|
||||
|
||||
如果要退出循环而不是退出脚本,请使用 `break` 命令而不是 `exit`。
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
while true
|
||||
do
|
||||
if [ `date +%H` -ge 17 ]; then
|
||||
break # exit loop
|
||||
fi
|
||||
echo keep running
|
||||
~/bin/process_data
|
||||
done
|
||||
… run other commands here …
|
||||
```
|
||||
|
||||
### 总结
|
||||
|
||||
永远循环很容易。指定要停止循环的条件却需要花费一些额外的精力。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3562576/how-to-loop-forever-in-bash-on-linux.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://images.idgesg.net/images/article/2020/06/nw_circular-staircase_loop_infinity_nautilus_by-tine-ivanic-via-unsplash-100848725-large.jpg
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html
|
||||
[4]: https://www.facebook.com/NetworkWorld/
|
||||
[5]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,104 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12369-1.html)
|
||||
[#]: subject: (4 essential tools to set up your Python environment for success)
|
||||
[#]: via: (https://opensource.com/article/20/6/python-tools)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
建立成功的 Python 环境的 4 个基本工具
|
||||
======
|
||||
|
||||
> 选择的这些工具将简化你的 Python 环境,以实现顺畅和一致的开发实践。
|
||||
|
||||

|
||||
|
||||
Python 是一门出色的通用编程语言,经常作为第一门编程语言来教授。二十年来,我为它撰写了很多本书,而它仍然是[我的首选语言][2]。虽然通常来说这门语言是简洁明了的,但是(正如 [xkcd][3] 讽刺的),从来没有人说过配置 Python 环境也是一样的简单。
|
||||
|
||||
![xkcd python illustration][4]
|
||||
|
||||
*一个复杂的Python环境。 [xkcd][3]*
|
||||
|
||||
在日常生活中有很多使用 Python 的方法。我将解释我是如何使用这些 Python 生态系统工具的。但坦诚的说,我仍在寻找更好的替代品。
|
||||
|
||||
### 使用 pyenv 来管理 Python 版本
|
||||
|
||||
我发现在机器上运行一个特定版本的 Python 的最好方法是使用 `pyenv`。这个软件可以在 Linux、Mac OS X 和 WSL2 上工作:这是我通常关心的三个 “类 UNIX” 环境。
|
||||
|
||||
安装 `pyenv` 本身有时会有点棘手。一种方法是使用专用的 [pyenv 安装程序][5],它使用 `curl | bash` 方法来进行(详见其说明)。
|
||||
|
||||
如果你是在 Mac 上(或者你运行 Homebrew 的其他系统),你可以按照[这里][6]的说明来安装和使用 `pyenv`。
|
||||
|
||||
按照说明安装和设置了 `pyenv` 之后,你可以使用 `pyenv global` 来设置一个 “默认的” Python 版本。一般来说,你会选择你的 “首选” 版本。这通常是最新的稳定版本,但如果有其他考虑因素也可能做出不同的选择。
|
||||
|
||||
### 使用 virtualenvwrapper 让虚拟环境更简单
|
||||
|
||||
使用 `pyenv` 安装 Python 的一个好处是,你所有后继安装的 Python 解释器环境都是你自己的,而不是操作系统层面的。
|
||||
|
||||
虽然在 Python 本身内部安装东西通常不是最好的选择,但有一个例外:在上面选择的 “首选” Python 中,安装并配置 `virtualenvwrapper`。这样你就可以瞬间创建和切换到虚拟环境。
|
||||
|
||||
我在[这篇文章中][7]具体介绍了如何安装和使用 `virtualenvwrapper`。
|
||||
|
||||
这里我推荐一个独特的工作流程:你可以制作一个可以大量重复运行的虚拟环境,用来做<ruby>运行器<rt>runner</rt></ruby>。在这个环境中,可以安装你最喜欢的运行器 —— 也就是你会经常用来运行其他软件的软件。就目前而言,我的首选是 `tox`。
|
||||
|
||||
### 使用 tox 作为 Python 运行器
|
||||
|
||||
[tox][8] 是一个很好的工具,可以让你的 Python 测试自动化。在每个 Python 环境中,我都会创建一个 `tox.ini` 文件。无论我使用什么系统做持续集成,都可以运行它,我可以用上面文章中描述的 `virtualenvwrapper` 的 `workon` 语法在本地运行同样的东西:
|
||||
|
||||
```
|
||||
$ workon runner
|
||||
$ tox
|
||||
```
|
||||
|
||||
这个工作流程之所以重要,是因为我要在多个版本的 Python 和多个版本的依赖库中测试我的代码。这意味着在 `tox` 运行器中会有多个环境。一些会尝试在最新的依赖关系中运行,一些会尝试在冻结的依赖关系中运行(接下来会有更多的介绍),我也可能会用 `pip-compile` 在本地生成这些环境。
|
||||
|
||||
附注:我目前正在[研究使用 nox][9] 作为 `tox` 的替代品。原因超出了本文的范畴,但值得一试。
|
||||
|
||||
### 使用 pip-compile 进行 Python 依赖性管理
|
||||
|
||||
Python 是一种动态编程语言,这意味着它在每次执行代码时都会加载其依赖关系。能否确切了解每个依赖项的具体运行版本可能意味着是平稳运行代码还是意外崩溃。这意味着我们必须考虑依赖管理工具。
|
||||
|
||||
对于每个新项目,我都会包含一个 `requirements.in` 文件,(通常)只有以下内容:
|
||||
|
||||
```
|
||||
.
|
||||
```
|
||||
|
||||
是的,没错。只有一个点的单行。我在 `setup.py` 文件中记录了 “宽松” 的依赖关系,比如 `Twisted>=17.5`。这与 `Twisted==18.1` 这样的确切依赖关系形成了鲜明对比,后者在需要一个特性或错误修复时,难以升级到新版本的库。
|
||||
|
||||
`.` 的意思是 “当前目录”,它使用当前目录下的 `setup.py` 作为依赖关系的来源。
|
||||
|
||||
这意味着使用 `pip-compile requirements.in > requirements.txt` 会创建一个冻结的依赖文件。你可以在 `virtualenvwrapper` 创建的虚拟环境中或者 `tox.ini` 中使用这个依赖文件。
|
||||
|
||||
有时,也可以从 `requirements-dev.in`(内容:`.[dev]`)生成 `requirements-dev.txt`,或从 `requirements-test.in`(内容:`.[test]`)生成 `requirements-test.txt`。
|
||||
|
||||
我正在研究在这个流程中是否应该用 [dephell][10] 代替 `pip-compile`。`dephell` 工具有许多有趣的功能,比如使用异步 HTTP 请求来下载依赖项。
|
||||
|
||||
### 结论
|
||||
|
||||
Python 的功能既强大又赏心悦目。为了编写这些代码,我依靠了一个对我来说很有效的特定工具链。工具 `pyenv`、`virtualenvwrapper`、`tox` 和 `pip-compile` 都是独立的。但是,它们各有各的作用,没有重叠,它们一起打造了一个强大的 Python 工作流。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/python-tools
|
||||
|
||||
作者:[Moshe Zadka][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/moshez
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks)
|
||||
[2]: https://opensource.com/article/19/10/why-love-python
|
||||
[3]: https://xkcd.com/1987/
|
||||
[4]: https://opensource.com/sites/default/files/uploads/python_environment_xkcd_1.png (xkcd python illustration)
|
||||
[5]: https://github.com/pyenv/pyenv-installer
|
||||
[6]: https://linux.cn/article-12241-1.html
|
||||
[7]: https://linux.cn/article-11086-1.html
|
||||
[8]: https://opensource.com/article/19/5/python-tox
|
||||
[9]: https://nox.thea.codes/en/stable/
|
||||
[10]: https://github.com/dephell/dephell
|
@ -0,0 +1,103 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12373-1.html)
|
||||
[#]: subject: (Missing Photoshop on Linux? Use PhotoGIMP and Convert GIMP into Photoshop)
|
||||
[#]: via: (https://itsfoss.com/photogimp/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
在 Linux 上缺少 Photoshop?使用 PhotoGIMP 将 GIMP 变为 Photoshop
|
||||
======
|
||||
|
||||
[Adobe Photoshop][1] 不适用于桌面 Linux。GIMP 是 [Linux 上 Adobe Photoshop 的最佳替代品][2]。
|
||||
|
||||
如果你使用过 Photoshop,那么你会注意到 [GIMP][3] 和 Photoshop 相比有不同的设置、键盘快捷键和布局。
|
||||
|
||||
这没有错。毕竟,它们都是两种不同的软件,而且它们不必看起来相同。
|
||||
|
||||
但是,习惯了 Photoshop 的人们发现在切换到 GIMP 的时很难忘记他们反复学习的肌肉记忆。这可能会使某些人感到沮丧,因为使用新的界面意味着要学习大量的键盘快捷键,并花时间在查找工具位于何处。
|
||||
|
||||
为了帮助从 Photoshop 切换到 GIMP 的人,[Diolinux][4] 推出了一个在 GIMP 中模仿 Adobe Photoshop 的工具。
|
||||
|
||||
### PhotoGIMP:在 Linux 中为 GIMP 提供 Adobe Photoshop 的外观
|
||||
|
||||
![][5]
|
||||
|
||||
[PhotoGIMP][6] 不是独立的图形软件。它是 GIMP 2.10 的补丁。你需要在系统上安装 GIMP 才能使用 PhotoGIMP。
|
||||
|
||||
当你应用 PhotoGIMP 补丁时,它将更改 GIMP 布局以模仿 Adobe Photoshop。
|
||||
|
||||
* 默认安装数百种新字体
|
||||
* 安装新的 Python 过滤器,例如 “heal selection”
|
||||
* 添加新的启动画面
|
||||
* 添加新的默认设置以最大化画布空间
|
||||
* 添加类似于 Adobe Photoshop 的键盘快捷键
|
||||
|
||||
PhotoGIMP 还在自定义 `.desktop` 文件中添加新的图标和名称。让我们看看如何使用它。
|
||||
|
||||
### 在 Linux 上安装 PhotoGIMP (适合中级到专业用户)
|
||||
|
||||
PhotoGIMP 本质是一个补丁。在 Linux 中下载并[解压 zip 文件][7]。你将在解压的文件夹中找到以下隐藏的文件夹:
|
||||
|
||||
* `.icons`:其中包含新的 PhotoGIMP 图标
|
||||
* `.local`:包含个性化的 `.desktop` 文件,以便你在系统菜单中看到的是 PhotoGIMP 而不是 GIMP
|
||||
* `.var`:包含 GIMP 补丁的主文件夹
|
||||
|
||||
你应该[使用 Ctrl+H 快捷键在 Ubuntu 中显示隐藏文件][8]。
|
||||
|
||||
警告:建议你备份 GIMP 配置文件,以便在不喜欢 PhotoGIMP 时可以还原。只需将 GIMP 配置文件复制到其他位置即可备份。
|
||||
|
||||
目前,PhotoGIMP 主要与通过 [Flatpak][9] 安装的 GIMP 兼容。如果你使用 Flatpak 安装了 GIMP,那么只需将这些隐藏的文件夹复制粘贴到家目录中,它将 GIMP 转换为 Adobe Photoshop 类似的设置。
|
||||
|
||||
但是,如果你通过 apt、snap 或发行版的包管理器安装了 GIMP,那么必须找到 GIMP 的配置文件夹,然后粘贴 PhotoGIMP 的 `.var` 目录的内容。当出现询问时,请选择合并选项并替换同名的现有文件。
|
||||
|
||||
我[使用 apt 在 Ubuntu 20.04 中安装了 GIMP][10]。对我来说,GIMP 配置文件在 `~/.config/GIMP/2.10`。我复制了 `.var/app/org.gimp.GIMP/config/GIMP/2.10` 目录,并启动 GIMP 查看 PhotoGIMP 的启动页。
|
||||
|
||||
这是打了 PhotoGIMP 补丁后的 GIMP 界面:
|
||||
|
||||
![][11]
|
||||
|
||||
我尝试了几个 Photoshop 快捷键来检查它所做的更改,一切似乎可以正常工作。
|
||||
|
||||
- [下载 PhotoGIMP][12]
|
||||
|
||||
我还找到了 [Snap 包形式的 PhotoGIMP][13],但它是 2019 年的,我不确定它是否可以在所有地方使用,或者仅适用于 snap 安装。
|
||||
|
||||
### 总结
|
||||
|
||||
这不是类似的第一个项目。几年前,我们有一个类似的项目叫 Gimpshop。Gimpshop 项目在过去的几年中没有任何进展,可以肯定地认为该项目已经死亡。有一个名为 Gimpshop 的网站,但该网站来自冒名者试图以 Gimpshop 的名义获利。
|
||||
|
||||
我不是 Adobe Photoshop 用户。我甚至不是 GIMP 专家,这就是为什么我们的 [GIMP 教程][14] 用 Dimitrios 的原因。
|
||||
|
||||
因此,我无法评论 PhotoGIMP 项目的实用性。如果你熟悉这两种软件,那么应该能够比我更好地进行判断。
|
||||
|
||||
如果你尝试使用 PhotoGIMP,请与他人分享你的经验,并告诉我们是否值得安装。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/photogimp/
|
||||
|
||||
作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.adobe.com/in/products/photoshop.html
|
||||
[2]: https://itsfoss.com/open-source-photoshop-alternatives/
|
||||
[3]: https://www.gimp.org/
|
||||
[4]: https://diolinux.com.br/
|
||||
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/photogimp-feature.jpg?ssl=1
|
||||
[6]: https://github.com/Diolinux/PhotoGIMP
|
||||
[7]: https://itsfoss.com/unzip-linux/
|
||||
[8]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
|
||||
[9]: https://flatpak.org/
|
||||
[10]: https://itsfoss.com/gimp-2-10-release/
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/photogimp-editor-interface.jpg?resize=800%2C538&ssl=1
|
||||
[12]: https://github.com/Diolinux/PhotoGIMP/releases
|
||||
[13]: https://snapcraft.io/photogimp
|
||||
[14]: https://itsfoss.com/tag/gimp-tips/
|
@ -0,0 +1,81 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (GNU Health expands Raspberry Pi support, Megadeth's guitarist uses open source principles, and more open source news.)
|
||||
[#]: via: (https://opensource.com/article/20/6/news-june-23)
|
||||
[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo)
|
||||
|
||||
GNU Health expands Raspberry Pi support, Megadeth's guitarist uses open source principles, and more open source news.
|
||||
======
|
||||
Catch up on the biggest open source headlines from the past two weeks.
|
||||
![][1]
|
||||
|
||||
In this week’s edition of our open source news roundup, GNU Health expands to Raspberry Pis, how Megadeth's guitarist uses open source principles, and more open source news.
|
||||
|
||||
### GNU Health expands its support for Raspberry Pi
|
||||
|
||||
The GNU Health project, designed to help hospitals run on low-cost software and hardware, expanded its support for Rapsberry Pi models in its recent release [according to CNX][2]. The GNU Health Embedded version that runs on Raspberry Pis is "especially suited for remote areas without internet, academic Institutions, domiciliary units, home nursing, and laboratory stations."
|
||||
|
||||
> *"GNU Health (GH) is a free and open-source Health and Hospital Information System (HIS) that can manage the internal processes of a health institution, such as financial management, electronic medical records (EMR), stock & pharmacies or laboratories (LIMS)." *
|
||||
|
||||
GNU Health is a free and open source health and hospital information system (HIS) to help healthcare systems manage finances, pharmacies, electronic medical records (EMRs), and more. The Raspberry Pi solution supports real-time monitoring of vital signs in hospitals, and retrieve information from labs.
|
||||
|
||||
More details may be found on [the official website][3].
|
||||
|
||||
### Megadeth's guitarist brings OSS approaches to music
|
||||
|
||||
Heavy metal fans likely know Kiko Loureiro as Megadeth's guitarist. Loureiro is less known in the OSS world, but that might change soon: His new solo album is called _Open Source_.
|
||||
|
||||
"By definition, 'open source' is related to softwares [in] which the original source code is made freely available and may be redistributed and modified," Loureiro shared [in a recent interview.][4] "It brings us a higher sense of community, enhances our creativity and creates new possibilities."
|
||||
|
||||
In true open source fashion, Loureiro is running an Indiegogo fundraiser to [keep his album][5] independent. His fundraiser emphasizes the "Open Source Mentality," which includes making his song's stems available for listeners to remix.
|
||||
|
||||
### The Linux Foundation partners with Harvard for a FOSS contributor security survey
|
||||
|
||||
The Linux Foundation's Core Infrastructure Initiative (CII) launched [a survey for FOSS contributors][6] addressing security concerns in open source. CII developed the survey in partnership with the Laboratory for Innovation Science at Harvard (LISH). FOSS contributors can [take the survey][7] through early August.
|
||||
|
||||
This new survey follows [the Census II analysis and report][8], which assessed popular FOSS components for vulnerabilities. David A. Wheeler, The Linux Foundation's director of open source supply chain security, said the survey is essential since open source solutions are used so widely now.
|
||||
|
||||
Along with its reports and surveys, CII built a [Best Practices badge program][9] that encourages developers to audit their solutions for security threats.
|
||||
|
||||
### In other news
|
||||
|
||||
* [OpenStack adds the StarlingX edge computing stack to its top-level projects][10]
|
||||
|
||||
* [OpenSAFELY is a new secure analytics platform for electronic health records in the NHS][11]
|
||||
|
||||
* [Linux Kernel 5.6 Reached End of Life, Upgrade to Linux Kernel 5.7 Now][12]
|
||||
|
||||
|
||||
|
||||
|
||||
Thanks, as always, to Opensource.com staff members and [Correspondents][13] for their help this week.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/news-june-23
|
||||
|
||||
作者:[Lauren Maffeo][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/lmaffeo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd
|
||||
[2]: https://www.cnx-software.com/2020/06/15/gnu-health-embedded-open-source-health-platform-works-on-raspberry-pi-3-4-and-soon-olimex-sbcs
|
||||
[3]: https://www.gnuhealth.org/#/embedded
|
||||
[4]: https://www.blabbermouth.net/news/megadeths-kiko-loureiro-unveils-cover-art-for-open-source-solo-album/
|
||||
[5]: https://www.indiegogo.com/projects/kiko-loureiro-new-open-source-album#/
|
||||
[6]: https://www.linuxfoundation.org/blog/2020/06/linux-foundation-harvard-announce-free-libre-and-open-source-software-foss-contributor-survey/?SSAID=389818&sscid=61k4_isd0j
|
||||
[7]: https://hbs.qualtrics.com/jfe/form/SV_enfu6tjRM0QzwQB
|
||||
[8]: https://www.coreinfrastructure.org/programs/census-program-ii/
|
||||
[9]: https://www.linuxfoundation.org/blog/2020/06/why-cii-best-practices-gold-badges-are-important/?SSAID=389818&sscid=61k4_isyv5
|
||||
[10]: https://techcrunch.com/2020/06/11/openstack-adds-the-starlinkx-edge-computing-stack-to-its-top-level-projects/
|
||||
[11]: https://opensafely.org/
|
||||
[12]: https://9to5linux.com/linux-kernel-5-6-reached-end-of-life-upgrade-to-linux-kernel-5-7-now
|
||||
[13]: https://opensource.com/correspondent-program
|
@ -0,0 +1,68 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The ultimate guide to contributing to open source, an unparallelled reliance on Linux, and more industry trends)
|
||||
[#]: via: (https://opensource.com/article/20/6/linux-industry-trends)
|
||||
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
|
||||
|
||||
The ultimate guide to contributing to open source, an unparallelled reliance on Linux, 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.
|
||||
|
||||
## [How to Contribute to Open Source: The Ultimate Guide][2]
|
||||
|
||||
> “The biggest challenge for most people is that they don’t identify their areas of interest and where they can help us. They come to the project and ask, ‘How can I help?’” he said. “Instead, they could say, ‘This is the skill set I’d like to achieve.’ For example, ‘I’d like to develop some specific functionality for this piece of the project.’”
|
||||
|
||||
**The impact**: Saying "I want to contribute to open source" is a bit like saying "I want to work in the not-for-profit sector". Open source is a means to an end, and there is almost certainly a project working toward the end you care about that could use the skills you have.
|
||||
|
||||
## [Vulnerability Scoring Struggles to Remain Viable in the Era of Cloud Native Computing][3]
|
||||
|
||||
> To this claim, Danen said, “It was designed to indicate the severity of a flaw relative to other flaws. Nowhere will you see it described, by FIRST who created it, as a means of assessing risk. So yes, reliable to describe the mechanics of a vulnerability, but wholly inadequate to describe the risk of the vulnerability to a particular organization or environment.”
|
||||
|
||||
**The impact**: Using the [Common Vulnerability Scoring System][4] (CVSS) classification systems for vulnerabilities is becoming more difficult. Non-experts will usually use a number that describes something in the easiest possible way. The challenge is for experts is to make sure that the easiest possible way is also the right way.
|
||||
|
||||
## [The rise of parallel serverless compute][5]
|
||||
|
||||
> So why isn’t everything fast, amazing, and running this way already? One of the challenging parts about this today is that most software is designed to run on single machines, and parallelization may be limited to the number of machine cores or threads available locally. Because this architecture & “serverless compute” is so new (_cough cough 2014_), most software is not designed to leverage this approach. I see this changing in the future as more become aware of this approach.
|
||||
|
||||
**The impact**: It is actually hard to think scalably and takes a lot of practice to mentally understand what can be done alongside other things and what has to be done sequentially.
|
||||
|
||||
## [From Earth to orbit with Linux and SpaceX][6]
|
||||
|
||||
> Ordinary? Yes, ordinary. You see, spacecraft CPUs are far from the newest and greatest. They're developed for spacecraft, which takes years -- even decades -- to go from the drafting board to launch. For example, the International Space Station (ISS) runs on 1988-vintage 20 MHz Intel 80386SX CPUs. We don't know, however, what chips the Falcon 9 uses. Chances are, though, their design is at least a decade older than what you'd buy at a Best Buy now.
|
||||
|
||||
**The impact**: If your time horizon is measured in decades, there is a good chance Linux is your best option for a stable operating system.
|
||||
|
||||
## [Why the Success of Edge Computing Relies on a Linux Legacy][7]
|
||||
|
||||
> For edge computing innovation, we need to be thinking more about how we create sustainable solutions and technologies given how many deployments will require a longer life cycle and are more tightly bound to hardware and equipment refreshes. The path of innovation leads from Linux to and through the network edge. Companies that follow this approach will be better positioned to leverage the promise and power of the edge while avoiding fragmentation and lock-in.
|
||||
|
||||
**The impact**: Edge devices can't (shouldn't?) be ephemeral; to get the value we're promised by cheap, always on, always monitoring, always streaming devices they really need to be reliable over time. Linux = sustainability.
|
||||
|
||||
_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/6/linux-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://builtin.com/software-engineering-perspectives/open-source-contribution
|
||||
[3]: https://thenewstack.io/cvss-struggles-to-remain-viable-in-the-era-of-cloud-native-computing/
|
||||
[4]: https://www.first.org/cvss/
|
||||
[5]: https://davidwells.io/blog/rise-of-embarrassingly-parallel-serverless-compute
|
||||
[6]: https://www.zdnet.com/article/from-earth-to-orbit-with-linux-and-spacex/
|
||||
[7]: https://devops.com/why-the-success-of-edge-computing-relies-on-a-linux-legacy/
|
@ -0,0 +1,130 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (openSUSE Leap 15.2 Released With Focus on Containers, AI and Encryption)
|
||||
[#]: via: (https://itsfoss.com/opensuse-leap-15-2-release/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
openSUSE Leap 15.2 Released With Focus on Containers, AI and Encryption
|
||||
======
|
||||
|
||||
[openSUSE][1] Leap 15.2 has finally landed with some useful changes and improvements.
|
||||
|
||||
Also, considering the exciting announcement of [Closing the Leap Gap][2], the release of openSUSE Leap 15.2 brings us one step closer to SLE ([SUSE Linux Enterprise][3]) binaries being integrated to openSUSE Leap 15.3 next.
|
||||
|
||||
Let’s take a look at what has changed and improved in openSUSE Leap 15.2.
|
||||
|
||||
### openSUSE Leap 15.2: Key Changes
|
||||
|
||||
![][4]
|
||||
|
||||
Overall, openSUSE Leap 15.2 release involves security updates, major new packages, bug fixes, and other improvements.
|
||||
|
||||
In their press release, a developer of the project, **Marco Varlese**, mentions:
|
||||
|
||||
> “Leap 15.2 represents a huge step forward in the Artificial Intelligence space, “I am super excited that openSUSE end-users can now finally consume Machine Learning / Deep Learning frameworks and applications via our repositories to enjoy a stable and up-to-date ecosystem.”
|
||||
|
||||
Even though this hints at what changes it could involve, here’s what’s new in openSUSE Leap 15.2:
|
||||
|
||||
#### Adding Artificial Intelligence (AI) and Machine Learning packages
|
||||
|
||||
Unquestionably, Artificial Intelligence (AI) and Machine Learning are some of the most disruptive technologies to learn.
|
||||
|
||||
To facilitate that to its end-users, openSUSE Leap 15.2 has added a bunch of important packages for new open source technologies:
|
||||
|
||||
* [Tensorflow][5]
|
||||
* [PyTorch][6]
|
||||
* [ONNX][7]
|
||||
* [Grafana][8]
|
||||
* [Prometheus][9]
|
||||
|
||||
|
||||
|
||||
#### Introducing a Real-Time Kernel
|
||||
|
||||
![][10]
|
||||
|
||||
With openSUSE Leap 15.2, a real-time kernel will be introduced to manage the timing of [microprocessors][11] to efficiently handle time-critical events.
|
||||
|
||||
The addition of a real-time kernel is a big deal for this real. **Gerald Pfeifer (**chair of the project’s board) shared his thoughts with the following statement:
|
||||
|
||||
> “The addition of a real time kernel to openSUSE Leap unlocks new possibilities. Think edge computing, embedded devices, data capturing, all of which are seeing immense growth. Historically many of these have been the domain of proprietary approaches; openSUSE now opens the floodgates for developers, researchers and companies that are interested in testing real time capabilities or maybe even in contributing. Another domain open source helps open up!”
|
||||
|
||||
#### Inclusion of Container Technologies
|
||||
|
||||
With the latest release, you will notice that [Kubernetes][12] is included as an official package. This should make it easy for end-users to automate deployments, scale, and manage containerized applications.
|
||||
|
||||
[Helm][13] (the package manager for Kubernetes) also comes baked in. Not just limited to that, you will also find several other additions here and there that makes it easier to secure and deploy containerized applications.
|
||||
|
||||
#### Updates to openSUSE Installer
|
||||
|
||||
![][14]
|
||||
|
||||
openSUSE’s installer was already pretty good. But, with the latest Leap 15.2 release, they have added more information, compatibility with right-to-left languages like Arabic, and subtle changes to make it easier to select options right at the time of installation.
|
||||
|
||||
#### Improvements to YaST
|
||||
|
||||
While [YaST][15] is already a pretty powerful installation and configuration tool, this release adds the ability of creating and managing a Btrfs file-system and enforcing advanced encryption techniques.
|
||||
|
||||
Of course, you must be aware of the availability of [openSUSE on Windows Subsystem for Linux][16]. So, with Leap 15.2, YaST compatibility with WSL has improved as per their release notes.
|
||||
|
||||
#### Desktop Environment Improvements
|
||||
|
||||
![][17]
|
||||
|
||||
The desktop environments available have been update to their latest versions that include [KDE Plasma 5.18 LTS][18] and [GNOME 3.34][19].
|
||||
|
||||
You will also find an updated [XFCE 4.14][20] desktop available for openSUSE Leap 15.2.
|
||||
|
||||
If you’re curious to know all the details for the latest release, you may refer to the [official release announcement.][21]
|
||||
|
||||
### Download & Availability
|
||||
|
||||
As of now, you should be able to find Linode cloud images of Leap 15.2. Eventually, you will notice other cloud hosting services like Amazon Web Services, Azure, and others to offer it as well.
|
||||
|
||||
You can also grab the DVD ISO or the network image file from the official website itself.
|
||||
|
||||
To upgrade your current installation, I’d recommend following the [official instructions][22].
|
||||
|
||||
[openSUSE Leap 15.2][23]
|
||||
|
||||
Have you tried openSUSE Leap 15.2 yet? Feel free to let me know what you think!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/opensuse-leap-15-2-release/
|
||||
|
||||
作者:[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.opensuse.org/
|
||||
[2]: https://www.suse.com/c/sle-15-sp2-schedule-and-closing-the-opensuse-leap-gap/
|
||||
[3]: https://www.suse.com/
|
||||
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/07/opensuse-leap-15-2-gnome.png?ssl=1
|
||||
[5]: https://www.tensorflow.org
|
||||
[6]: https://pytorch.org
|
||||
[7]: https://onnx.ai
|
||||
[8]: https://grafana.com
|
||||
[9]: https://prometheus.io/docs/introduction/overview/
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/07/opensuse-leap-15-2-terminal.png?ssl=1
|
||||
[11]: https://en.wikipedia.org/wiki/Microprocessor
|
||||
[12]: https://kubernetes.io
|
||||
[13]: https://helm.sh
|
||||
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/07/opensuse-leap-15-2.png?ssl=1
|
||||
[15]: https://yast.opensuse.org/
|
||||
[16]: https://itsfoss.com/opensuse-bash-on-windows/
|
||||
[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/07/opensue-leap-15-2-kde.png?ssl=1
|
||||
[18]: https://itsfoss.com/kde-plasma-5-18-release/
|
||||
[19]: https://itsfoss.com/gnome-3-34-release/
|
||||
[20]: https://www.xfce.org/about/news/?post=1565568000
|
||||
[21]: https://en.opensuse.org/Release_announcement_15.2
|
||||
[22]: https://en.opensuse.org/SDB:System_upgrade
|
||||
[23]: https://software.opensuse.org/distributions/leap
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (011011100010110101101111)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,63 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How IoT will rescue aviation)
|
||||
[#]: via: (https://www.networkworld.com/article/3543318/how-iot-will-rescue-aviation.html)
|
||||
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
|
||||
|
||||
How IoT will rescue aviation
|
||||
======
|
||||
European airplane maker Airbus is one company exploring virus-spotting IoT sensors in an attempt to keep COVID-19-infected passengers off planes.
|
||||
[Stéphan Valentin][1] [(CC0)][2]
|
||||
|
||||
A biotech company that develops sensors to detect explosives and other chemicals on planes and in airports is teaming up with Airbus to create a sensor that could detect passengers who are positive for COVID-19.
|
||||
|
||||
California-based Koniku and Airbus, which have been working since 2017 on contactless equipment that sniffs out chemicals, are trying to adapt that technology to sniff out pathogens, says Osh Agabi, founder and CEO of Koniku, [in a blog post][3].
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][4]
|
||||
|
||||
They hope to identify odors in breath or sweat that are chemical markers indicating the presence of COVID-19 infection. "Most infections and diseases cause slight changes to the composition of our breath and sweat, which then produce distinct odors," Agabi writes. "If we can detect those odors, we can detect the presence of those infections."
|
||||
|
||||
The companies hope to identify markers specific to the novel coronavirus and an IOT sensor equipped with genetically engineered odoroant receptors that can detect them. "Those receptors screen molecules in the air and produce a signal when they come into contact with the molecular compounds of the hazard or threat that they have been programmed to detect," he writes.
|
||||
|
||||
He says that passengers would be screened by walking through an enclosed corridor where the sensors are deployed. "By programming the DNA of the cells that make up these receptors to react to the compounds that appear in infected people’s breath or sweat, we believe we will be able to quickly and reliably screen for COVID-19 and determine whether a person is infected," he writes.
|
||||
|
||||
Other types of contactless detectors are already in use, including elevated-skin-temperature (EST) cameras.
|
||||
|
||||
Italy's main airport, Leonardo da Vinci, acquired three thermal-imaging helmets with the intent to use them to spot persons with fevers. The airport already had fixed thermal scanners and has ordered more. Passengers detected with potentially high temperatures are made to take a further medical exam, [according to regional publication Fiumicino Online][5].
|
||||
|
||||
KC Wearable, the Shenzhen, China, company that makes the helmets, says they can be worn by staff and used at a distance from passengers.
|
||||
|
||||
FLIR Systems, which makes thermal cameras, says there’s been increased demand for them to be used in EST screening, the company says in this month in its [financial results][6].
|
||||
|
||||
"Although these thermal cameras cannot detect or diagnose any type of medical condition, the cameras do serve as an effective tool to identify elevated skin temperatures," it says.
|
||||
|
||||
"Many companies are looking to install this technology in their facilities in anticipation of lifting the shelter-in-place orders," FLIR CEO Jim Cannon [said in an earnings call][7] this month. General Motors is one of them, [according to Reuters][8].
|
||||
|
||||
Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3543318/how-iot-will-rescue-aviation.html
|
||||
|
||||
作者:[Patrick Nelson][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/Patrick-Nelson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://unsplash.com/photos/s7NGQU2Nt8k
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.linkedin.com/pulse/what-happens-when-airports-open-back-up-osh-agabi/?src=aff-lilpar&veh=aff_src.aff-lilpar_c.partners_pkw.10078_plc.Skimbit%20Ltd._pcrid.449670_learning&trk=aff_src.aff-lilpar_c.partners_pkw.10078_plc.Skimbit%20Ltd._pcrid.449670_learning&clickid=WNmzMlyalxyOUI7wUx0Mo34HUkiwwpy%3APQ3X1Y0&irgwc=1
|
||||
[4]: https://www.networkworld.com/newsletters/signup.html
|
||||
[5]: https://www.fiumicino-online.it/articoli/cronaca-2/fase-2-all-aeroporto-di-fiumicino-lo-smart-helmet-per-controllare-la-febbre-a-distanza
|
||||
[6]: https://flir.gcs-web.com/news-releases/news-release-details/flir-systems-announces-first-quarter-2020-financial-results
|
||||
[7]: https://www.fool.com/earnings/call-transcripts/2020/05/06/flir-systems-inc-flir-q1-2020-earnings-call-transc.aspx
|
||||
[8]: https://uk.reuters.com/article/us-flir-systems-gm/general-motors-taps-flir-systems-for-fever-check-cameras-at-factories-idUKKBN22J02B
|
||||
[9]: https://www.facebook.com/NetworkWorld/
|
||||
[10]: https://www.linkedin.com/company/network-world
|
@ -1,157 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What is IoT? The internet of things explained)
|
||||
[#]: via: (https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html)
|
||||
[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/)
|
||||
|
||||
What is IoT? The internet of things explained
|
||||
======
|
||||
The internet of things (IoT) is a network of connected smart devices providing rich data, but it can also be a security nightmare.
|
||||
Thinkstock
|
||||
|
||||
The internet of things (IoT) is a catch-all term for the growing number of electronics that aren't traditional computing devices, but are connected to the internet to send data, receive instructions or both.
|
||||
|
||||
There's an incredibly broad range of things that fall under that umbrella: Internet-connected "smart" versions of traditional appliances like refrigerators and light bulbs; gadgets that could only exist in an internet-enabled world like Alexa-style digital assistants; internet-enabled sensors that are transforming factories, healthcare, transportation, distribution centers and farms.
|
||||
|
||||
### What is the internet of things?
|
||||
|
||||
The IoT brings the power of the internet, data processing and analytics to the real world of physical objects. For consumers, this means interacting with the global information network without the intermediary of a keyboard and screen; many of their everyday objects and appliances can take instructions from that network with minimal human intervention.
|
||||
|
||||
**[ [More IoT coverage of Network World][1] ]**
|
||||
|
||||
In enterprise settings, IoT can bring the same efficiencies to physical manufacturing and distribution that the internet has long delivered for knowledge work. Millions if not billions of embedded internet-enabled sensors worldwide are providing an incredibly rich set of data that companies can use to gather data about their safety of their operations, track assets and reduce manual processes. Researchers can also use the IoT to gather data about people's preferences and behavior, though that can have serious implications for privacy and security.
|
||||
|
||||
### How big is it?
|
||||
|
||||
In a word: enormous. [Priceonomics breaks it down][2]: There are more than 50 billion IoT devices as of 2020, and those devices will generate 4.4 zettabytes of data this year. (A zettabyte is a trillion gigabytes.) By comparison, in 2013 IoT devices generated a mere 100 billion gigabytes. The amount of money to be made in the IoT market is similarly staggering; estimates on the value of the market in 2025 range from $1.6 trillion to $14.4 trillion.
|
||||
|
||||
### History of IoT
|
||||
|
||||
A world of omnipresent connected devices and sensors is one of the oldest tropes of science fiction. IoT lore has dubbed a [vending machine at Carnegie Mellon][3] that was connected to APRANET in 1970 as the first Internet of Things device, and many technologies have been touted as enabling "smart" IoT-style characteristics to give them a futuristic sheen. But the term Internet of Things was coined in 1999 by British technologist [ Kevin Ashton][4].
|
||||
|
||||
At first, the technology lagged behind the vision. Every internet-connected thing needed a processor and a means to communicate with other things, preferably wirelessly, and those factors imposed costs and power requirements that made widespread IoT rollouts impractical, at least until Moore's Law caught up in the mid '00s.
|
||||
|
||||
One important milestone was [widespread adoption of RFID tags][5], cheap minimalist transponders that could be stuck on any object to connect it to the larger internet world. Omnipresent Wi-Fi and 4G made it possible to for designers to simply assume wireless connectivity anywhere. And the rollout of IPv6 means that connecting billions of gadgets to the internet won't exhaust the store of IP addresses, which was a real concern. (Related story: [Can IoT networking drive adoption of IPv6?][6])
|
||||
|
||||
### How does the IoT work?
|
||||
|
||||
The basic elements of the IoT are devices that gather data. Broadly speaking, they are internet-connected devices, so they each have an IP address. They range in complexity from autonomous vehicles that haul products around factory floors to simple sensors that monitor the temperature in buildings. They also include personal devices like fitness trackers that monitor the number of steps individuals take each day. To make that data useful it needs to be collected, processed, filtered and analyzed, each of which can be handled in a variety of ways.
|
||||
|
||||
Collecting the data is done by transmitting it from the devices to a gathering point. Moving the data can be done wirelessly using a range of technologies or on wired networks. The data can be sent over the internet to a data center or a cloud that has storage and compute power or the transfer can be staged, with intermediary devices aggregating the data before sending it along.
|
||||
|
||||
Processing the data can take place in data centers or cloud, but sometimes that’s not an option. In the case of critical devices such as shutoffs in industrial settings, the delay of sending data from the device to a remote data center is too great. The round-trip time for sending data, processing it, analyzing it and returning instructions (close that valve before the pipes burst) can take too long. In such cases edge-computing can come into play, where a smart edge device can aggregate data, analyze it and fashion responses if necessary, all within relatively close physical distance, thereby reducing delay. Edge devices also have upstream connectivity for sending data to be further processed and stored.
|
||||
|
||||
[][7] Network World / IDG
|
||||
|
||||
How the internet of things works.
|
||||
|
||||
### **Examples of IoT devices**
|
||||
|
||||
Essentially, anything that's capable of gathering some information about the physical world and sending it back home can participate in the IoT ecosystem. Smart home appliances, RFID tags, and industrial sensors are a few examples. These sensors can monitor a range of factors including temperature and pressure in industrial systems, status of critical parts in machinery, patient vital signs, and use of water and electricity, among many, many other possibilities.
|
||||
|
||||
Entire factory robots can be considered IoT devices, as can autonomous vehicles that move products around industrial settings and warehouses.
|
||||
|
||||
Other examples include fitness wearables and home security systems. There are also more generic devices, like the [Raspberry Pi][8] or [Arduino][9], that let you build your own IoT end points. Even though you might think of your smartphone as a pocket-sized computer, it may well also be beaming data about your location and behavior to back-end services in very IoT-like ways.
|
||||
|
||||
#### **Device management**
|
||||
|
||||
In order to work together, all those devices need to be authenticated, provisioned, configured, and monitored, as well as patched and updated as necessary. Too often, all this happens within the context of a single vendor's proprietary systems – or, it doesn't happen at all, which is even more risky. But the industry is starting to transition to a [standards-based device management model][10], which allows IoT devices to interoperate and will ensure that devices aren't orphaned.
|
||||
|
||||
#### **IoT communication standards and protocols**
|
||||
|
||||
When IoT gadgets talk to other devices, they can use a wide variety of communications standards and protocols, many tailored to devices with limited processing capabilities or not much electrical power. Some of these you've definitely heard of — some devices use Wi-Fi or Bluetooth, for instance — but many more are specialized for the world of IoT. ZigBee, for instance, is a wireless protocol for low-power, short-distance communication, while message queuing telemetry transport (MQTT) is a publish/subscribe messaging protocol for devices connected by unreliable or delay-prone networks. (See Network World’s glossary of [IoT standards and protocols][11].)
|
||||
|
||||
The increased speeds and bandwidth of the coming 5G standard for cellular networks will also benefit IoT, though that usage will [lag behind ordinary cell phones][12].
|
||||
|
||||
### IoT, edge computing and the cloud
|
||||
|
||||
[][13] Network World / IDG
|
||||
|
||||
How edge computing enables IoT.
|
||||
|
||||
For many IoT systems, there's a lot of data coming in fast and furious, which has given rise to a new technology category, [edge computing][14]_,_ consisting of appliances placed relatively close to IoT devices, fielding the flow of data from them. These machines process that data and send only relevant material back to a more centralized system for analysis. For instance, imagine a network of dozens of IoT security cameras. Instead of bombarding the building's security operations center (SoC) with simultaneous live-streams, edge-computing systems can analyze the incoming video and only alert the SoC when one of the cameras detects movement.
|
||||
|
||||
And where does that data go once it’s been processed? Well, it might go to your centralized data center, but more often than not it will end up in the cloud.
|
||||
|
||||
The elastic nature of cloud computing is great for IoT scenarios where data might come in intermittently or asynchronously. And many of the big cloud heavy hitters — including [Google][15], [Microsoft][16], and [Amazon][17] — have IoT offerings.
|
||||
|
||||
### IoT platforms
|
||||
|
||||
The cloud giants are trying to sell more than just a place to stash the data your sensors have collected. They're offering full IoT platforms*,* which bundle together much of the functionality to coordinate the elements that make up IoT systems. In essence, an IoT platform serves as middleware that connects the IoT devices and edge gateways with the applications you use to deal with the IoT data. That said, every platform vendor seems to have a slightly different definition of what an IoT platform is, the better to [distance themselves from the competition][18].
|
||||
|
||||
### IoT and data
|
||||
|
||||
As mentioned, there are zettabytes of data being collected by all those IoT devices, funneled through edge gateways, and sent to a platform for processing. In many scenarios, this data is the reason IoT has been deployed in the first place. By collecting information from sensors in the real world, organizations can make nimble decisions in real time.
|
||||
|
||||
Oracle, for instance, [imagines a scenario][19] where people at a theme park are encouraged to download an app that offers information about the park. At the same time, the app sends GPS pings back to the park's management to help predict wait times in lines. With that information, the park can take action in the short term (by adding more staff to increase the capacity of some attractions, for instance) and the long term (by learning which rides are the most and least popular at the park).
|
||||
|
||||
These decisions can be made without human intervention. For example, data gathered from pressure sensors in a chemical-factory pipeline could be analyzed by software in an edge device that spots the threat of a pipeline rupture, and that information can trigger a signal to shut valves to avert a spill.
|
||||
|
||||
### IoT and big data analytics
|
||||
|
||||
The theme park example is easy to get your head around, but is small potatoes compared to many real-world IoT data-harvesting operations. Many big data operations use information harvested from IoT devices, correlated with other data points, to get insight into human behavior. _Software Advice_ gives [a few examples][20], including a service from Birst that matches coffee brewing information collected from internet-connected coffeemakers with social media posts to see if customers are talking about coffee brands online.
|
||||
|
||||
Another dramatic example came recently when X-Mode released a map based on tracking location data of people who partied at spring break in Ft. Lauderdale in March of 2020, even as the coronavirus pandemic was gaining speed in the United States, showing [where all those people ended up across the country][21]. The map was shocking not only because it showed the potential spread of the virus, but also because it illustrated just how closely IoT devices can track us. (For more on IoT and analytics, click [here][22].
|
||||
|
||||
### IoT data and AI
|
||||
|
||||
The volume of data IoT devices can gather is far larger than any human can deal with in a useful way, and certainly not in real time. We've already seen that edge computing devices are needed just to make sense of the raw data coming in from the IoT endpoints. There's also the need to detect and deal with data that might [be just plain wrong][23].
|
||||
|
||||
Many IoT providers are offering machine learning and artificial intelligence capabilities to make sense of the collected data. IBM's Jeopardy!-winning Watson platform, for instance, can be [trained on IoT data sets][24] to produce useful results in the field of predicative maintenance — analyzing data from drones to distinguish between trivial damage to a bridge and cracks that need attention, for instance. Meanwhile, Arm is working on [low-power chips][25] that can provide AI capabilities on the IoT endpoints themselves. ** **
|
||||
|
||||
### IoT and business
|
||||
|
||||
Business uses for IoT include keeping track of customers, inventory, and the status of important components. [IoT for All][26] flags four industries that have been transformed by IoT:
|
||||
|
||||
* **Oil and gas**: Isolated drilling sites can be better monitored with IoT sensors than by human intervention
|
||||
* A**griculture**: Granular data about crops growing in fields derived from IoT sensors can be used to increase yields
|
||||
* **HVAC**: Climate control systems across the country can be monitored by manufacturers
|
||||
* **Brick-and-mortar retail**: Customers can be microtargeted with offers on their phones as they linger in certain parts of a store
|
||||
|
||||
|
||||
|
||||
More generally, enterprises are looking for IoT solutions that can help in [four areas][27]: energy use, asset tracking, security, and the customer experience.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html
|
||||
|
||||
作者:[Josh Fruhlinger][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/Josh-Fruhlinger/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/category/internet-of-things/
|
||||
[2]: https://priceonomics.com/the-iot-data-explosion-how-big-is-the-iot-data/
|
||||
[3]: https://www.machinedesign.com/automation-iiot/article/21836968/iot-started-with-a-vending-machine
|
||||
[4]: https://www.visioncritical.com/blog/kevin-ashton-internet-of-things
|
||||
[5]: https://www.networkworld.com/article/2319384/rfid-readers-route-tag-traffic.html
|
||||
[6]: https://www.networkworld.com/article/3338106/can-iot-networking-drive-adoption-of-ipv6.html
|
||||
[7]: https://images.idgesg.net/images/article/2020/05/nw_how_iot_works_diagram-100840757-orig.jpg
|
||||
[8]: https://www.networkworld.com/article/3176091/10-killer-raspberry-pi-projects-collection-1.html
|
||||
[9]: https://www.networkworld.com/article/3075360/arduino-targets-the-internet-of-things-with-primo-board.html
|
||||
[10]: https://www.networkworld.com/article/3258812/the-future-of-iot-device-management.html
|
||||
[11]: https://www.networkworld.com/article/3235124/internet-of-things-definitions-a-handy-guide-to-essential-iot-terms.html
|
||||
[12]: https://www.networkworld.com/article/3291778/what-s-so-special-about-5g-and-iot.html
|
||||
[13]: https://images.idgesg.net/images/article/2017/09/nw_how_edge_computing_works_diagram_1400x1717-100736111-orig.jpg
|
||||
[14]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html
|
||||
[15]: https://cloud.google.com/solutions/iot
|
||||
[16]: https://azure.microsoft.com/en-us/overview/iot/
|
||||
[17]: https://aws.amazon.com/iot/
|
||||
[18]: https://www.networkworld.com/article/3336166/why-are-iot-platforms-so-darn-confusing.html
|
||||
[19]: https://blogs.oracle.com/bigdata/how-big-data-powers-the-internet-of-things
|
||||
[20]: https://www.softwareadvice.com/resources/iot-data-analytics-use-cases/
|
||||
[21]: https://www.cnn.com/2020/04/04/tech/location-tracking-florida-coronavirus/index.html
|
||||
[22]: https://www.networkworld.com/article/3311919/iot-analytics-guide-what-to-expect-from-internet-of-things-data.html
|
||||
[23]: https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html
|
||||
[24]: https://www.networkworld.com/article/3449243/watson-iot-chief-ai-can-broaden-iot-services.html
|
||||
[25]: https://www.networkworld.com/article/3532094/ai-everywhere-iot-chips-coming-from-arm.html
|
||||
[26]: https://www.iotforall.com/4-unlikely-industries-iot-changing/
|
||||
[27]: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html
|
@ -0,0 +1,92 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (3 lessons from remote meetings we’re taking back to the office)
|
||||
[#]: via: (https://opensource.com/article/20/6/remote-meetings)
|
||||
[#]: author: (Abigail Cabunoc Mayes https://opensource.com/users/abbycabs)
|
||||
|
||||
3 lessons from remote meetings we’re taking back to the office
|
||||
======
|
||||
Some of the ways we're accommodating working at home during the pandemic
|
||||
can make in-real-life meetings better and more inclusive when we get
|
||||
back to the office.
|
||||
![Two people chatting via a video conference app][1]
|
||||
|
||||
For those of us fortunate enough to work remotely during this pandemic, we'll likely be camped out in our home offices for a while yet. The transition back to in-person work will [take time and be geographically patchy][2].
|
||||
|
||||
As I've talked with colleagues who are working remotely, many people say this period is temporary and makeshift: "_Once it's safe to return to the office, we can resume all our old habits and processes_." But in truth, this period of working from home and our eventual return to the office are deeply entwined. The choices and changes we make now will impact the ways we work once we step back into our offices, laboratories, classrooms, and other workspaces.
|
||||
|
||||
Rather than viewing this moment as temporary and makeshift, we should see it as formative. By investing in and improving our online meeting experience _now_, we can build the foundation for a better work environment that persists long after the pandemic. We can use this moment to recalibrate our culture and systems, so they are more robust, resilient, and inclusive. Those of us in scientific fields can use this moment to deliberately shift toward [kinder science][3].
|
||||
|
||||
Meetings are just one example: Rather than trying to recreate in-person meetings online, let's reimagine what remote meetings can be. With online meetings, you have to be intentional about setting up channels through which participants can contribute and take time to make sure that they know how and feel comfortable doing so. We can take this practice back to the office, providing an opportunity to be more inclusive in-person and break power balances (including leadership hierarchy and majority groups) that can keep folks silent.
|
||||
|
||||
Using this difficult moment to build a better work environment may sound overwhelming. But, there's good news: There's no shortage of resources and experiences to draw from. Working remotely feels new to a lot of us, but folks in the open source software world have been working this way and building community online for a long time: Tim O'Reilly has described this as the [architecture of participation][4]. Mozilla has been empowering cohorts of [Open Leaders][5] around the globe for years. And [rOpenSci][6], [RStudio][7], and the [Carpentries][8] have created and support remote, collaborative communities of scientists and coders. We can learn a lot from these communities that have been building relationships and innovating together from afar.
|
||||
|
||||
Ready to get started? Below, we share three principles for empowering remote interactions that we can also carry forward in real life (IRL).
|
||||
|
||||
### Set an inclusive tone
|
||||
|
||||
Remote meetings can easily feel disconnected or unnatural—especially if you're new to meeting online. Start all meetings with a welcome to earn buy-in and participation. For example, schedule time at the very beginning to welcome everyone, announce the meeting goals, and explain how to participate, like how to unmute microphones, use the chat, or write in a shared document. Starting with a quick roll call and icebreaker question during the meeting makes folks less anonymous and encourages participation. Additionally, outline the shared expectations and culture of the meeting by summarizing the code of conduct or community participation guidelines.
|
||||
|
||||
Create a detailed agenda with specific minutes allotted to different topics, including the welcome. The agenda should be shared ahead of time and contain enough structure to allow for productive conversations, but also enough flexibility to allow for fruitful digressions. Agendas can be designed with [POP][9] to clearly state the _purpose_, _outcomes_, and _process_ of the meeting.
|
||||
|
||||
Providing multiple communication channels during the meeting for folks to "speak up" is important not just for introverts but also for underrepresented minorities, students, and early career people, as well as international or multi-lingual participants. If you're using a shared document, writing feedback instead of verbalizing it can save time and also be used for side and asynchronous conversations. Using multiple channels also provides ways to be in touch and catch up if folks join the call late or drop off due to connectivity issues.
|
||||
|
||||
### Provide robust documentation
|
||||
|
||||
People can walk away (or log off) from meetings with different perceptions and expectations. Robust documentation can dispel this ambiguity and keep everyone on the same page.
|
||||
|
||||
Write meeting notes in a document—preferably in the agenda document mentioned above. Use collaborative document software such as Google Docs or an open source alternative like [Etherpad][10] so that folks can take live notes together. Invite and teach participants how to contribute and have them get into the rhythm early on, for example, with a written roll call that also buffers time as folks arrive at the start.
|
||||
|
||||
Encouraging everyone to participate in the document will result in a record of the meeting that is less brittle than anything produced by a single designated note-taker and will include more voices. Folks can contribute in many ways (including adding links, comments, +1's to affirm others' ideas, and emojis to provide quick emotion and color). Further, people can contribute to shared documents live during a meeting or asynchronously before and afterward. These notes can also be shared in many ways after the meeting (email digest, Slack, Twitter, [Mattermost][11], etc.) with different audiences and become more accessible in "post-production" (e.g., captioning, alt-tags on any images shared, etc.).
|
||||
|
||||
### Choose the right tools
|
||||
|
||||
Choosing the appropriate communication channels for meetings and follow-up is important. It also requires time and empathy to make sure everyone knows how to use the technology.
|
||||
|
||||
For virtual meetings, videoconferencing software like [Jitsi][12] allow participants to engage with "faces on." This is a nice norm to set if participants are comfortable, but it is also important to state that it is fine to participate without enabling video for any reason, including bandwidth or privacy issues.
|
||||
|
||||
Providing the opportunity for participants to have smaller conversations through [Big Blue Button][13]'s breakout rooms can be very fruitful for moving ideas forward and strengthening relationships and trust. Having prompts or tasks to center the conversations helps make the best use of time, and scheduling time for summaries once the whole group has reconvened allows more ideas and insights to be shared.
|
||||
|
||||
Using collaborative software for creating presentations can strengthen engagement while reducing bandwidth issues. Asking participants to open the presentation on their computers and advance the slides themselves eliminates the need for screen-sharing—and the bandwidth issues, multiple windows kerfuffling, and passiveness that can arise as a result.
|
||||
|
||||
Being deliberate about the communication platforms outside of meetings is also important. For example, [GitHub Issues][14] might be better for archiving decision-making conversations. And a messaging platform like [Mattermost][15] might be better for quick contact, co-working, and community-building. Whichever platforms you use, take some time to make sure that they meet your team's needs and provide enough control to make them as safe as possible for your participants.
|
||||
|
||||
### Make meetings work online, offline, or both
|
||||
|
||||
When we're in person again, these principles and tips don't become obsolete. They're relevant and critical to a productive, inclusive workplace, whether we're online, offline, or a hybrid of the two. We have led our [Mozilla Open Leaders][16] and [Openscapes Champions][17] programs this way, and we've learned that these approaches can transcend discipline and organization size.
|
||||
|
||||
And while each principle takes time and practice, they're all attainable. We have a big chance here to redesign the way we interact and collaborate, so let's start with intention and kindness.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/remote-meetings
|
||||
|
||||
作者:[Abigail Cabunoc Mayes][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/abbycabs
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chat_video_conference_talk_team.png?itok=t2_7fEH0 (Two people chatting via a video conference app)
|
||||
[2]: https://www.theatlantic.com/health/archive/2020/03/how-will-coronavirus-end/608719/
|
||||
[3]: https://blogs.scientificamerican.com/observations/open-software-means-kinder-science/
|
||||
[4]: http://radar.oreilly.com/2015/03/socialcivics-and-the-architecture-of-participation.html
|
||||
[5]: https://foundation.mozilla.org/en/opportunity/mozilla-open-leaders/
|
||||
[6]: https://ropensci.org/
|
||||
[7]: https://community.rstudio.com/
|
||||
[8]: http://carpentries.org/
|
||||
[9]: https://suzannehawkes.com/2010/04/09/pop-everything/
|
||||
[10]: https://opensource.com/business/15/7/five-open-source-alternatives-google-docs
|
||||
[11]: https://opensource.com/alternatives/slack
|
||||
[12]: https://opensource.com/alternatives/skype
|
||||
[13]: https://opensource.com/article/20/5/open-source-video-conferencing#bigbluebutton
|
||||
[14]: https://openscapes.github.io/series/github-issues.html
|
||||
[15]: https://mattermost.com/
|
||||
[16]: https://foundation.mozilla.org/en/blog/online-meeting-tips/
|
||||
[17]: https://www.openscapes.org/blog/2020/03/11/how-to-run-a-remote-workshop/
|
@ -0,0 +1,77 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (3 reasons to contribute to open source now)
|
||||
[#]: via: (https://opensource.com/article/20/6/why-contribute-open-source)
|
||||
[#]: author: (Jason Blais https://opensource.com/users/jasonblais)
|
||||
|
||||
3 reasons to contribute to open source now
|
||||
======
|
||||
Now, more than ever, is the ideal time to contribute to open source.
|
||||
Here’s why.
|
||||
![Business woman on laptop sitting in front of window][1]
|
||||
|
||||
Open source software has [taken over the world][2]. From the early days of Linux and MySQL, open source is driving innovation like never before, with more than [180,000 public repositories on GitHub][3] alone.
|
||||
|
||||
For those of you who have not yet ventured into the open source world, here are the three reasons to start today.
|
||||
|
||||
### Build your confidence as a developer
|
||||
|
||||
If you're young, early in your career, or are even just learning a new programming language, open source is the best way to get started.
|
||||
|
||||
By contributing to an open source project, you receive immediate feedback on your development and programming skills. You may get suggestions about the choice of a function name, the way you used conditional logic, or how using a goroutine you didn't know about speeds up the execution of your program. This is all invaluable feedback to receive when you're learning something new.
|
||||
|
||||
Moreover, as you create more pull requests and apply what you learned from previous submissions, you begin to learn how to write good code and [submit great pull requests for code review][4]. Finally, many open source projects offer mentorship programs to help guide you through your first few contributions. It is a very welcoming, safe environment to build your confidence as a developer.
|
||||
|
||||
For an example story, read about [Allan Guwatudde's experience in open source][5] as a self-taught developer.
|
||||
|
||||
### Build your resume or CV
|
||||
|
||||
Even if you're a seasoned developer, you may want to build your resume to help with career development and future job searches. Perhaps you're interested in exploring a new cutting-edge framework or a new programming module, and you don't have opportunities to do either at work.
|
||||
|
||||
You may be able to get experience by registering for a course or finding a way to introduce these concepts at your day job. But when those options are not available (or desirable), open source provides the perfect opportunity! In addition to building your skills and increasing your confidence, all of your open source contributions are public and demonstrate the skills you have mastered and the projects you've tackled. In fact, your open source profile by itself could provide you with a strong portfolio that sets you apart from other job candidates.
|
||||
|
||||
Moreover, many open source projects—[such as Mattermost][6]—allow you to add yourself as a Contributor on LinkedIn to directly promote your professional profile.
|
||||
|
||||
[Read about Siyuan Liu's journey][7] from the first open source contribution to becoming a two-time MVP of the Mattermost project.
|
||||
|
||||
### Build your professional network
|
||||
|
||||
Building a strong professional network can help you achieve your career goals, learn more about your own or adjacent fields, and help with a job search. Contributing to open source is an excellent way to build that network. You join a welcoming community of hundreds or thousands of contributors, interact with likeminded developers in the open source space, and build connections along the way. You might even get introduced to key people in the industry, like the maintainer of a high-profile open source tool. Such relationships can turn into career-changing connections.
|
||||
|
||||
Finally, contributing to an open source project may even land you a job! For example, [Mattermost][8] has hired several contributors from its open source community to work full-time on the engineering team.
|
||||
|
||||
### Start contributing to open source today
|
||||
|
||||
Open source empowers you to build your confidence as a developer, build your resume, and build your professional network. Moreover, your contribution—no matter how big or small—makes a direct impact on the future of the open source project. That's why many projects send gifts as a thank you to contributors (e.g., a [customized mug to all first-time contributors][9]).
|
||||
|
||||
Ready to get started with open source? Check out [these open source projects][10] for first-time open source contributions or find out [how to contribute to Mattermost][11] to get started.
|
||||
|
||||
You don't need to be a master coder to contribute to open source. Jade Wang shares 8 ways you can...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/why-contribute-open-source
|
||||
|
||||
作者:[Jason Blais][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/jasonblais
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
|
||||
[2]: https://techcrunch.com/2019/01/12/how-open-source-software-took-over-the-world/
|
||||
[3]: https://github.com/search?q=stars%3A%3E100&s=stars&type=Repositories
|
||||
[4]: https://mattermost.com/blog/submitting-great-prs/
|
||||
[5]: https://mattermost.com/blog/building-confidence-and-gaining-experience-with-good-open-source-projects/
|
||||
[6]: https://docs.mattermost.com/overview/faq.html#can-contributors-add-themselves-to-the-mattermost-company-page-on-linkedin
|
||||
[7]: https://mattermost.com/blog/open-source-contributor-journey-with-mattermost/
|
||||
[8]: https://mattermost.com/careers/
|
||||
[9]: https://forum.mattermost.org/t/limited-edition-mattermost-mugs/143
|
||||
[10]: https://firstcontributions.github.io/
|
||||
[11]: http://mattermost.com/contribute
|
@ -0,0 +1,97 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Introducing the Open Management Practices)
|
||||
[#]: via: (https://opensource.com/open-organization/20/6/open-management-practices)
|
||||
[#]: author: (Heidi Hess von Ludewig https://opensource.com/users/heidi-hess-von-ludewig)
|
||||
|
||||
Introducing the Open Management Practices
|
||||
======
|
||||
What does great management look like in an open organization? DeLisa
|
||||
Alexander of Red Hat explains a new, open resource that paints one
|
||||
vision.
|
||||
![Media ladder][1]
|
||||
|
||||
For the second article in this series on [Managing with Open Values][2], I spoke with DeLisa Alexander, Executive Vice President and Chief People Officer at Red Hat, specifically about how managing with open values works in that organization. DeLisa's team recently created and open sourced a new resource—[the Open Management Practices][3]—to help Red Hat managers understand their roles in an open organization and to empower Red Hat associates to help those managers practice openness.
|
||||
|
||||
I spoke with DeLisa, a 19-year veteran of Red Hat, about what led to the creation of the practices, how she and her team developed them, and how the organization plans to integrate them into its manager competencies. DeLisa came to Red Hat with a legal background and began her career at the company as inside counsel. The legal field is very hierarchical and not too open in its values (due in part to the confidentiality required of counsel). In our interview, DeLisa explains how, over the course of her career, she's been able to grow and guide the development of Red Hat's "bottom-up" organization.
|
||||
|
||||
I've transcribed parts of our interview below and edited them for readability.
|
||||
|
||||
* * *
|
||||
|
||||
**Heidi:** This interview series is about "managing with open values," and one of the first questions we've been asking interviewees is: What does that mean to you, to "manage according to open values"? As the executive overseeing the People team at Red Hat, why is this issue important to you?
|
||||
|
||||
**DeLisa:** Red Hat started as a movement, in part because of the internet and the connected, democratic nature the technology brought with it. Red Hat hired top contributors of open source communities, which meant that these associates, now hired into decision making roles, were "infused with open"—they lead like community members, not conventional executives. The expectation was that the culture supported collaboration, participation, and community—the values of the open source community. They brought the culture with them, in other words. Upholding and catalyzing this culture via the body of community members into a profitable company is very important, and very different from proprietary software companies.
|
||||
|
||||
**Heidi:** That's so interesting, because as a relatively new Red Hatter I didn't really see that connection as clearly as you explain it. Now I can better understand the passion that a movement started while intersecting with a corporate culture.
|
||||
|
||||
**DeLisa:** Yes. Having come from the law I felt the same way, and it took me a while to realize how it worked and what the expectations were.
|
||||
|
||||
As I navigated my way in the open source community culture, we started to see that those who were not coming from Red Hat communities didn't know how to navigate this new culture. So, we created the [Open Decision Framework][4] (ODF) to help them grow and align to Red Hat values.
|
||||
|
||||
Associates and leaders with decision making responsibilities needed to understand and practice open source practices because our culture is so important. In addition, when you use the ODF, you get better and more creative decisions—that might take longer to get, but then you don't have the change management, like at other companies, after the fact. The transparency offered by the framework aligned with the cultural expectations of the community. When people don't get what they expect, that's when things blow up. So the ODF helps associates and leaders navigate working and decision making in the Red Hat community in ways they expect.
|
||||
|
||||
**Heidi:** So Red Hat is essentially an open source community culture _at scale_.
|
||||
|
||||
**DeLisa:** Yes. Over time, we have had to develop and grow in ways that are consistent with our values. We've created tools and had projects that used open tools to do that. For example, [when we created our "Why,"][5] our shared purpose, the proposed plan was going to take a year before it opened to the associates. The focus of the proposal was on the leaders coming up with it in a closed room—which wouldn't work at Red Hat. But we decide to involve the associates and do the change management synchronously with the activity. The power of participation will create something amazing (when it's important to do) for Red Hat, but you have to take it on faith, and you don't know when it's going to be done. The iterative process means that project plans are less defined and you have to trust: when it's baked, it's baked. You have to lean into the instinct that you will know when it's baked.
|
||||
|
||||
**Heidi:** From my own experience, I can see and feel that, from the associate perspective, there are large gains by being able to participate. But what are the benefits to the managers themselves when they manage with open values?
|
||||
|
||||
**DeLisa:** One of the most important values of open source community members is that they want to contribute right away; there is a meritocracy where title doesn't matter. That's important and that's also what Millennials expect for themselves. Millennials are working this way now. That means that managers at Red Hat had to learn how to manage Millennial-like people 20 years before Millennials came into the workforce! There is a significant advantage in that, because it helps to create a highly engaged workforce where people have a part in making a great team and a great organization. Managers also develop associate capabilities: their skill, their understanding of context, and purpose. Managers are helping "develop these muscles' [in their associates] while creating a learning zone at the same time.
|
||||
|
||||
Listen to DeLisa describe the importance and benefits of managing with open values
|
||||
|
||||
**Heidi:** In this way, managers are creating their own succession plans, because there isn't an us/them context that some conventional organizations have about leadership. In my experience working at conventional organizations, there is a distinct disjointedness between leaders and associates—either you are In the club, or you are not. Where there are open values, leaders and associates are one and the same, or at least the boundary is less distinct.
|
||||
|
||||
**DeLisa:** When I took this job, everyone was a leader. You might be a manager, a _role_ that manages people, but everyone was expected to be a leader. We have tried to carefully define "leader" so that we don't lose the concept and impact the meritocracy.
|
||||
|
||||
**Heidi:** We've talked a little bit about the growth of Red Hat, and I wonder how you and your team have scaled the role of manager, and managing with open values, across the large and growing organization. What does it look like and what strategies are you working on?
|
||||
|
||||
**DeLisa:** As you know, things always look and work a little differently at Red Hat. [Our competency model][6], for instance, helps people know what good looks like in their roles, and then we created the Open Decision Framework to help leaders make decisions in an open way. But we found that managers didn't understand what was expected of them in an open organization. Some brought with them ways of working from their former companies. And yet, as a people manager, they are a key leverage point for Red Hat, essentially responsible for supporting talent. The experience of the associate is greatly influenced by their manager and when you don't have managers who don't manage with open values, then the associates are not getting the full experience of working at an open organization.
|
||||
|
||||
We started at the beginning, asking ourselves ["If everyone is a leader, do we even need people managers?"][7] And we decided we needed the manager role. There are too many operationalization points regarding hiring, development, performance, etc. Our next step was the practices (do's and don'ts) and mindsets for managers. The Do's and Don'ts were communicated to Red Hat as a whole to get feedback, including all the geos, using a global face-to-face tour. These became the six Open Management Practices.
|
||||
|
||||
**Heidi:** Of the six Open Management Practices, which do you feel is most important?
|
||||
|
||||
**DeLIsa:** Probably the one that is most important to us today is "Creating an environment of respect, belonging, and mutual support." It is foundational for meritocracy and the idea that people can contribute even if their style of thinking, language, or remote work are differences. People need to feel like they belong because every associate has to feel comfortable contributing at our very, very best. This is on my mind all the time because there is a lot of research about it, one book for instance is _The Fearless Organization_ by [Amy C. Edmonson][8]. Meritocracy is not just "being nice." It is linked to the learning organization—fail fast and often— and this is how the world's problems are getting solved these days.
|
||||
|
||||
**Heidi:** So we've talked about how the Open Management Practices benefit both associates and managers, and I'm curious about the topic of accountability. How is Red Hat helping to make managers and associates accountable for using these practices?
|
||||
|
||||
**DeLisa:** That's a great question and a hotly debated topic within my team. Part of the genesis for the Open Management Practices was to create accountability between associates and managers. We asked ourselves "how can we help people to want to be accountable?" We can't legislate this. These practices can't be done "because the People team told me to." We need to inspire ownership, so we made the idea of ownership part of the workshop conversation. The tool helps build a competence—"what good looks like"—by defining the practice. So, the People team asked managers, "Once you are enabled, would you be committed to these practices?" and 97% said "yes"! Therefore, we focused on enabling them knowing that the ownership and accountability would follow.
|
||||
|
||||
Listen to DeLisa describe how managers and associates co-created the Open Management Practices
|
||||
|
||||
In addition, the No. 1 request in the workshop was for a 360-degree feedback mechanism. We are excited to partner with TILT365 [Red Hat's vendor for personality style testing] to create a multi-factor survey that helped identify a questionnaire for management feedback. This makes the whole model and process very transparent. Associates know what the do's and don'ts for management practices are, and managers have feedback; leaders can support development plans for their managers. All this creates a full, virtuous cycle because the Open Management Practices created a path for managers to commit to their own development.
|
||||
|
||||
Listen to DeLisa describe how managing openly can increase commitment and accountability
|
||||
|
||||
**Heidi:** That's really interesting! I can see how the definition of the practices helped people understand what they were committing to, and the workshops and using the Open Decision Framework to get feedback from Red Hatters at all levels, helped to create the commitment needed in a natural way, as an obvious extension of the activity.
|
||||
|
||||
DeLisa, thank you for your time! I appreciate your taking the time to speak with me today.
|
||||
|
||||
**DeLisa:** I appreciate it, your time, and your interest in this! Thank you for having me.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/open-organization/20/6/open-management-practices
|
||||
|
||||
作者:[Heidi Hess von Ludewig][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/heidi-hess-von-ludewig
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_meritladder.png?itok=eWIDxnh2 (Media ladder)
|
||||
[2]: https://opensource.com/open-organization/20/5/commitment-engagement-org-psychology
|
||||
[3]: https://github.com/red-hat-people-team/open-management-practices
|
||||
[4]: https://opensource.com/open-organization/resources/open-decision-framework
|
||||
[5]: https://opensource.com/open-organization/17/9/rediscovering-your-why
|
||||
[6]: https://github.com/red-hat-people-team/red-hat-multiplier
|
||||
[7]: https://opensource.com/open-organization/18/10/understanding-engagement-empowerment
|
||||
[8]: https://www.hbs.edu/faculty/Pages/profile.aspx?facId=6451
|
113
sources/talk/20200614 Who is the glue person on your team.md
Normal file
113
sources/talk/20200614 Who is the glue person on your team.md
Normal file
@ -0,0 +1,113 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Who is the glue person on your team?)
|
||||
[#]: via: (https://opensource.com/open-organization/20/6/glue-person)
|
||||
[#]: author: (Lauri Apple https://opensource.com/users/lapple)
|
||||
|
||||
Who is the glue person on your team?
|
||||
======
|
||||
How to identify and utilize the role of a clear-headed, storyteller on
|
||||
your team.
|
||||
![Business woman on laptop sitting in front of window][1]
|
||||
|
||||
Here's a test: how long do you think it would take for your organization to kickstart a brand new effort? A few days? A week?
|
||||
|
||||
How ready would your teams be—do they already know how to roadmap, align, prioritize, and coordinate with each other?
|
||||
|
||||
Are your teams successfully ending any wasteful activities? These might include running unused AWS stacks, building the same thing twice, or consistently preferring tactical, localized optimizations over strategically collaborating with other teams.
|
||||
|
||||
If your organization has such activities in motion, you're probably on the right track. If not, that's a warning signal that your team is lacking some core capabilities you'll need for successfully launching any new endeavor, pandemic or not.
|
||||
|
||||
Does your organization allow your [glue people][2] to develop those core capabilities, or are you pressuring them to stay in their boxes?
|
||||
|
||||
### Zombie scrum, velocity counters, clipboard dogmatists, and other occupational hazards
|
||||
|
||||
Not long ago, on a lark, I interviewed for some freelance project management work with a US-based company. The experience was bizarre. The recruiter, who expressed all the enthusiasm of a bowl of cold pea soup, asked me to do tasks that require much more time and context than what was allotted, even to achieve the goals at a mediocre level. I was penalized for stating that I have never seen scrum by the book—aka [zombie scrum][3]—succeed in any organization. And I was somewhat scolded for asking analytical questions that, in my experience, are critical to driving focus and clarity.
|
||||
|
||||
I didn't get passed to the next stage of the process, in part because the recruiter said my zombie scrum comment was a red flag. I took that as a compliment. But I also felt sorry for any project manager—or scrum master, agile coach, or any other creative person—who's made to apply cookie-cutter solutions to situations that require listening, empathy, and creativity. "Follow the book" is a simplistic, anti-intellectual way to crush innovation and generates stereotypes about professionals whose valuable work aims to glue teams, departments, and narratives together.
|
||||
|
||||
Countless books, articles, and tweets from frustrated agile practitioners have been written about the tendency of many companies to pick an agile framework and force it to stick. A well-meaning company picks scrum, then instantly gets dogmatic about it and hires a bunch of scrum masters to hold the required ceremonies. In this environment, it's easy for the scrum masters to tie their competence to existing certifications instead of growing and expanding their skills into areas like psychology or conflict resolution. The company then puts a bunch of additional requirements on top of their framework of choice—checklists, team working agreements that look a certain way, mandatory JIRA fields separating "internal work" from "external work" (whatever that means).
|
||||
|
||||
Maybe this stuff works somewhere? I have never seen it.
|
||||
|
||||
There's never a good time to pressure your people to dumb down process and now is especially not a good time. Your organization needs even more of what makes a highly effective glue-person:
|
||||
|
||||
* Pragmatism
|
||||
* Objectivity and a habit of identifying assumptions
|
||||
* Communication skills, which most tech companies struggle with even in calm times
|
||||
* Good listening skills
|
||||
* Pattern detection
|
||||
* Research skills
|
||||
* Neutrality and diplomacy
|
||||
* Strategic mindset over tactical, quick-fix, trees-for-the-forest thinking
|
||||
|
||||
|
||||
|
||||
If you're not supporting your team in valuing and encouraging these attributes in your people—regardless of whether their job title includes "agile" or not—please start now.
|
||||
|
||||
Of course, some people who take on "agile practitioner" roles actually prefer to be dogmatists, by-the-book folks, and bug counters. In that case, you have two options: either see if they're willing to explore different approaches to their work, or, if they're not, explore other people.
|
||||
|
||||
### Know your PMO
|
||||
|
||||
If you hear teams grumble that your project management office (PMO) is a bunch of non-technical clipboard people who block progress, challenge those biases. Maybe your PMO really is ineffective; some are. But maybe there's a different issue at work—either micromanaging on their part or lack of accountability on the rest of the organization's part.
|
||||
|
||||
A friend described to me a situation in which the two engineering executives in their company constantly complained about the PMO, for reasons that were never clear. What was clear was that the engineering executives did not value transparency or accountability. Meanwhile, my friend stated that many people in the company swore that without the PMO, nothing would have gotten done within any reasonable amount of time. After a leadership change, the engineering executives were replaced; the PMO remained.
|
||||
|
||||
If the issue is with the PMO, consider coaching the team to be more effective. This can be done through a retrospective or, if you have time, one-on-ones. I have been lucky enough to work in three organizations with high-performing PMO organizations. They framed conversations with teams to similarly focus on goals and broader developments taking place around them. They were empathetic—trying to understand why programs lagged behind, instead of blaming or nagging. They were focused on producing value—aligning teams, making work transparent, keeping meetings well-organized and constructive, and asking pragmatic questions that averted disasters or surfaced gaps in strategy.
|
||||
|
||||
Instead of checking in to see if people were doing their work, they helped teams find out ways to help each other. In many cases, they helped drive knowledge exchange to cross-pollinate new ideas and solutions either by running effective meetings or hosting dedicated conversations.
|
||||
|
||||
If the issue is with your organization, work with the PMO to see how your leadership team can become better advocates for PMO work. Sometimes the issue for PMOs is a lack of public relations and reputation management. Sadly, PMOs can become the canvases upon which disgruntled parties project everything they're mad about, and this really isn't helpful to anyone. Neither are out-of-the-box expectations that PMOs can solve product strategy problems when product managers abdicate responsibility, or solve your technical architecture, or resolve every conflict between two engineers. Your organization might simply be misapplying your PMO power in ways that reinforce existing biases or misunderstandings of their work. Find ways to stop that.
|
||||
|
||||
As a PMO of one person, I work closely with stakeholders across my organization to break down complexity, clarify outcomes, and track work-in-progress through lightweight visualizations. It's all storytelling. I work closely with our agile coaching team, laying the groundwork with delivery teams to form a coherent vision for what to build, then collaborating with the coaches to work with specific teams to boost performance and ensure better flow on that vision. It's not wizardry, and I've recycled it from what other successful PMOs have shown and taught me over the years. It seems to work.
|
||||
|
||||
### Give your agile coaches and scrum masters meaningful metrics
|
||||
|
||||
"I thought agile coaches just measured velocity and story points, and scrum masters do the same but also keep JIRA updated," more than one person on earth has said. How did they reach this conclusion? Possibly by working in an organization that asked coaches and scrum masters to focus on output instead of value. Maybe those organizations didn't expect or even care if the coaches demonstrated their effectiveness; the coaches and scrum masters were there to serve a purpose, like security blankets of agility.
|
||||
|
||||
Story points and velocity are worthless metrics if the work delivered isn't valuable. So is counting the number of retrospectives, or counting the decline in the number of bugs per team (easily gamed), or the amount of time spent pair programming. These metrics do not necessarily tell a coherent story about your organization, and they do not help the coaches and scrum masters grow.
|
||||
|
||||
I like [this list of agile coach metrics by Andy Sio][4]: measure impact by looking for evidence of efficiency, or reducing meetings, or collecting data points around teams using coaches' suggestions to make improvements. For the scrum masters, Ryan Ripley invites leaders to [rethink the role][5] as one of service, challenging the status quo. Find someone else to update the JIRAs and take the notes.
|
||||
|
||||
Maybe you're cool with empowering coaches and scrum masters, but now you're asking, "we have product managers and business analysts—why do we need coaches to do this?" Because dysfunction in delivery is usually systemic. It's about a confluence of discussions, decisions, communications, and other bits and pieces of work going awry, slowly at first, until it all adds up to become A Bigger Problem.
|
||||
|
||||
A coach can help your product managers, analysts, and devs surface those Bigger Problems, understand the root causes, and find more effective alternatives to right the ship. If urgent enough, this can mean the difference between success and failure. For example:
|
||||
|
||||
* How effective can a scrum master assigned to two or three teams possibly be if those teams are facing a constant barrage of "this is urgent!" work chucked in from the leadership team?
|
||||
* How can a team align with other teams, if those teams aren't sharing roadmaps?
|
||||
* How can engineering and product remain aligned if there are two competing roadmaps?
|
||||
* If you're facing Coronavirus, will your product managers, devs, and analysts have time to unpack all of this systemic dysfunction, or could they use a little help?
|
||||
|
||||
|
||||
|
||||
Identify the "glue people" in your organization and find ways to leverage them through focused programs dedicated to one or two outcomes at most. Consider forming a "community of practice," an informal setting (Lean Coffee or other formats) for them to share best practices or highlight and resolve process-related needs in the organization.
|
||||
|
||||
If your glue people are already overwhelmed, consider hiring more of them. This might sound counterintuitive if you're laying people off, but what costs more—hiring one program manager to do the job well, or having ten developers and product managers do the job with less focus, while not doing their usual jobs?
|
||||
|
||||
Hopefully, you're able to identify the people in your organization who can connect the dots, tell your story, and bring everyone together. Maybe you've even hired people specifically to mind your processes and haven't laid them off yet. Please don't! They might save you and everyone else in your company. But only if you empower them.
|
||||
|
||||
If you're starting something from scratch, support your glue people in keeping everyone else from losing the plot. Then you build a culture of maintaining the plot. It's easier to iterate and improve upon such a culture when it's the foundation of your new initiative or product than to force it after developing lots of antipatterns and worst-practice habits. Sure, incremental change can bring teams and organizations back on track—but why tolerate being off-track in the first place? "Going faster at the beginning" isn't a good reason; you can go super-fast and be experimental and still hold your team together.
|
||||
|
||||
Process can be simple and lightweight—in fact, it should be. But it can't be solved simply by putting some meetings in a calendar and writing everything down in Confluence. It has to be customized and curated, created to achieve and sustain flow, and designed to be adapted depending on what's necessary. Otherwise, it will be an obstacle and a waste of time instead of an aid, and people will hate it. And it probably won't come from following scrum by the book, or anything by the book.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/open-organization/20/6/glue-person
|
||||
|
||||
作者:[Lauri Apple][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/lapple
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
|
||||
[2]: https://opensource.com/open-organization/20/6/glue-team
|
||||
[3]: https://www.scrum.org/resources/blog/zombie-scrum-symptoms-causes-and-treatment?gclid=EAIaIQobChMI97Cr6v-96QIVFO3tCh25RgrWEAAYASAAEgIgYfD_BwE
|
||||
[4]: https://www.strategicquadrant.com/blog/how-to-measure-your-successas-an-agile-coach/
|
||||
[5]: https://enterprisersproject.com/article/2020/4/scrum-master-role-how-rethink
|
@ -0,0 +1,164 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Changing the world with open source: GNOME president shares her story)
|
||||
[#]: via: (https://opensource.com/article/20/6/nuritzi-sanchez-interview)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
Changing the world with open source: GNOME president shares her story
|
||||
======
|
||||
GitLab's new senior open source program manager and founding team member
|
||||
of Endless OS shares her vision for using open source to improve
|
||||
society.
|
||||
![Globe up in the clouds][1]
|
||||
|
||||
Growing up in Silicon Valley, [Nuritzi Sanchez][2] saw the powerful impact software can make on the world. Yet, unlike many others who were also steeped in the tech industry, her journey has taken her into the world of open source, where she is contributing to that impact.
|
||||
|
||||
After graduating from Stanford University with a degree in International Relations, she ****became a founding team member of open source computing company [Endless OS][3], served three terms as president and chair of GNOME's board of directors, and in February 2020 was hired as the senior open source program manager (OSPM) at GitLab.
|
||||
|
||||
I am impressed by this talented woman, and I reached out to her to learn more about her and her work. I believe you will also be fascinated with her journey after reading our interview, which has been lightly edited for clarity.
|
||||
|
||||
**Don Watkins:** How did you get started with open source?
|
||||
|
||||
**Nuritzi Sanchez**: My first experience with open source software was using an Ubuntu-based computer at an immigration law clinic when I was interning there as an undergrad. I remember being really surprised that something other than Macs and Windows existed. I had a good experience using the Ubuntu machine.
|
||||
|
||||
Later, in 2012, I helped start a company called [Endless][4] that aimed to make computing universally accessible. By leveraging the power of open source software, we wanted to create computers that were great for users that had little to no access to the internet or were new to computers.
|
||||
|
||||
As I deep-dived into that world, I was amazed by how vast the open source application ecosystem is. In my college years, I had become an Apple fangirl, and I immediately noticed the difference in user experience and design. Thanks to the CEO and founder's strong interest in great design, Endless was created from the beginning to delight users. Our team hoped to bring more user-centered design to the Linux desktop world.
|
||||
|
||||
![GUADEC 2015 newcomers' event][5]
|
||||
|
||||
GUADEC 2015 newcomers' event (Nuritzi Sanchez, [CC BY-SA 4.0][6])
|
||||
|
||||
In 2015, I gave my first talk at [GUADEC][7] (the GNOME community's largest conference) about [adapting GNOME for the developing world][8]. I didn't know what to expect going into the conference since that was the first time I'd attended an open source software event, and I was incredibly impressed with how friendly and welcoming the GNOME community was. The newcomers' and social events helped me bond with the existing community, and when I attended a Birds of a Feather (BoF) session, I noticed that my project management and leadership skillset was immediately useful. Even though I was new to the community and was not an engineer, I felt like I could immediately contribute. I wished I had known about GNOME and the open source world years before!
|
||||
|
||||
**DW:** What is the power of open source for you?
|
||||
|
||||
**NS**: Open source software helps democratize the world and enables us to solve the challenges we know best. You can build on top of the work that others have done in order to solve unique challenges around you instead of having to recreate something completely from scratch. It thus spurs innovation.
|
||||
|
||||
Since a lot of open source software is not only free as in philosophy but also free as in price, it also gives people who may not otherwise be able to afford it access to tools that are essential to be part of the modern workforce.
|
||||
|
||||
**DW:** How did your family background drive your interest in open source?
|
||||
|
||||
**NS**: My parents are from Mexico, and when we visited family there, I was struck by the differences between where I was growing up, in the Silicon Valley, and where my parents were from. Sometimes we would visit towns where people had cardboard instead of windows, elderly people were sitting in the heat trying to sell artisanal goods they made, and poverty was visible in every corner. I heard heartbreaking stories about the struggles that people were facing, and as an empathetic kid, that all greatly impacted me. I wanted to do something to help.
|
||||
|
||||
During my undergraduate years at Stanford, I really struggled to find just one thing that I was interested in. I was drawn to social impact initiatives, but I wanted to help people be healthier, have access to great education, find jobs, and feel fulfilled. I basically wanted to do _all the things_. This led me to explore many potential career paths through internships.
|
||||
|
||||
Unsurprisingly for someone who grew up in the Valley, I ended up believing that getting involved with software was the best way for me to make a huge impact. I saw how just a small team could create software that was used by millions of people and could impact their lives. It seemed like a superpower. I then became enamored with open source software because of all the reasons I've mentioned above. As a bonus, open source software usually already has an international community, and as I've gotten more involved, I've been keen on helping to expand its reach.
|
||||
|
||||
**DW: How has your involvement with Endless shaped your vision and direction?**
|
||||
|
||||
**NS:** One of the things that I loved about Endless is how much the team valued getting to know its users. Every employee was able to go to one of Endless' target markets and do in-field research. We were able to meet people whose lives we were actually being impacted by our work.
|
||||
|
||||
My time at Endless allowed me to travel and become immersed in different cultures to an extent that I wouldn't have had otherwise. I sometimes spent several months in a target market when I was helping with special initiatives. I met people from the international open source community who are extremely dedicated to the open source philosophy—and I also learned more about the challenges they face when contributing.
|
||||
|
||||
![Endless OS user testing in Guatemala][9]
|
||||
|
||||
Endless OS user testing in Guatemala (Nuritzi Sanchez, [CC BY-SA 4.0][6])
|
||||
|
||||
The other theme is the importance of user-centered design. I'm very grateful to have been part of a team with extremely talented designers and executives that believed that great design was essential. Our COO attended the [Stanford d.school][10] and helped infuse the company with an appreciation for design thinking. Similarly, our CEO had a sharp eye for things being pixel-perfect and always challenged our designers to create beautiful software. I developed a certain aesthetic and a deep appreciation of the design process. My time at Endless helped me appreciate some of the unique challenges that designers face when trying to contribute to open source software.
|
||||
|
||||
**DW:** Diversity and inclusion are really important to you. How does diversity improve products and communities?
|
||||
|
||||
**NS**: Diversity of thought is something incredibly important when solving any kind of challenge. In order to do that, you need to bring in people from diverse backgrounds. New perspectives often bring new insights or new ideas into the mix.
|
||||
|
||||
One of the tangible examples I have from my time at Endless is when we were working in Indonesia and wanted to do user research there to better understand the market. One of our Endless Ambassadors, Siska, belonged to a group of housewives that met regularly, and she introduced Endless at one of their meetings. Many of the housewives who attended got really excited about Endless and told their partners and children about it. Being great networkers, some of them helped us find people for our user research studies and became evangelists of our product in their communities. It was something that, at least to me, wasn't a normal path to take, and it was something that was hugely beneficial.
|
||||
|
||||
![Meeting with open source community members in Indonesia][11]
|
||||
|
||||
Meeting with open source community members in Indonesia (Nuritzi Sanchez, [CC BY-SA 4.0][6])
|
||||
|
||||
**DW:** What led you to leave Endless and move to GNOME?
|
||||
|
||||
**NS**: Endless did a lot of things right, and it still faced a lot of the challenges that all open source desktops face in a world that is [dominated][12] by Microsoft. Endless had to make some hard choices about how to evolve its strategy and also started to explore some new ideas—like how to make Endless a great platform to teach children how to code. It was during this time that we parted ways, but I continue to be a huge fan and still use Endless OS on my personal computer.
|
||||
|
||||
I ended up taking some time off after Endless to travel and to continue my third term as the president and chairperson of the board of directors at GNOME.
|
||||
|
||||
![Women Who Code Taipei event][13]
|
||||
|
||||
Meeting with Women Who Code Taipei (Nuritzi Sanchez, [CC BY-SA 4.0][6])
|
||||
|
||||
**DW:** GNOME experienced tremendous growth during your tenure. What do you attribute that to?
|
||||
|
||||
**NS**: There were many things that factored into the growth we saw during my tenure. Here are the most important ones:
|
||||
|
||||
* **Improving the newcomer's story:** Carlos Soriano, Bastian Ilso, and Christian Hergert, in particular, really helped set GNOME's momentum in motion by working on a newcomer's guide for code contributors. They developed the workflows and tools that made an immediate impact on our community's growth. Later, Carlos led an evaluation of tooling and helped GNOME find GitLab as the solution to further simplifying the contribution process.
|
||||
|
||||
* **Broadcasting our story and promoting our brand:** As part of the Engagement team, I helped to amplify our work on the newcomers initiatives and helped to build our brand and online presence. GNOME's work on improving the newcomers' story gained a lot of interest within the wider community and brought about new interest in the GNOME project, and we used that to help build the sense that GNOME was in forward momentum. Marketing, brand, and dedicated community-building are really important for open source organizations.
|
||||
|
||||
* [**Flatpak**][14]**,** [**Flathub**][15]**, and** [**Builder**][16]**!** There were several technological innovations that helped propel GNOME forward. For example, Flatpak and Builder helped to make creating a GNOME app easier than ever, and users were able to find and install apps directly from Flathub. These innovations were _huge_ because they made it possible for anyone to create and enjoy great Linux desktops. Furthermore, it helped unify the Linux desktop community a bit since any distribution that enabled Flatpak apps could benefit from easier distribution and management of apps.
|
||||
|
||||
* **Hiring an** **executive** **director (ED):** GNOME had been without an ED for several years before I joined. With the help of a hiring committee, the board soon interviewed several highly qualified candidates for the ED position. Leveraging my startup experience in hiring, I worked with our vice president at the time to figure out all the logistics behind hiring our first-ever non-US employee and closing the loop. We soon announced that Neil McGovern would join as the GNOME executive director. This was an important step for us since the board had absorbed the ED's responsibilities while the position was unfilled. Since the board was elected annually, that meant that planning long-term, strategic initiatives was rather difficult because of turnover.
|
||||
|
||||
* **Dreaming new dreams:** While I'm biased, I do think that Endless' new perspective helped the GNOME community to dream a new dream and start creating GNOME for a user beyond the "typical Linux desktop user." This meant working on features that enabled a less tech-savvy, more design-sensitive, and less-connected user. Since Endless worked heavily upstream, GNOME experienced an influx of contributors from Endless' employees and Endless' ecosystem. This, combined with the newcomers' story, helped propel GNOME into an era of being more accessible to more people around the world. This also helped attract donations from organizations, including a $1 million pledge that helped GNOME dream new dreams. As part of that, the board decided that expanding the GNOME Foundation would help sustain GNOME's momentum and that employees would be hired for the first time ever to work directly on aspects of the project, like on GTK and event planning.
|
||||
|
||||
* **Restructuring the** **GNOME** **Foundation:** One of my short-term goals upon hiring our executive director was leading the board of directors to be more of a strategic entity and allowing the day-to-day work to be handled by employees. I proposed having a board hackathon so that we could set aside time to do some strategic planning, reassess how we did budgeting, and also work on important initiatives that often got pushed to the side. The first hackathon was a success, and it's now an annually recurring event. Once the employees had been hired, we worked on transferring responsibilities to them and helping to integrate them into the larger community. There were some challenges we faced along the way, but overall, this went smoothly, and the community was excited about seeing the Foundation grow to support its needs.
|
||||
|
||||
* ![Linux App Summit 2019][17]
|
||||
|
||||
Linux App Summit 2019 (Nuritzi Sanchez, [CC BY-SA 4.0][6])
|
||||
|
||||
**New policies to enable growth:** While on the board, I helped with some initiatives that also helped us build momentum. Two such policies were our [Code of Conduct][18] and our [Travel Policy][19]. These two helped make the GNOME community more inclusive and helped show that GNOME cares about continuing to build a great and diverse community.
|
||||
|
||||
* **Linux App Summit:** Finally, another thing I think helped was the work we did around creating a new conference, the [Linux App Summit][20]. While the conference started in 2016, in 2019, we joined forces with KDE. This doubled attendance and showed the world that KDE and GNOME could work together towards a greater purpose. As part of the founding team of that conference, I'm very proud of our work there.
|
||||
|
||||
|
||||
|
||||
|
||||
**DW:** You've recently moved to GitLab as senior open source program manager (OPSM). What are you doing there? What are your short-term and long-term goals there?
|
||||
|
||||
**NS**: I am thrilled to be at GitLab! My main focus right now is on the [GitLab for Open Source][21] program, which offers our top tiers for free to qualifying open source projects. As part of that program, we also help large open source organizations with their migrations (GNOME, KDE, Drupal, etc.). I'm working on formalizing aspects of the program and streamlining processes that will allow us to scale the program.
|
||||
|
||||
![GitLab's community relations team][22]
|
||||
|
||||
GitLab's community relations team (Nuritzi Sanchez, [CC BY-SA 4.0][6])
|
||||
|
||||
As I work on this program, I'm being exposed to new open source communities, and I'm learning more about the DevOps world. It's been incredibly rewarding already! My hope is to help make GitLab the best place for open source organizations to thrive at scale, and in order to do so, there are many pieces involved. I see myself advocating for features that are important to open source projects, facilitating communication between our community and our internal team, and working with the community relations team to help make it a great experience to be part of our community. Apart from that, one thing that I've been interested in is how to help make open source more sustainable, so I'm keen on continuing to learn about and explore that topic. Last but not least, I’m also very excited about the work that the CHAOSS community is doing on creating metrics to measure the health of open source communities. I recently joined a new working group there to create a set of metrics that foundations like GNOME and KDE can use to measure their community’s health.
|
||||
|
||||
**DW:** Would you recommend other open source companies have OSPMs? What about non-open source companies?
|
||||
|
||||
**NS**: Since software is eating the world, and open source software is eating the software world, I absolutely would encourage companies to devote more resources into understanding their dependency on and growing their involvement in open source software.
|
||||
|
||||
If a company is just starting off or isn't able to have an open source program office (OSPO) right away, having an open source program manager is a great entry point. These early hires can help lay down some initial structure and work on high-priority initiatives relating to the open source work that the company is doing or wants to participate in. This can later turn into a larger program office if and when the company is ready for that.
|
||||
|
||||
* * *
|
||||
|
||||
I appreciate the time Nuritizi took to share her journey with me and the work she's doing to support open source and the communities that build up around open source projects. If you'd like to learn more about her, I recommend you join me in following her on [Twitter][2].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/nuritzi-sanchez-interview
|
||||
|
||||
作者:[Don Watkins][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/don-watkins
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-globe.png?itok=_drXt4Tn (Globe up in the clouds)
|
||||
[2]: https://twitter.com/1nuritzi
|
||||
[3]: https://opensource.com/article/18/2/meet-endless-os-lightweight-linux
|
||||
[4]: https://endlessos.com/home/
|
||||
[5]: https://opensource.com/sites/default/files/uploads/guadec_2015.jpg (GUADEC 2015 newcomers' event)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://events.gnome.org/event/1/
|
||||
[8]: https://www.youtube.com/watch?v=qs5J_IWSmiE
|
||||
[9]: https://opensource.com/sites/default/files/uploads/endless_usertestingguatemala.jpg (Endless OS user testing in Guatemala)
|
||||
[10]: https://dschool.stanford.edu/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/indonesiacommunitygathering.jpg (Meeting with open source community members in Indonesia)
|
||||
[12]: https://en.wikipedia.org/wiki/Usage_share_of_operating_systems
|
||||
[13]: https://opensource.com/sites/default/files/uploads/womenwhocodetaipei.jpg (Women Who Code Taipei event)
|
||||
[14]: https://flatpak.org/
|
||||
[15]: https://flathub.org/home
|
||||
[16]: https://wiki.gnome.org/Apps/Builder
|
||||
[17]: https://opensource.com/sites/default/files/uploads/linuxappsummit2019.jpg (Linux App Summit 2019)
|
||||
[18]: https://wiki.gnome.org/Foundation/CodeOfConduct
|
||||
[19]: https://wiki.gnome.org/Travel
|
||||
[20]: https://linuxappsummit.org/
|
||||
[21]: https://about.gitlab.com/solutions/open-source/
|
||||
[22]: https://opensource.com/sites/default/files/uploads/gitlab_cr-team.jpg (GitLab's community relations team)
|
@ -0,0 +1,83 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What do Paketo Buildpacks Mean for Developers and Operators)
|
||||
[#]: via: (https://www.linux.com/audience/developers/what-do-paketo-buildpacks-mean-for-developers-and-operators/)
|
||||
[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/)
|
||||
|
||||
What do Paketo Buildpacks Mean for Developers and Operators
|
||||
======
|
||||
|
||||
Cloud Foundry Foundation recently announced the launch of [Paketo Buildpacks][1] for cloud native developers and operators. But what’s the difference between Cloud Foundry’s Packet and the Buildpacks announced by CNCF? What does it mean for developers who are already using buildpacks? What kind of community is Cloud Foundry look at building around Paketo? What does the roadmap look like?
|
||||
|
||||
To get answers to these questions and deep dive into Paketo Buildpacks, [Swapnil Bhartiya][2], Founder of TFiR.io spoke with Chip Childers, Executive Director, Cloud Foundry Foundation and Kashyap Vedurmudi, Product Manager at VMware.
|
||||
|
||||
_Here is a lightly edited transcript of the interview:_
|
||||
|
||||
**Swapnil Bhartiya: Today we have two guests, Kashyap Vidurmudi, product manager at VMware, and Chip Childers, executive director of Cloud Foundry. Today we are going to talk about the recently announced Paketo Buildpacks. I don’t want to get into that old debate about Docker files versus Buildpacks, but there are two things that I do want to talk about before we talk about Paketo in specific – compliance and security. How does Paketo Buildpacks solve these two problems?**
|
||||
|
||||
Kashyap Vidurmudi: So, we have a couple of things. We are constantly shipping Buildpacks just whenever upstream security vulnerability comes out, a new language family version, things like that. So Buildpacks make it much easier especially for enterprise users just to continuously make sure that their apps stay up to date, and secure, and compliant. So this is I think a huge value proposition of what Buildpacks offer versus using Docker files to run your apps and to build your apps and production.
|
||||
|
||||
Chip Childers: The history of the Cloud Foundry project is, it’s been using Buildpack since nearly the beginning of its inception, originally at VMware, right, before it took it to journey to pivotal and then the CFF. So Buildpacks have demonstrated their value when used with a platform that’s able to implement them effectively, a few times, right? In particular, I’m thinking about the OpenSSL Heartbleed vulnerability. I found that to be a great example of when languages and runtimes don’t embed too many things in their distribution statically, then you’re able to use the Buildpack process to roll out security patches to these really important underlying libraries very quickly.
|
||||
|
||||
Chip Childers: As an example, Kashyap said that the buildpack project with Paketo Buildpacks, they’ve always been keeping up to date with all their critical vulnerabilities or high vulnerabilities from all the languages and frameworks that get pulled together. We had the OpenSSL update rolled out to the whole ecosystem and it managed to percolate through all the platforms that had the CF Buildpacks embedded in them very quickly, like in a matter of days. And it was really smooth. The only hiccup back then was that no JS actually included the OpenSSL library in its own distribution. So I think it was about a month or so after Heartbleed that they split that out and then Buildpacks could be more effective at helping to support some of these underlying libraries.
|
||||
|
||||
**Swapnil Bhartiya: Thanks for explaining that. If I’m not wrong, last year, CNCF also announced a Buildpack project. What is the difference between what CNCF is doing there versus what you guys are trying to do?**
|
||||
|
||||
Kashyap Vidurmudi: That’s a great question and probably the biggest question we’ve been getting asked with this whole launch. So the CNCF Cloud Native Buildpacks project, they built the underlying specification and tooling needed to build a Cloud Native compliant Buildpack. Or the Paketo Buildpacks project is just a set of language family implementations on top of these Cloud Native Buildpack specifications. So we build implementations when we launched the other day, we have Java, node.js, PHP, .NET Core, and probably a couple of others that I’m missing, Buildpack implementations on top of that spec.
|
||||
|
||||
**Swapnil Bhartiya: And why do you call it Paketo Buildpacks, the specific reasons for this naming?**
|
||||
|
||||
Kashyap Vidurmudi: That’s a great question as well. To be completely honest with you, our whole engineering team went through about two different naming exercises just to generate different names for Buildpacks. At a team lunch, a couple of months ago, someone came up with the Paketo, which translates to Greek and… Sorry, it translates to package in Greek. What we really liked about it was Kubernetes translates to pilot and Greek, and we liked that with Paketo translating a package in Greek. We can come off with the association that Paketo packages your apps as container images that any Cloud Native platforms similar to Kubernetes can work as straight. So the name stuck at the end.
|
||||
|
||||
**Swapnil Bhartiya: Talk a bit about the collaboration between Cloud Foundry and VMware for this project.**
|
||||
|
||||
Chip Childers: I want to start probably by saying, the kind of Buildpack project is a Cloud Foundry Foundation project, right? And so what that means is it’s the same engineers and contributors that are working on the traditional Cloud Foundry. Buildpacks are building the Paketo Buildpacks collection, right? So you get all their past experience as a community building and maintaining, and keeping up to date these new Cloud Native Buildpack compliant things. One of the goals of the project team, which I’m sure Kashyap could share a little bit more about as well, is that traditionally the Cloud Foundry Buildpack collection has seen the majority of the effort that was put into maintaining it coming from pivotal.
|
||||
|
||||
There were certainly a lot of casual contributors, but it was something, that pivotal bore the full burden on. And we think that it’s incredibly important that now that the Cloud Native Buildpacks spec can be used in many different platforms. That a lot of participants rally around this because it’s an opportunity to get really high-quality Buildpack code brought into whichever platform you’re using, whether it’s Tecton, or it’s Google Cloud run, or whether it’s the CF [inaudible 00:07:06] distribution of Cloud Foundry. There are going to be a lot of end-users that should be able to amplify the feedback loop back to the project team. And we’re very open to new contributors there.
|
||||
|
||||
**Swapnil Bhartiya: What kind of community are you planning to build around these Paketo Buildpacks and what will be the resources available for the community to build and consume these Buildpacks?**
|
||||
|
||||
Kashyap Vidurmudi: I think just to add on a little bit to what Chip said, the community is super important for us with this whole Paketo Buildpacks launch. I think what we’re looking for ideally is a mix of vendors helping us out similar to what Cloud Foundry Foundation has had in the past, as well as individual contributors. And what’s super exciting to see is we just launched a couple of days ago and we’re already seeing a bunch of people reaching out, and trying out Paketo Buildpacks, and interested in contributing. We’re seeing that maybe people might be interested in helping us develop a Python, Paketo Buildpacks, which is really cool to see. To answer the second part of your question around a marketplace or some ecosystem, I think in the future, that would be super cool to have something like that. In the short term, what we’re doing is we have with this concept of builder images where a builder is effectively a set of Buildpacks, Paketo Buildpacks that are packaged in there. So we ship our builders onto a GCR registry that users can then use to consume our Buildpacks.
|
||||
|
||||
**Swapnil Bhartiya: Is there any specific Buildpacks that will be available or you’ll be focusing on to start with?**
|
||||
|
||||
Kashyap Vidurmudi: Yeah. When we launched the other day, we officially have Java, node.js, .NET Core, PHP, and Nginx Paketo Buildpacks available at the moment. We’re currently just getting started around a Ruby Paketo Buildpacks and looking into publishing some official project-wide roadmap in the future to show what’s coming next.
|
||||
|
||||
Chip Childers: I think that’s another really good opportunity for people to get involved. As you said, there’s been interest organically in helping to add Python as a Buildpack. There’s a very long tail of different languages and frameworks that are used in the enterprise context. And so Paketo Buildpacks was going out the door with a set of Buildpacks that basically solved the majority of enterprise development use cases, right? Python is used very heavily, but it’s a little bit less than Java, right? And so the tail starts to drop a little bit. But there’s a lot of opportunity in those languages and frameworks that the Paketo Buildpacks project team hasn’t created on their own. But those same patterns can be followed for languages that might be maybe less used.
|
||||
|
||||
As the community grows around, not just the Cloud Native Buildpacks spec, right, because anyone can build a Buildpack to that spec. But I think the practices of the Paketo Buildpacks project lend themselves to quality distribution of a Buildpack, right? If you search and get up for Buildpacks, even if you’re just looking at the past version of the way Buildpacks work, you find thousands of them, right? But some of them are stale, some of them are, they have work. And I think the more important than exactly which Buildpacks are offered today is that the Paketo Buildpacks project is an opportunity for people to come together around the discipline of building quality Buildpacks and then maintaining them over time.
|
||||
|
||||
Kashyap Vidurmudi: Yeah, exactly. That’s a really good point. And I think that over the next coming weeks to months, we’re really focused on improving a lot of our documentation to help enable things like this. We have a couple of tutorials right now just to help users create a Paketo style Buildpack and lots of tools and things like that out there. So my end goal and just sure Chip agrees with this, which is, I’d love to see a user just coming in with very little Buildpack experience and be able to build, say, a Rust Cloud Native Buildpack or something like that very simply and easily and support that. And that’s the end goal of where we want to go in terms of enabling the community to build Buildpacks easily.
|
||||
|
||||
**Swapnil Bhartiya: So what happens to the existing Buildpacks that people are already using?**
|
||||
|
||||
Kashyap Vidurmudi: For Cloud Foundry Buildpacks, we’re going to continue providing support for CF workloads into the foreseeable future. So what we did is we built a concept of a compatibility layer on top of every one of our Paketo Buildpacks, which allow us to ship a Cloud Foundry compatible Cloud Native Buildpack. And that enables your CF workflows to continue to work with Paketo Buildpacks.
|
||||
|
||||
Chip Childers: I think one of the things to understand, and this is where it gets a little bit confusing, right? Buildpacks as a concept has a fairly long history. So it started at Heroku. CF was emulating Heroku, right? It was the open source alternative to Heroku and it implemented Buildpacks in order to have that support. And for a while, they were largely compatible, right? You could take a Heroku Buildpack and you could use that in a Cloud Foundry context or you could do the reverse. And so that worked for a while. The two platforms, right, Cloud Foundry and opensource community. And then Heroku as a product or a platform as a service, that’s all proprietary, they started to diverge, right? So the compatibility within the ecosystem started to break down.
|
||||
|
||||
When the CNCF Cloud Native Buildpacks project kicked off, to me that was actually one of the most important moments in the platform as a service space in a number of years. Because it represented a reconvergence of streams of work and sets of experiences with different end-users that made a ton of sense for everyone. But what that means though, is that the CMB spec is, it’s a new way to build Buildpacks, right? So all that historical work for the CF community building that shim is important, but it’s really critical to understand that a Cloud Native Buildpack, compliant Buildpack is different from a traditional Heroku or Cloud Foundry, older version Buildpack. They’re implemented differently. And so it’s a new generation of them. And that’s where a new ecosystem because there are multiple platforms that don’t support their use, is really going to kick in here.
|
||||
|
||||
**Swapnil Bhartiya: Kashyap, you mentioned there’ll be a lot of resources documentation that would be coming up. What are the resources that are available at this moment that people can either read or go to that to get more aware of the project at the same time, how they can get involved with the project?**
|
||||
|
||||
Kashyap Vidurmudi: Yeah. So right now we have a couple of tutorials out there just around how to get started with Paketo Buildpacks as well as how to go ahead and create your own Paketo Buildpacks. In terms of getting started and helping out and getting involved, I think the best way to get started right now is to join us on Slack, our Slack is Slack.paketo, P-A-K-E-T-O.io, or visit our website and go through the content. The website is P-A-K-E-T-O.io.
|
||||
|
||||
**Swapnil Bhartiya: Chip and Kashyap, thank you so much for taking time out of your schedule and talking to us today about this project. Good luck with that project and thank you once again.**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/audience/developers/what-do-paketo-buildpacks-mean-for-developers-and-operators/
|
||||
|
||||
作者:[Swapnil Bhartiya][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.linux.com/author/swapnil/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://paketo.io/
|
||||
[2]: https://www.tfir.io/author/arnieswap/
|
@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Wi-Fi 6E: When it’s coming and what it’s good for)
|
||||
[#]: via: (https://www.networkworld.com/article/3563832/wi-fi-6e-when-its-coming-and-what-its-good-for.html)
|
||||
[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/)
|
||||
|
||||
Wi-Fi 6E: When it’s coming and what it’s good for
|
||||
======
|
||||
New wireless spectrum recently dedicated to Wi-Fi allows for more channels and higher density deployments, but gear to support it won’t be widely deployed until 2020, according to an Extreme Networks exec.
|
||||
Thinkstock
|
||||
|
||||
This spring [the FCC opened up a new swath of unlicensed wireless spectrum][1] in the 6GHz band that’s intended for use with Wi-Fi and can provide lower latency and faster data rates. The new spectrum also has a shorter range and supports more channels than bands that were already dedicated to Wi-Fi, making it suitable for deployment in high-density areas like stadiums.
|
||||
|
||||
To further understand what Wi-Fi 6E is and how it differs from Wi-Fi 6, I recently talked with Perry Correll, director of product management for networking solutions vendor Extreme Networks.
|
||||
|
||||
**Learn more about 5G and WiFi 6**
|
||||
|
||||
* [What is 5G? How is it better than 4G?][2]
|
||||
* [How to determine if WiFi 6 is right for you][3]
|
||||
* [What is MU-MIMO? Why do you need it in your wireless routers?][4]
|
||||
* [When to use 5G, when to use WiFi 6][5]
|
||||
* [How enterprises can prep for 5G networks][6]
|
||||
|
||||
|
||||
|
||||
**Kerravala:** **Wi-Fi 6 seems to be getting a lot of hype but not Wi-Fi 6E. Why?**
|
||||
|
||||
**Correll:** There’s so much confusion around all the 666 numbers, it’ll scare you to death. You’ve got Wi-Fi 6, Wi-Fi 6E – and Wi-Fi 6 still has additional enhancements coming after that, with multi-user multiple input, multiple output (multi-user MIMO) functionalities. Then there’s the 6GHz spectrum, but that’s not where Wi-Fi 6 gets its name from: It’s the sixth generation of Wi-Fi. On top of all that, we are just getting a handle 5G and there already talking about 6G – seriously, look it up – it's going to get even more confusing.
|
||||
|
||||
**Kerravala:** **Why do we need Wi-Fi 6E versus regular Wi-Fi 6?**
|
||||
|
||||
**Correll:** The last time we got a boost in UNII-2 and UNII-2 Extended was 15 years ago and smartphones hadn’t even taken off yet. Now being able to get 1.2GHz is enormous. With Wi-Fi 6E, we’re not doubling the amount of Wi-Fi space, we're actually quadrupling the amount of usable space. That’s three, four, or five times more spectrum, depending on where you are in the world. Plus you don't have to worry about DFS [dynamic frequency selection], especially indoors.
|
||||
|
||||
Wi-Fi 6E is not going to be faster than Wi-Fi 6 and it’s not adding enhanced technology features. The neat thing is operating the 6GHz will require Wi-Fi 6 or above clients. So, we’re not going to have any slow clients and we’re not going to have a lot of noise. We’re going to gain performance in a cleaner environment with faster devices.
|
||||
|
||||
**Kerravala:** **Can you also run wider channels?**
|
||||
|
||||
**Correll:** Exactly, that's the cool thing about it. If you’re in a typical enterprise environment, 20 and 40MHz is pretty much all you need. In high-density environments like stadiums, trying to do 80 or 160MHz just became tough. Wider channels are really going help things like [virtual reality], which can take advantage of those channels that are eating up the rest of the spectrum. That’s probably the biggest use case.
|
||||
|
||||
Three or four years down the road, if you want to do digital signage or screen edge at stadiums then you can use 80 of the 160MHz without getting impacted by anything else. There’s already talk of Wi-Fi 7 and it’s going to have 320MHz-wide channels.
|
||||
|
||||
**Kerravala:** **Will this be primarily an augmentation to most Wi-Fi strategies?**
|
||||
|
||||
**Correll:** It's definitely going to be at the edges in the short term. The first products are probably going to launch at the end of this year, and they’re going to be consumer-grade. For the enterprise, 6GHz-capable products will start showing up next year. Not before 2022 will you actually start seeing any density – so, not any time soon. For smartphone companies, Wi-Fi is not a big deal and they’d rather focus on other features.
|
||||
|
||||
Still, it’s a huge opportunity. The nicest thing about the 6GHz versus CBRS [Citizens Broadband Radio Service] or 5G is [that many] would rather stick with Wi-Fi than having to move to a different architecture. These are the users that are going to drive the manufacturers of the widgets to IoT devices or robots or whatever requires the 6GHz. It's a clean spectrum and might be cheaper than the regular Wi-Fi 6. There are also some power-saving benefits there, too.
|
||||
|
||||
**Kerravala:** **There’s talk of 5G replacing Wi-Fi 6. But what’s the practicality of that?**
|
||||
|
||||
**Correll:** Realistically, you can’t put a SIM in every device. But one of the big issues that come up is data ownership because the carrier is going to own your data, not you. If you want to use your data for any kind of business analytics, will the carrier release the data back to you at a certain price? That’s a frightening thought.
|
||||
|
||||
There are just too many reasons why Wi-Fi is not going away. When Wi-Fi 6 and 5G-capable devices come out, what will happen to all the other laptops, tablets, and IoT devices that only have Wi-Fi? There will either be Wi-Fi-only or Wi-Fi and 5G devices, but 5G is not going to replace Wi-Fi altogether. If you look at the 5G radio network backbone, Wi-Fi is a component. It's one big happy family. The technologies are designed to coexist.
|
||||
|
||||
Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3563832/wi-fi-6e-when-its-coming-and-what-its-good-for.html
|
||||
|
||||
作者:[Zeus Kerravala][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/Zeus-Kerravala/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3540288/how-wi-fi-6e-boosts-wireless-spectrum-five-fold.html
|
||||
[2]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html
|
||||
[3]: https://www.networkworld.com/article/3356838/how-to-determine-if-wi-fi-6-is-right-for-you.html
|
||||
[4]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html
|
||||
[5]: https://www.networkworld.com/article/3402316/when-to-use-5g-when-to-use-wi-fi-6.html
|
||||
[6]: https://www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html
|
||||
[7]: https://www.facebook.com/NetworkWorld/
|
||||
[8]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,66 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (NIST aims to make frequency sharing more efficient for wireless networks)
|
||||
[#]: via: (https://www.networkworld.com/article/3561618/nist-aims-to-make-frequency-sharing-more-efficient-for-wireless-networks.html)
|
||||
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
|
||||
|
||||
NIST aims to make frequency sharing more efficient for wireless networks
|
||||
======
|
||||
Machine-learning formula will help different radio protocols, such as Wi-Fi and LTE, work together more efficiently in the same wireless spectrum.
|
||||
Martyn Williams/IDG
|
||||
|
||||
A machine-learning formula developed by the National Institute of Standards and Technology ([NIST][1]) has the potential to significantly improve how [5G][2] and other wireless networks select and share communications frequencies. Compared to trial-and-error methods, NIST's formula could make the process of sharing communications frequencies as much as 5,000 times more efficient, researchers claim.
|
||||
|
||||
The NIST system is based the idea that radio equipment can learn its network environments from experience rather than, as is done now, simply select frequency channels based on trial-and-error.
|
||||
|
||||
"The algorithm learns which channel provides the best outcome" under specific environmental conditions, NIST says in an [article on its website][3].
|
||||
|
||||
**READ MORE:** [How beamforming makes wireless communication faster][4]
|
||||
|
||||
"The formula could be programmed into software on transmitters in many [different] types of real-world networks," the team says.
|
||||
|
||||
Essentially, the computer-modeled algorithm is a formula that maps prior experience in environmental RF conditions. Those conditions can include the number of transmitters operating within a channel (set of adjacent frequencies), for example.
|
||||
|
||||
"… if a transmitter selects a channel that is not occupied, then the probability of a successful transmission rises, leading to a higher data rate," the article says. Likewise, when a transmitter selects a channel that doesn't have much interference on it, the signal is stronger, and you get a better data rate. The transmitter remembers which channel provides the best outcome and learns to choose that spot on the dial when it next needs a clear signal.
|
||||
|
||||
That's different from the way things generally work today. That is, a radio simply tries to find an open frequency and then communicates with like-protocol radios. In sophisticated cases, like Wi-Fi, for example, frequency hopping and [beamforming][4] are used to optimize channels.
|
||||
|
||||
Where NIST's machine-learning technique shines is in the case of shared spectrum, such as sharing Wi-Fi with License Assisted Access (LAA), the researchers explain. LAA is LTE in unlicensed spectrum, known as LTE-U, at 5 GHz. In that combination of Wi-Fi with LAA, on the same frequencies, the protocols are disparate: the radios don't communicate with each other to function in harmony, and chaos could occur the busier the band got—transmissions would bump into other transmissions. But, if all the radios were better at choosing their slot, by learning what works and what doesn't, then things would be better.
|
||||
|
||||
"This could potentially make communications in the unlicensed bands much more efficient," says Jason Coder, a NIST engineer, in the article.
|
||||
|
||||
Indeed, it "could help 5G and other wireless networks select and share communications frequencies about 5,000 times more efficiently than trial-and-error methods," NIST claims.
|
||||
|
||||
The key word here is "share," because in order to increase communications in limited spectrum, more sharing must take place—the users, such as IoT, or media streaming, are all competing for the same metaphorical real estate. Combining unlicensed and licensed bands, as is the case in LAA, will likely become more common as IoT and digital continues to expand. (Unlicensed bands are those not assigned to a specific user, like a mobile network operator; licensed bands are won in auctions and allocated.)
|
||||
|
||||
In the NIST scenario, the competing transmitters "each learn to maximize the total network data rate without communicating with each other." Therefore, multiple protocols and data types, like video or sensor data, or Wi-Fi and mobile networks, can function alongside each other.
|
||||
|
||||
NIST's formula significantly simplifies the process of assigning optimum channels to transmitters, according to the article: "The study found that an exhaustive effort [using trial and error] to identify the best solution would require about 45,600 trials, whereas the formula could select a similar solution by trying only 10 channels, just 0.02 percent of the effort."
|
||||
|
||||
The NIST researchers recently presented their research at [IEEE's 91st Vehicular Technology Conference][5], held virtually this year.
|
||||
|
||||
Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3561618/nist-aims-to-make-frequency-sharing-more-efficient-for-wireless-networks.html
|
||||
|
||||
作者:[Patrick Nelson][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/Patrick-Nelson/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.nist.gov/
|
||||
[2]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html
|
||||
[3]: https://www.nist.gov/news-events/news/2020/05/nist-formula-may-help-5g-wireless-networks-efficiently-share-communications
|
||||
[4]: https://www.networkworld.com/article/3445039/beamforming-explained-how-it-makes-wireless-communication-faster.html
|
||||
[5]: https://events.vtsociety.org/vtc2020-spring/conference-sessions/program/
|
||||
[6]: https://www.facebook.com/NetworkWorld/
|
||||
[7]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Should API-restricting licenses qualify as open source?)
|
||||
[#]: via: (https://opensource.com/article/20/6/api-copyright)
|
||||
[#]: author: (Richard Fontana https://opensource.com/users/fontana)
|
||||
|
||||
Should API-restricting licenses qualify as open source?
|
||||
======
|
||||
A look at how a closely-watched legal case about copyright and APIs
|
||||
might affect open source licensing
|
||||
![Two government buildings][1]
|
||||
|
||||
In its 2014 _[Oracle v. Google][2]_ decision, the United States Court of Appeals for the Federal Circuit held that the method declarations and "structure, sequence, and organization" (SSO) of the Java SE API were protected by copyright. This much-criticized result contradicted a decades-old industry and professional consensus assumption that APIs were in the public domain, reflected in an ongoing common practice of successive reimplementation of APIs, and persisting even after the general copyrightability of software was settled by statute. Unsurprisingly, that consensus shaped the view of APIs from within open source. Open source licenses, in particular, do not address APIs, and their conditions have not customarily been understood to apply to APIs.
|
||||
|
||||
If the copyrightability ruling survives its current [review][3] by the United States Supreme Court, there is reason to worry that _Oracle v. Google_ will eventually have some detrimental impact on open source licensing. License authors might draft new licenses that would explicitly extend familiar kinds of open source license conditions to activities merely involving APIs. There could also be comparable efforts to advance _Oracle v. Google_-influenced reinterpretations of existing open source licenses.
|
||||
|
||||
We've already seen an example of a new open source-like license that restricts APIs. Last year, Holochain, through its lawyer [Van Lindberg][4], submitted the [Cryptographic Autonomy License][5] (CAL) for approval by the Open Source Initiative (OSI). The [1.0-Beta][6] draft included source availability and licensing requirements placed on works merely containing or derivative of interfaces included in or derived from the licensed work. (CAL 1.0-Beta was [rejected][7] by the OSI for reasons other than the interface copyleft feature. Subsequent revisions of CAL removed explicit references to interfaces, and the OSI approved CAL 1.0 earlier this year.) Licenses like CAL 1.0-Beta would extend copyleft to reimplementations of APIs having no code in common with the original. Though less likely, new permissive licenses might similarly extend notice preservation requirements to mere copies of APIs.
|
||||
|
||||
In my view, API-restricting licenses, though otherwise FOSS-like, would not qualify for the open source label. To simplify what is actually a complicated and contentious issue, let's accept the view that the license approval decisions of the OSI, interpreting the [Open Source Definition][8] (OSD), are the authoritative basis for determining whether a license is open source. The OSD makes no mention of software interfaces. Some advocates of a relaxation of standards for approving open source licenses have argued that if a type of restriction is not explicitly prohibited by the OSD, it should be considered acceptable in an open source license. To guard against this tactic, which amounts to ["gaming" the OSD][9], the OSI [clarified][10] in 2019 that the purpose of the approval process is to ensure that approved licenses not only conform to the OSD but also provide software freedom.
|
||||
|
||||
Though [Luis Villa has raised concerns][11] that it gives rise to a "[no true Scotsman][12]" problem, I believe the emphasis on software freedom as a grounding principle will enable the OSI to deal effectively and in a well-reasoned, predictable way with cases where license submissions expose unforeseen gaps or vagueness in the OSD, which is politically difficult for the OSI to revise. (Disclosure: I was on the OSI board when this change to the license review process was made.) It is also an honest acknowledgment that the OSD, like the [Free Software Definition][13] maintained by the Free Software Foundation, is an unavoidably imperfect and incomplete attempt to distill the underlying community norms and expectations surrounding what FOSS is.
|
||||
|
||||
Software freedom is the outgrowth of a long-lived culture. Judging whether a license that extends FOSS-normative conditions to APIs provides software freedom should begin with an examination of tradition. This leads to a straightforward conclusion. As noted above, from nearly the earliest days of programming and continuing without interruption through the rise of the modern open source commons, software developers have shared and acted on a belief in an unconditional right to reimplement software interfaces. From a historical perspective, it is difficult to think of anything as core to software freedom as this right to reimplement.
|
||||
|
||||
The inquiry cannot be entirely backward-looking, however, since the understanding of software freedom necessarily changes in response to new societal or technological developments. It is worth asking whether a departure from the traditional expectation of unrestricted APIs would advance the broader goals of open source licensing. At first glance, this might seem to be true for copyleft licensing, since, in theory, compliant adoption of API copyleft licenses could expand the open source software commons. But expanding the scope of copyleft to API reimplementations—software traditionally seen as unrelated to the original work—would violate another open source norm, the limited reach of open source licenses, which is partially captured in [OSD 9][14].
|
||||
|
||||
Another observation is that software freedom is endangered by licensing arrangements that are excessively complex and unpredictable and that make compliance too difficult. This would likely be true of API-restricting FOSS-like licenses, especially on the copyleft side. For example, copyleft licenses typically place conditions on the grant of permission to prepare derivative works. Trying to figure out what is a derivative work of a Java method declaration, or the SSO of a set of APIs, could become a compliance nightmare. Would it include reimplementations of APIs? Code merely invoking APIs? The fundamental vagueness of _Oracle v. Google_-style API copyright bears some resemblance to certain kinds of software patent claims. It is not difficult to imagine acquirers of copyrights covered by API-restrictive licenses adopting the litigation strategies of patent trolls. In addition to this risk, accepting API-restrictive licenses as open source would further legitimize API copyrightability in jurisdictions like the United States, where the legal issue is currently unsettled.
|
||||
|
||||
_Oracle v. Google_-influenced interpretations of existing open source licenses would similarly extend familiar open source license conditions to activities merely involving APIs. Such reinterpretations would transform these licenses into ones that fail to provide software freedom and advance the goals of open source, for the same reasons that apply to the new license case. In addition, they would upend the intentions and expectations of the authors of those licenses, as well as nearly all of their licensors and licensees.
|
||||
|
||||
It might be argued that because open source licenses are principally ([though not exclusively][15]) copyright licenses, it is necessary, if not beneficial, for their conditions to closely track the expansion of copyright to APIs. This is not so for new open source licenses, which can be drafted explicitly to nullify the impact of _Oracle v. Google_. As for reinterpretations of existing open source licenses, while the issue of API copyrightability remains unsettled, it would not be appropriate to abandon traditional interpretations in favor of anticipating what an _Oracle v. Google_-influenced court, unfamiliar with open source culture, would decide. Litigation over open source licenses continues to be uncommon, and influential open source license interpretations have emerged in the technical community with little regard to how courts might act. In any event, courts engaged in interpreting commonly-used open source licenses may well be persuaded to treat APIs as unconstrained.
|
||||
|
||||
Some have suggested that interpretation of the GPL should take full advantage of the scope of underlying copyright rights. This is related to a view of copyleft as a "[hack on copyright][16]" or a "[judo move][17]" that "[return[s] the violent force of the oppressor against the oppressor itself][18]." It can be detected in the [copyleft tutorial][19] sponsored by the Software Freedom Conservancy and the FSF, which [says][20]: "The strongest copylefts strive to [use] the exclusive rights that copyright grants to authors as extensively as possible to maximize software freedom." It might seem logical for someone with this perspective to specifically promote an API copyright interpretation of the GPL. But I know of no advocate of strong copyleft who has done so, and the text and interpretive history of the GPL do not support such a reading.
|
||||
|
||||
A somewhat different view of API copyright and GPL interpretation, occasionally voiced, is that _Oracle v. Google_ may put the doctrine of strong copyleft on a surer legal foundation. Similarly, it has sometimes been asserted that strong copyleft rested on some notion of API copyrightability all along, which suggests that _Oracle v. Google_ provides some retroactive legal legitimacy. The latter view is not held by the FSF, which in an earlier era had [opposed the expansion of copyright][21] to user interfaces. This stance made its way into GPLv2, which has a [largely overlooked provision][22] authorizing the original licensor to exclude countries that would restrict "distribution and/or use … either by patents or by copyrighted interfaces." The FSF also [severely criticized][23] Oracle's claim of copyright ownership of Java APIs. And the FSF has never questioned the right to reimplement APIs of GPL-licensed software under non-GPL licenses (as has happened, for example, with the FSF-copyrighted [GNU Readline][24] and the BSD-licensed [libedit][25]). If there were shown to be some legal deficiency in strong copyleft theory that API copyrightability could somehow fix, I believe it would be better either to live with a weaker understanding of GPL copyleft or to pursue revisions to the GPL that would reformulate strong copyleft without relying on API copyright.
|
||||
|
||||
If API copyrightability survives Supreme Court review, it would then be appropriate for license stewards, licensors of existing open source licenses, and drafters of new open source licenses to take constructive steps to minimize the impact on open source. Stewards of widely used open source licenses, where they exist, could publish interpretive guidance clarifying that APIs are not restricted by the license. Updates to existing open source licenses and entirely new licenses could make unrestricted APIs an explicit policy. Licensors of existing open source licenses could make clear, in standardized license notices or through external commitments, that they will not treat open source license conditions as imposing any restriction on activities merely involving APIs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/api-copyright
|
||||
|
||||
作者:[Richard Fontana][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/fontana
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_lawdotgov2.png?itok=n36__lZj (Two government buildings)
|
||||
[2]: http://www.cafc.uscourts.gov/sites/default/files/opinions-orders/13-1021.Opinion.5-7-2014.1.PDF
|
||||
[3]: https://www.scotusblog.com/case-files/cases/google-llc-v-oracle-america-inc/
|
||||
[4]: https://twitter.com/vanl?lang=en
|
||||
[5]: https://github.com/holochain/cryptographic-autonomy-license
|
||||
[6]: http://lists.opensource.org/pipermail/license-review_lists.opensource.org/2019-April/004028.html
|
||||
[7]: http://lists.opensource.org/pipermail/license-review_lists.opensource.org/2019-June/004248.html
|
||||
[8]: https://opensource.org/osd
|
||||
[9]: https://twitter.com/webmink/status/1121873263125118977?s=20
|
||||
[10]: https://opensource.org/approval
|
||||
[11]: https://twitter.com/luis_in_brief/status/1143884765654687744
|
||||
[12]: https://en.wikipedia.org/wiki/No_true_Scotsman
|
||||
[13]: https://www.gnu.org/philosophy/free-sw.en.html
|
||||
[14]: https://opensource.org/osd#not-restrict-other-software
|
||||
[15]: https://opensource.com/article/18/3/patent-grant-mit-license
|
||||
[16]: https://sfconservancy.org/blog/2012/feb/01/gpl-enforcement/
|
||||
[17]: https://gondwanaland.com/mlog/2014/12/01/copyleft-org/#gpl-and-cc-by-sa-differences
|
||||
[18]: https://dustycloud.org/blog/field-guide-to-copyleft/#sec-2-2
|
||||
[19]: https://copyleft.org/guide/
|
||||
[20]: https://copyleft.org/guide/comprehensive-gpl-guidech2.html#x5-120001.2.2
|
||||
[21]: https://www.gnu.org/bulletins/bull21.html
|
||||
[22]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section8
|
||||
[23]: https://www.fsf.org/blogs/licensing/fsf-statement-on-court-of-appeals-ruling-in-oracle-v-google
|
||||
[24]: https://tiswww.case.edu/php/chet/readline/rltop.html
|
||||
[25]: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/
|
@ -0,0 +1,70 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The open organization everyone deserves)
|
||||
[#]: via: (https://opensource.com/open-organization/20/6/organization-everyone-deserves)
|
||||
[#]: author: (Jos Groen https://opensource.com/users/jos-groen)
|
||||
|
||||
The open organization everyone deserves
|
||||
======
|
||||
Want to build a sustainably successful organization? Then openness is
|
||||
the way.
|
||||
![Two different business organization charts][1]
|
||||
|
||||
Let me share an email I recently received. It meant the world to me:
|
||||
|
||||
> Hi Jos, just a quick message to thank you for the past six months. I really appreciate how I've been welcomed into the company and I feel like I've genuinely found my place here. There's a great vibe among the entire staff of working hard, lots of learning, having fun, and personal responsibility. Although everyone contributes to this atmosphere, it could only have come about with the support of management. So I just want to thank you for creating such an enjoyable work environment!
|
||||
|
||||
A work environment that encourages the collaborative utilization of everyone's combined skillset, one in which contributors are intrinsically motivated to do their best work, is something I would wish for everyone. That's why, over the past year especially, I've been cultivating an open organizational culture on my team and across my organization, Axians. Openness is the future, and it begins with individuals. In this article, I'll explain the mindset shifts I believe any _individual_ leader must make in order to pave the way for an organizational culture of openness.
|
||||
|
||||
### The technological is social
|
||||
|
||||
Social and technological changes are occurring faster than ever. These often seem like two separate movements—but are they really? The effect of the open source movement on the development of both innovative technologies and organizational cultures is many times greater than we may think. The open source community (as the name suggests) is shouldered by people—people who apply their skills to make the world a little better through new technologies, who realize the value of sharing both knowledge and material goods in both their work as well as their personal lives.
|
||||
|
||||
This means that in order to get the most out of new technologies, you need to have an open organizational culture in which employees contribute from [a place of intrinsic motivation][2]. The current generation of tech employees isn't drawn to organizations with a strong hierarchical culture. They're looking for _open_ organizations that encourage and inspire them to excel every single day. They're looking for the kind of leadership that leaves ample room for individual input and ownership. A successful and future-proof organization demands an open culture and open leadership.
|
||||
|
||||
At its core, a sustainably successful organization revolves around a balance between a focus on people and a focus on the business. In my experience, for the majority of organizations, this balance leans too heavily towards the business. There is an urgent need for a greater focus on people. The open organization is the answer to restoring this balance. That's why establishing and leading an open organization should be the [ultimate goal for contemporary managers][3]. But doing this requires leaders capable of restoring the balance [between business and the humans that work in it][4]—and maintaining that balance.
|
||||
|
||||
A work environment that encourages the collaborative utilization of everyone's combined skillset, one in which contributors are intrinsically motivated to do their best work, is something I would wish for everyone.
|
||||
|
||||
At the same time, a successful organization today is one that enables intelligent collaboration and effective coordination. This will increase the collective intelligence and offer employees the space they need to develop and grow. Unlocking and utilizing the available potential helps shape the kind of organization in which everyone participates and contributes, and this can produce some truly remarkable results. It’s no small task for a leader to establish and lead an organization of this kind.
|
||||
|
||||
### Authentic leadership
|
||||
|
||||
The human dimension present in an organization will in part determine the employers people choose to join, making it vital for managers to establish and lead an open organization. Part of openness is to be clear and honest about your intentions at all times.
|
||||
|
||||
This isn't just a gimmick, nor is it a skill you can easily "acquire." When you're working with people, they will immediately sense if your intentions aren't genuine. Because this process takes place on a subconscious level, it is unlikely people will articulate this feeling. Instead, it'll be reflected in their behavior: you might find people less involved and not opening up to you. In turn, you could experience their behavioras frustrating, even opposition. Sound familiar?
|
||||
|
||||
This is all about your credibility, which takes time to build. You'll be challenged, either consciously or subconsciously, to stick with your intentions. Be prepared to have to overcome mistrust and cynicism at times.
|
||||
|
||||
Are you up for that? Are you willing to examine the cause, to really invest your time and energy in trying to understand the other person? And will you stick to your principles?
|
||||
|
||||
### What about you?
|
||||
|
||||
An open organization is about placing your trust in people and creating a culture of equality. At the end of the day, it's not about you; it's about the collective. _Everyone_ is involved. _Everyone_ gets to make mistakes or ask for help. Even you. As long as you can be open and honest about it.
|
||||
|
||||
So have you put "openness" on the agenda? And what about your organization? Is your management ready to open up—or are they clinging to "command and control"?
|
||||
|
||||
I hope you'll [join me][5] as I explore these issues further [in an upcoming webinar][6].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/open-organization/20/6/organization-everyone-deserves
|
||||
|
||||
作者:[Jos Groen][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/jos-groen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_crowdvsopen.png?itok=AFjno_8v (Two different business organization charts)
|
||||
[2]: https://opensource.com/open-organization/18/5/rethink-motivation-engagement
|
||||
[3]: https://opensource.com/open-organization/20/6/open-management-practices
|
||||
[4]: https://opensource.com/open-organization/17/7/digital-transformation-people-1
|
||||
[5]: https://www.linkedin.com/in/josgroen/
|
||||
[6]: https://www.redhat.com/en/events/webinar/how-to-drive-the-transformation-journey-through-an-open-organization-approach-2020
|
@ -0,0 +1,97 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How an open project's governance model evolves)
|
||||
[#]: via: (https://opensource.com/open-organization/20/7/evolving-project-governance)
|
||||
[#]: author: (Bryan Behrenshausen https://opensource.com/users/bbehrens)
|
||||
|
||||
How an open project's governance model evolves
|
||||
======
|
||||
As open projects mature, their governance models inevitably change.
|
||||
Here's how we're evolving ours.
|
||||
![A two way street sign][1]
|
||||
|
||||
As we continue renovating the Open Organization community, we've been asking hard questions about how we want [that community][2] to function. What do we expect of one another, and of the new contributors yet to join us? How will we work best together? And how will we keep one another accountable for achieving our shared goals?
|
||||
|
||||
When open projects and communities discuss expectations like these, they're talking about "governance." In this case, "governance" refers to the [various processes by which rights and responsibilities get distributed][3] throughout a group. As community member [Jen Kelchner puts it][4], "it's the framework that creates the structure of the organizational system and the rules by which the parts of that structure can and do interact with one another."
|
||||
|
||||
A community's governance model explains _how_ that community functions. Maintaining a system of governance often helps a community _define_ and _describe_ the roles people play in that community.
|
||||
|
||||
Those shared definitions and descriptions are important. First, they allow community members to speak a common language about values and ambitions. They also advance community members' ability to contribute, because [they _make explicit_ the rules][5] everyone is playing by. And they ensure community members receive the various types of status and social capital they need and deserve.
|
||||
|
||||
The best governance models are flexible and adaptable. They grow with their communities. As the Open Organization community grows, so does its governance model. We've needed to revisit how we describe our community and the opportunities for contribution it affords people. ([We also fix typos][6].)
|
||||
|
||||
Let us describe what we're doing.
|
||||
|
||||
### New commitments
|
||||
|
||||
Through this conversation, we've been able to update the Open Organization [project][7] description and vision.
|
||||
|
||||
That vision initially took shape nearly five years ago, when the Open Organization Ambassador team first formed. At the time, Red Hat community architects [Jason Hibbets][8] and [Bryan Behrenshausen][9] drafted a document describing what a community of passionate advocates for [open organizational principles][10] _might_ look like. The vision was entirely aspirational, describing what could be—rather than what _was_. It served as a beacon to attract passionate contributors to a still-nascent project.
|
||||
|
||||
As soon as the community _did_ attract new members, however, those members promptly wrote their _own_ mission and vision for the Open Organization project, articulating their identity and purpose. And as we've grown, we've realized that we're all committed to even more than we originally described. Our community is adept at translating [open organization principles][10] for various audiences and contexts, and at helping different communities connect to our language and culture through _their_ own languages and cultures.
|
||||
|
||||
The best governance models are flexible and adaptable. They grow with their communities.
|
||||
|
||||
For example, [Laura Hilliger][11] has long seen an overlap between openness and cooperatives ([as have others in the community][12]). She's spoken about that overlap and lived it through her career—serving as a translator between two "radical" economic and communal ideas that use different terminology but are seeking the same kind of fair-mindedness in their activities and collaborations. Other Open Org community members have written about [Agile methodologies][13] and their association with open principles, open principles at work [in educational organizations][14], and more.
|
||||
|
||||
Our commitment to this sort of "translation work" wasn't highlighted in our working project description, so we [updated the description to include it][15].
|
||||
|
||||
### Role playing
|
||||
|
||||
Another hole we wanted to fill was a better description of the types of contributions one can make to this community. We wanted to talk about our contributors in a slightly more nuanced way, which we indicated in the initial project vision and then extrapolated into a fully fledged "[Community Roles][16]" wiki page.
|
||||
|
||||
Being specific about community roles helps us make the project more inclusive. It also gives us a method to _codify_ policies and procedures because we can associate them with individual roles people can play in the Open Org community.
|
||||
|
||||
So we've made some decisions about how contributors get read/write [access to community repositories][17], and how certain kinds of contributors can nominate people to "level up" in the community.
|
||||
|
||||
Just as people join communities, they also leave. Everyone's interests and passions change over time, and sometimes what brought them to your community is no longer meaningful to them. And that's okay.
|
||||
|
||||
We've also established a new kind of contributor, the "Maintainer," which gives Ambassadors expressing interest in leading and maintaining community-driven projects a way to show ownership and initiative around a particular project the community is working on. In short: It opens an important new contribution pathway and helps existing community members play an even more influential role in the Open Organization project.
|
||||
|
||||
And we're also recognizing the regular flux and flow that marks an open community like ours. Just as people join communities, they also leave. Everyone's interests and passions change over time, and sometimes what brought them to your community is no longer meaningful to them. And that's okay.
|
||||
|
||||
Sometimes, people will stay involved in a community because they feel a sense of belonging or status, even if they're not interested in doing the work anymore. And they carry with them important project history and context, which no one wants to see evaporate. So we're also adding another community role, the Open Organization Ambassador Emeritus. By giving community members emeritus status, we give Ambassadors the freedom to move on to something else without "kicking them out" of the project altogether.
|
||||
|
||||
All in all, defining and documenting roles and responsibilities will help our community attract contribution because it clearly explains _what getting involved means_ and the _benefits of doing so_.
|
||||
|
||||
### Next steps
|
||||
|
||||
We've come a long way. But there's more to be done.
|
||||
|
||||
The next bit of work we'd like to tackle is [developing a code of conduct][18]. Want to share your experience in this area? [Why not join us and help out?][19]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/open-organization/20/7/evolving-project-governance
|
||||
|
||||
作者:[Bryan Behrenshausen][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/bbehrens
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/govt_two%20way.png?itok=8dlG2Dpl (A two way street sign)
|
||||
[2]: http://theopenorganization.org
|
||||
[3]: https://opensource.com/article/20/5/open-source-governance
|
||||
[4]: https://opensource.com/open-organization/17/2/5-elements-teams-organized
|
||||
[5]: https://opensource.com/open-organization/18/4/new-governance-model-research
|
||||
[6]: https://github.com/open-organization/governance/commits/master
|
||||
[7]: https://github.com/open-organization/governance/blob/master/project-and-community-description.md
|
||||
[8]: https://opensource.com/users/jhibbets
|
||||
[9]: https://opensource.com/users/bbehrens
|
||||
[10]: https://github.com/open-organization/open-org-definition
|
||||
[11]: https://opensource.com/users/laurahilliger
|
||||
[12]: https://opensource.com/open-organization/15/9/learn-from-co-ops
|
||||
[13]: https://opensource.com/open-organization/17/11/transparency-collaboration-basefarm
|
||||
[14]: https://opensource.com/open-organization/19/4/education-culture-agile
|
||||
[15]: https://github.com/open-organization/governance/wiki
|
||||
[16]: https://github.com/open-organization/governance/wiki/Community-Roles
|
||||
[17]: https://github.com/open-organization
|
||||
[18]: https://opensource.com/life/14/5/codes-of-conduct-open-source-communities
|
||||
[19]: https://github.com/open-organization/governance/issues/9
|
@ -1,64 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Talk, then code)
|
||||
[#]: via: (https://dave.cheney.net/2019/02/18/talk-then-code)
|
||||
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
|
||||
|
||||
Talk, then code
|
||||
======
|
||||
|
||||
The open source projects that I contribute to follow a philosophy which I describe as _talk, then code_. I think this is generally a good way to develop software and I want to spend a little time talking about the benefits of this methodology.
|
||||
|
||||
### Avoiding hurt feelings
|
||||
|
||||
The most important reason for discussing the change you want to make is it avoids hurt feelings. Often I see a contributor work hard in isolation on a pull request only to find their work is rejected. This can be for a bunch of reasons; the PR is too large, the PR doesn’t follow the local style, the PR fixes an issue which wasn’t important to the project or was recently fixed indirectly, and many more.
|
||||
|
||||
The underlying cause of all these issues is a lack of communication. The goal of the _talk, then code_ philosophy is not to impede or frustrate, but to ensure that a feature lands correctly the first time, without incurring significant maintenance debt, and neither the author of the change, or the reviewer, has to carry the emotional burden of dealing with hurt feelings when a change appears out of the blue with an implicit “well, I’ve done the work, all you have to do is merge it, right?”
|
||||
|
||||
### What does discussion look like?
|
||||
|
||||
Every new feature or bug fix should be discussed with the maintainer(s) of the project before work commences. It’s fine to experiment privately, but do not send a change without discussing it first.
|
||||
|
||||
The definition of _talk_ for simple changes can be as little as a design sketch in a GitHub issue. If your PR fixes a bug, you should link to the bug it fixes. If there isn’t one, you should raise a bug and wait for the maintainers to acknowledge it before sending a PR. This might seem a little backward–who wouldn’t want a bug fixed–but consider the bug could be a misunderstanding in how the software works or it could be a symptom of a larger problem that needs further investigation.
|
||||
|
||||
For more complicated changes, especially feature requests, I recommend that a design document be circulated and agreed upon before sending code. This doesn’t have to be a full blown document, a sketch in an issue may be sufficient, but the key is to reach agreement using words, before locking it in stone with code.
|
||||
|
||||
In all cases you shouldn’t proceed to send code until there is a positive agreement from the maintainer that the approach is one they are happy with. A pull request is for life, not just for Christmas.
|
||||
|
||||
### Code review, not design by committee
|
||||
|
||||
A code review is not the place for arguments about design. This is for two reasons. First, most code review tools are not suitable for long comment threads, GitHub’s PR interface is very bad at this, Gerrit is better, but few have a team of admins to maintain a Gerrit instance. More importantly, disagreements at the code review stage suggests there wasn’t agreement on how the change should be implemented.
|
||||
|
||||
* * *
|
||||
|
||||
Talk about what you want to code, then code what you talked about. Please don’t do it the other way around.
|
||||
|
||||
### Related posts:
|
||||
|
||||
1. [How to include C code in your Go package][1]
|
||||
2. [Let’s talk about logging][2]
|
||||
3. [The value of TDD][3]
|
||||
4. [Suggestions for contributing to an Open Source project][4]
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://dave.cheney.net/2019/02/18/talk-then-code
|
||||
|
||||
作者:[Dave Cheney][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://dave.cheney.net/author/davecheney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://dave.cheney.net/2013/09/07/how-to-include-c-code-in-your-go-package (How to include C code in your Go package)
|
||||
[2]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging (Let’s talk about logging)
|
||||
[3]: https://dave.cheney.net/2016/04/11/the-value-of-tdd (The value of TDD)
|
||||
[4]: https://dave.cheney.net/2016/03/12/suggestions-for-contributing-to-an-open-source-project (Suggestions for contributing to an Open Source project)
|
@ -1,203 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to install Python on Windows)
|
||||
[#]: via: (https://opensource.com/article/19/8/how-install-python-windows)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/greg-p)
|
||||
|
||||
How to install Python on Windows
|
||||
======
|
||||
Install Python, run an IDE, and start coding right from your Microsoft
|
||||
Windows desktop.
|
||||
![Hands programming][1]
|
||||
|
||||
So you want to learn to program? One of the most common languages to start with is [Python][2], popular for its unique blend of [object-oriented][3] structure and simple syntax. Python is also an _interpreted_ _language_, meaning you don't need to learn how to compile code into machine language: Python does that for you, allowing you to test your programs sometimes instantly and, in a way, while you write your code.
|
||||
|
||||
Just because Python is easy to learn doesn't mean you should underestimate its potential power. Python is used by [movie][4] [studios][5], financial institutions, IT houses, video game studios, makers, hobbyists, [artists][6], teachers, and many others.
|
||||
|
||||
On the other hand, Python is also a serious programming language, and learning it takes dedication and practice. Then again, you don't have to commit to anything just yet. You can install and try Python on nearly any computing platform, so if you're on Windows, this article is for you.
|
||||
|
||||
If you want to try Python on a completely open source operating system, you can [install Linux][7] and then [try Python][8].
|
||||
|
||||
### Get Python
|
||||
|
||||
Python is available from its website, [Python.org][9]. Once there, hover your mouse over the **Downloads** menu, then over the **Windows** option, and then click the button to download the latest release.
|
||||
|
||||
![Downloading Python on Windows][10]
|
||||
|
||||
Alternatively, you can click the **Downloads** menu button and select a specific version from the downloads page.
|
||||
|
||||
### Install Python
|
||||
|
||||
Once the package is downloaded, open it to start the installer.
|
||||
|
||||
It is safe to accept the default install location, and it's vital to add Python to PATH. If you don't add Python to your PATH, then Python applications won't know where to find Python (which they require in order to run). This is _not_ selected by default, so activate it at the bottom of the install window before continuing!
|
||||
|
||||
![Select "Add Python 3 to PATH"][11]
|
||||
|
||||
Before Windows allows you to install an application from a publisher other than Microsoft, you must give your approval. Click the **Yes** button when prompted by the **User Account Control** system.
|
||||
|
||||
![Windows UAC][12]
|
||||
|
||||
Wait patiently for Windows to distribute the files from the Python package into the appropriate locations, and when it's finished, you're done installing Python.
|
||||
|
||||
Time to play.
|
||||
|
||||
### Install an IDE
|
||||
|
||||
To write programs in Python, all you really need is a text editor, but it's convenient to have an integrated development environment (IDE). An IDE integrates a text editor with some friendly and helpful Python features. IDLE 3 and NINJA-IDE are two options to consider.
|
||||
|
||||
#### IDLE 3
|
||||
|
||||
Python comes with an IDE called IDLE. You can write code in any text editor, but using an IDE provides you with keyword highlighting to help detect typos, a **Run** button to test code quickly and easily, and other code-specific features that a plain text editor like [Notepad++][13] normally doesn't have.
|
||||
|
||||
To start IDLE, click the **Start** (or **Window**) menu and type **python** for matches. You may find a few matches, since Python provides more than one interface, so make sure you launch IDLE.
|
||||
|
||||
![IDLE 3 IDE][14]
|
||||
|
||||
If you don't see Python in the Start menu, launch the Windows command prompt by typing **cmd** in the Start menu, then type:
|
||||
|
||||
|
||||
```
|
||||
`C:\Windows\py.exe`
|
||||
```
|
||||
|
||||
If that doesn't work, try reinstalling Python. Be sure to select **Add Python to PATH** in the install wizard. Refer to the [Python docs][15] for detailed instructions.
|
||||
|
||||
#### Ninja-IDE
|
||||
|
||||
If you already have some coding experience and IDLE seems too simple for you, try [Ninja-IDE][16]. Ninja-IDE is an excellent Python IDE. It has keyword highlighting to help detect typos, quotation and parenthesis completion to avoid syntax errors, line numbers (helpful when debugging), indentation markers, and a **Run** button to test code quickly and easily.
|
||||
|
||||
![Ninja-IDE][17]
|
||||
|
||||
To install it, visit the Ninja-IDE website and [download the Windows installer][18]. The process is the same as with Python: start the installer, allow Windows to install a non-Microsoft application, and wait for the installer to finish.
|
||||
|
||||
Once Ninja-IDE is installed, double-click the Ninja-IDE icon on your desktop or select it from the Start menu.
|
||||
|
||||
### Tell Python what to do
|
||||
|
||||
Keywords tell Python what you want it to do. In either IDLE or Ninja-IDE, go to the File menu and create a new file.
|
||||
|
||||
Ninja users: Do not create a new project, just a new file.
|
||||
|
||||
In your new, empty file, type this into IDLE or Ninja-IDE:
|
||||
|
||||
|
||||
```
|
||||
`print("Hello world.")`
|
||||
```
|
||||
|
||||
* If you are using IDLE, go to the Run menu and select the Run Module option.
|
||||
* If you are using Ninja, click the Run File button in the left button bar.
|
||||
|
||||
|
||||
|
||||
![Running code in Ninja-IDE][19]
|
||||
|
||||
Any time you run code, your IDE prompts you to save the file you're working on. Do that before continuing.
|
||||
|
||||
The keyword **print** tells Python to print out whatever text you give it in parentheses and quotes.
|
||||
|
||||
That's not very exciting, though. At its core, Python has access to only basic keywords like **print** and **help**, basic math functions, and so on.
|
||||
|
||||
Use the **import** keyword to load more keywords. Start a new file in IDLE or Ninja and name it **pen.py**.
|
||||
|
||||
**Warning**: Do not call your file **turtle.py**, because **turtle.py** is the name of the file that contains the turtle program you are controlling. Naming your file **turtle.py** confuses Python because it thinks you want to import your own file.
|
||||
|
||||
Type this code into your file and run it:
|
||||
|
||||
|
||||
```
|
||||
`import turtle`
|
||||
```
|
||||
|
||||
[Turtle][20] is a fun module to use. Add this code to your file:
|
||||
|
||||
|
||||
```
|
||||
turtle.begin_fill()
|
||||
turtle.forward(100)
|
||||
turtle.left(90)
|
||||
turtle.forward(100)
|
||||
turtle.left(90)
|
||||
turtle.forward(100)
|
||||
turtle.left(90)
|
||||
turtle.forward(100)
|
||||
turtle.end_fill()
|
||||
```
|
||||
|
||||
See what shapes you can draw with the turtle module.
|
||||
|
||||
To clear your turtle drawing area, use the **turtle.clear()** keyword. What do you think the keyword **turtle.color("blue")** does?
|
||||
|
||||
Try more complex code:
|
||||
|
||||
|
||||
```
|
||||
import turtle as t
|
||||
import time
|
||||
|
||||
t.color("blue")
|
||||
t.begin_fill()
|
||||
|
||||
counter = 0
|
||||
|
||||
while counter < 4:
|
||||
t.forward(100)
|
||||
t.left(90)
|
||||
counter = counter+1
|
||||
|
||||
t.end_fill()
|
||||
time.sleep(2)
|
||||
```
|
||||
|
||||
As a challenge, try changing your script to get this result:
|
||||
|
||||
![Example Python turtle output][21]
|
||||
|
||||
Once you complete that script, you're ready to move on to more exciting modules. A good place to start is this [introductory dice game][22].
|
||||
|
||||
### Stay Pythonic
|
||||
|
||||
Python is a fun language with modules for practically anything you can think to do with it. As you can see, it's easy to get started with Python, and as long as you're patient with yourself, you may find yourself understanding and writing Python code with the same fluidity as you write your native language. Work through some [Python articles][23] here on Opensource.com, try scripting some small tasks for yourself, and see where Python takes you. To really integrate Python with your daily workflow, you might even try Linux, which is natively scriptable in ways no other operating system is. You might find yourself, given enough time, using the applications you create!
|
||||
|
||||
Good luck, and stay Pythonic.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/8/how-install-python-windows
|
||||
|
||||
作者:[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/sethhttps://opensource.com/users/greg-p
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming)
|
||||
[2]: https://www.python.org/
|
||||
[3]: https://opensource.com/article/19/7/get-modular-python-classes
|
||||
[4]: https://github.com/edniemeyer/weta_python_db
|
||||
[5]: https://www.python.org/about/success/ilm/
|
||||
[6]: https://opensource.com/article/19/7/rgb-cube-python-scribus
|
||||
[7]: https://opensource.com/article/19/7/ways-get-started-linux
|
||||
[8]: https://opensource.com/article/17/10/python-101
|
||||
[9]: https://www.python.org/downloads/
|
||||
[10]: https://opensource.com/sites/default/files/uploads/win-python-install.jpg (Downloading Python on Windows)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/win-python-path.jpg (Select "Add Python 3 to PATH")
|
||||
[12]: https://opensource.com/sites/default/files/uploads/win-python-publisher.jpg (Windows UAC)
|
||||
[13]: https://notepad-plus-plus.org/
|
||||
[14]: https://opensource.com/sites/default/files/uploads/idle3.png (IDLE 3 IDE)
|
||||
[15]: http://docs.python.org/3/using/windows.html
|
||||
[16]: http://ninja-ide.org/
|
||||
[17]: https://opensource.com/sites/default/files/uploads/win-python-ninja.jpg (Ninja-IDE)
|
||||
[18]: http://ninja-ide.org/downloads/
|
||||
[19]: https://opensource.com/sites/default/files/uploads/ninja_run.png (Running code in Ninja-IDE)
|
||||
[20]: https://opensource.com/life/15/8/python-turtle-graphics
|
||||
[21]: https://opensource.com/sites/default/files/uploads/win-python-idle-turtle.jpg (Example Python turtle output)
|
||||
[22]: https://opensource.com/article/17/10/python-101#python-101-dice-game
|
||||
[23]: https://opensource.com/sitewide-search?search_api_views_fulltext=Python
|
@ -1,169 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Cockpit and the evolution of the Web User Interface)
|
||||
[#]: via: (https://fedoramagazine.org/cockpit-and-the-evolution-of-the-web-user-interface/)
|
||||
[#]: author: (Shaun Assam https://fedoramagazine.org/author/sassam/)
|
||||
|
||||
Cockpit and the evolution of the Web User Interface
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Over 3 years ago the Fedora Magazine published an article entitled [Cockpit: an overview][2]. Since then, the interface has see some eye-catching changes. Today’s Cockpit is cleaner and the larger fonts makes better use of screen real-estate.
|
||||
|
||||
This article will go over some of the changes made to the UI. It will also explore some of the general tools available in the web interface to simplify those monotonous sysadmin tasks.
|
||||
|
||||
### Cockpit installation
|
||||
|
||||
Cockpit can be installed using the **dnf install cockpit** command. This provides a minimal setup providing the basic tools required to use the interface.
|
||||
|
||||
Another option is to install the Headless Management group. This will install additional packages used to extend the usability of Cockpit. It includes extensions for NetworkManager, software packages, disk, and SELinux management.
|
||||
|
||||
Run the following commands to enable the web service on boot and open the firewall port:
|
||||
|
||||
```
|
||||
$ sudo systemctl enable --now cockpit.socket
|
||||
Created symlink /etc/systemd/system/sockets.target.wants/cockpit.socket -> /usr/lib/systemd/system/cockpit.socket
|
||||
|
||||
$ sudo firewall-cmd --permanent --add-service cockpit
|
||||
success
|
||||
$ sudo firewall-cmd --reload
|
||||
success
|
||||
```
|
||||
|
||||
### Logging into the web interface
|
||||
|
||||
To access the web interface, open your favourite browser and enter the server’s domain name or IP in the address bar followed by the service port (9090). Because Cockpit uses HTTPS, the installation will create a self-signed certificate to encrypt passwords and other sensitive data. You can safely accept this certificate, or request a CA certificate from your sysadmin or a trusted source.
|
||||
|
||||
Once the certificate is accepted, the new and improved login screen will appear. Long-time users will notice the username and password fields have been moved to the top. In addition, the white background behind the credential fields immediately grabs the user’s attention.
|
||||
|
||||
![][3]
|
||||
|
||||
A feature added to the login screen since the previous article is logging in with **sudo** privileges — if your account is a member of the wheel group. Check the box beside _Reuse my password for privileged tasks_ to elevate your rights.
|
||||
|
||||
Another edition to the login screen is the option to connect to remote servers also running the Cockpit web service. Click _Other Options_ and enter the host name or IP address of the remote machine to manage it from your local browser.
|
||||
|
||||
### Home view
|
||||
|
||||
Right off the bat we get a basic overview of common system information. This includes the make and model of the machine, the operating system, if the system is up-to-date, and more.
|
||||
|
||||
![][4]
|
||||
|
||||
Clicking the make/model of the system displays hardware information such as the BIOS/Firmware. It also includes details about the components as seen with **lspci**.
|
||||
|
||||
![][5]
|
||||
|
||||
Clicking on any of the options to the right will display the details of that device. For example, the _% of CPU cores_ option reveals details on how much is used by the user and the kernel. In addition, the _Memory & Swap_ graph displays how much of the system’s memory is used, how much is cached, and how much of the swap partition active. The _Disk I/O_ and _Network Traffic_ graphs are linked to the Storage and Networking sections of Cockpit. These topics will be revisited in an upcoming article that explores the system tools in detail.
|
||||
|
||||
#### Secure Shell Keys and authentication
|
||||
|
||||
Because security is a key factor for sysadmins, Cockpit now has the option to view the machine’s MD5 and SHA256 key fingerprints. Clicking the **Show fingerprints** options reveals the server’s ECDSA, ED25519, and RSA fingerprint keys.
|
||||
|
||||
![][6]
|
||||
|
||||
You can also add your own keys by clicking on your username in the top-right corner and selecting **Authentication**. Click on **Add keys** to validate the machine on other systems. You can also revoke your privileges in the Cockpit web service by clicking on the **X** button to the right.
|
||||
|
||||
![][7]
|
||||
|
||||
#### Changing the host name and joining a domain
|
||||
|
||||
Changing the host name is a one-click solution from the home page. Click the host name currently displayed, and enter the new name in the _Change Host Name_ box. One of the latest features is the option to provide a _Pretty name_.
|
||||
|
||||
Another feature added to Cockpit is the ability to connect to a directory server. Click _Join a domain_ and a pop-up will appear requesting the domain address or name, organization unit (optional), and the domain admin’s credentials. The Domain Membership group provides all the packages required to join an LDAP server including FreeIPA, and the popular Active Directory.
|
||||
|
||||
To opt-out, click on the domain name followed by _Leave Domain_. A warning will appear explaining the changes that will occur once the system is no longer on the domain. To confirm click the red _Leave Domain_ button.
|
||||
|
||||
![][8]
|
||||
|
||||
#### Configuring NTP and system date and time
|
||||
|
||||
Using the command-line and editing config files definitely takes the cake when it comes to maximum tweaking. However, there are times when something more straightforward would suffice. With Cockpit, you have the option to set the system’s date and time manually or automatically using NTP. Once synchronized, the information icon on the right turns from red to blue. The icon will disappear if you manually set the date and time.
|
||||
|
||||
To change the timezone, type the continent and a list of cities will populate beneath.
|
||||
|
||||
![][9]
|
||||
|
||||
#### Shutting down and restarting
|
||||
|
||||
You can easily shutdown and restart the server right from home screen in Cockpit. You can also delay the shutdown/reboot and send a message to warn users.
|
||||
|
||||
![][10]
|
||||
|
||||
#### Configuring the performance profile
|
||||
|
||||
If the _tuned_ and _tuned-utils_ packages are installed, performance profiles can be changed from the main screen. By default it is set to a recommended profile. However, if the purpose of the server requires more performance, we can change the profile from Cockpit to suit those needs.
|
||||
|
||||
![][11]
|
||||
|
||||
### Terminal web console
|
||||
|
||||
A Linux sysadmin’s toolbox would be useless without access to a terminal. This allows admins to fine-tune the server beyond what’s available in Cockpit. With the addition of themes, admins can quickly adjust the text and background colours to suit their preference.
|
||||
|
||||
Also, if you type **exit** by mistake, click the _Reset_ button in the top-right corner*.* This will provide a fresh screen with a flashing cursor.
|
||||
|
||||
![][12]
|
||||
|
||||
### Adding a remote server and the Dashboard overlay
|
||||
|
||||
The Headless Management group includes the Dashboard module (**cockpit-dashboard**). This provides an overview the of the CPU, memory, network, and disk performance in a real-time graph. Remote servers can also be added and managed through the same interface.
|
||||
|
||||
For example, to add a remote computer in Dashboard, click the **+** button. Enter the name or IP address of the server and select the colour of your choice. This helps to differentiate the stats of the servers in the graph. To switch between servers, click on the host name (as seen in the screen-cast below). To remove a server from the list, click the check-mark icon, then click the red trash icon. The example below demonstrates how Cockpit manages a remote machine named _server02.local.lan_.
|
||||
|
||||
![][13]
|
||||
|
||||
### Documentation and finding help
|
||||
|
||||
As always, the _man_ pages are a great place to find documentation. A simple search in the command-line results with pages pertaining to different aspects of using and configuring the web service.
|
||||
|
||||
```
|
||||
$ man -k cockpit
|
||||
cockpit (1) - Cockpit
|
||||
cockpit-bridge (1) - Cockpit Host Bridge
|
||||
cockpit-desktop (1) - Cockpit Desktop integration
|
||||
cockpit-ws (8) - Cockpit web service
|
||||
cockpit.conf (5) - Cockpit configuration file
|
||||
```
|
||||
|
||||
The Fedora repository also has a package called **cockpit-doc**. The package’s description explains it best:
|
||||
|
||||
> The Cockpit Deployment and Developer Guide shows sysadmins how to deploy Cockpit on their machines as well as helps developers who want to embed or extend Cockpit.
|
||||
|
||||
For more documentation visit <https://cockpit-project.org/external/source/HACKING>
|
||||
|
||||
### Conclusion
|
||||
|
||||
This article only touches upon some of the main functions available in Cockpit. Managing storage devices, networking, user account, and software control will be covered in an upcoming article. In addition, optional extensions such as the 389 directory service, and the _cockpit-ostree_ module used to handle packages in Fedora Silverblue.
|
||||
|
||||
The options continue to grow as more users adopt Cockpit. The interface is ideal for admins who want a light-weight interface to control their server(s).
|
||||
|
||||
What do you think about Cockpit? Share your experience and ideas in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/cockpit-and-the-evolution-of-the-web-user-interface/
|
||||
|
||||
作者:[Shaun Assam][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/sassam/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-816x345.jpg
|
||||
[2]: https://fedoramagazine.org/cockpit-overview/
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-login-screen.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-home-screen.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-system-info.gif
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-ssh-key-fingerprints.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-authentication.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-hostname-domain.gif
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-date-time.png
|
||||
[10]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-power-options.gif
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-tuned.gif
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-terminal.gif
|
||||
[13]: https://fedoramagazine.org/wp-content/uploads/2019/08/cockpit-add-remote-servers.gif
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (jrglinux)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,124 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (6 open source alternatives to Wunderlist)
|
||||
[#]: via: (https://opensource.com/article/20/5/alternatives-list)
|
||||
[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike)
|
||||
|
||||
6 open source alternatives to Wunderlist
|
||||
======
|
||||
Love lists? Check out this handy list of open source apps for managing
|
||||
all your lists!
|
||||
![a checklist for a team][1]
|
||||
|
||||
Wunderlist is an app for lists, loved by many, but gone for good as of May 6, 2020. The website encourages existing users to download and use Microsoft To Do in its place. That's tempting because it makes it easy to import all of those lists you've made over the years. Then again, maybe it's a chance to _Marie Kondo_ those lists and pare things down. Do you really need 30 lists? (Apparently, I've decided that I do, so I won't judge.)
|
||||
|
||||
I have lists for all sorts of things, from "Plants for the garden 2020" to "Gifts for the husband." Some are checklists, some are To Do lists, and some are lists for list's sake.
|
||||
|
||||
For my husband and me, the most useful list is our shared grocery list. We both have the app on our phones, we both add things to the list, we review it together but separately on our phones before he goes shopping (yes, you read that correctly), and he checks things off as he puts them in the cart. It makes the whole thing surprisingly efficient, and I think we save some money because we're into sticking to THE LIST.
|
||||
|
||||
While its users loved it, Wunderlist isn't entirely unique. There are a gazillion list apps out there. With Wunderlist, I've specifically enjoyed its combination of simplicity and design, and that it managed to implement useful features like sharing and collaboration with others, dynamics checkboxes for lists, and a great user experience across both mobile and web interfaces. I've also enjoyed using it for a list that isn't an "active" document: a list I don't review weekly or make regular progress on—like my many lists I've used for brainstorming an idea (including that novel I've been meaning to write...).
|
||||
|
||||
From the many wonderful articles we've published over the years, I've curated a list of open source alternatives to Wunderlist that may work for your needs, from simple task management and to-do lists to complex note-taking and process management. Or, if you are that person scribbling tasks and notes on paper scraps and post-it notes that are lying... er, around somewhere and everywhere... this might be a good time to try one of these digital options out.
|
||||
|
||||
### Tasks—works with OwnCloud
|
||||
|
||||
> Tasks is a free and open source app you can install from [F-droid][2]. Tasks is a mobile-only application, but it's extremely flexible in what it can sync to. You can save your lists to NextCloud or OwnCloud, Google Tasks, Apple Reminders, and just about any CalDAV server you have an account on.
|
||||
>
|
||||
> The default view of Tasks is a daily view, so any task you enter is assumed to be a task from today onward. If you're like me and you want to maintain several unique lists, you can do that with Tags. When you create a tag, you create a category for tasks. You can assign a colour and an icon so each list of tasks is unique.
|
||||
>
|
||||
> It takes a little getting used to, but tagging has many advantages. Because all tasks are tagged, you can view groups of tasks by clicking the tag you want to filter for, but you can also filter by day and even by place. That means that when you go grocery shopping, your grocery list becomes the active default list, and your everyday life list becomes active again when you return home.
|
||||
>
|
||||
> By syncing your data to one of your online accounts, you can share lists with loved ones, collaborators, and colleagues.
|
||||
>
|
||||
> Another great feature is that if you the same tasks every morning when you get to work, or the same 20 items in your weekly grocery list, you can create tasks that repeat on a regular basis.
|
||||
|
||||
Reviewed by Seth Kenlon
|
||||
|
||||
![Screenshot of Tasks interface][3]
|
||||
|
||||
### OpenTasks—best for long lists
|
||||
|
||||
> [OpenTasks][4] is an excellent task management tool for creating individual tasks with a wide variety of settings. It supports a wide range of fields when creating a task, ranging from basic things, such as name and description, to more complex items, such as choosing if the task is private, public, or confidential. The biggest thing that sets OpenTasks apart from the alternatives is its use of tabs on the app's main screen. These tabs quickly allow you to see the tasks due, tasks starting soon, tasks sorted by priority, and tasks sorted by current progress towards completion. Many of the other apps support doing things like these, but OpenTasks quickly easily accesses these lists.
|
||||
|
||||
[Read the full OpenTasks review][5] by Joshua Allen Holm
|
||||
|
||||
![OpenTasks in Google Play store][6]
|
||||
|
||||
### Mirakel—great for nested lists
|
||||
|
||||
> [Mirakel][7] is a task management app with a modern user interface and support for just about every format you might want in such a program. At Mirakel's basic level, it supports multiple lists, which are referred to as "meta lists." Creating an individual task has a plethora of options with deadlines, reminders, progress tracking, tags, notes, sub-tasks, and file attachments, all comprising a part of a task's entry.
|
||||
|
||||
[Read the full Mirakel review][5] by Joshua Allen Holm
|
||||
|
||||
![Screenshot from website of Mirakel app][8]
|
||||
|
||||
### Todo—simple and effective, works anywhere
|
||||
|
||||
> [Todo.txt][9] is one of the two to-do list and task management apps that I keep coming back to over and over again (the other is Org mode). And what keeps me coming back is that it is simple, portable, understandable, and has many great add-ons that don't break it if one machine has them and the others don't. And since it is a Bash shell script, I have never found a system that cannot support it. Read more about [how to install and use Todo.txt][10].
|
||||
|
||||
[Read the full todo.txt review][10] by Kevin Sonney
|
||||
|
||||
![Drop-down menu for Todo.txt][11]
|
||||
|
||||
Drop-down menu for Todo.txt
|
||||
|
||||
### Joplin—best for private lists
|
||||
|
||||
> [Joplin][12] is a NodeJS application that runs and stores information locally, allows you to encrypt your tasks and supports multiple sync methods. Joplin can run as a console or graphical application on Windows, Mac, and Linux. Joplin also has mobile apps for Android and iOS, meaning you can take your notes with you without a major hassle. Joplin even allows you to format your notes with Markdown, HTML, or plain text.
|
||||
|
||||
[Read the full Joplin review][13] by Kevin Sonney
|
||||
|
||||
![Joplin graphical version ][14]
|
||||
|
||||
### CherryTree—great alternative to Evernote / OneNote / Keep
|
||||
|
||||
> [CherryTree][15] is a GPLv3-licensed application that organizes information in nodes. Each node can have child nodes, allowing you to easily organize your lists and thoughts. And, child nodes can have their own children with independent properties.
|
||||
|
||||
[Read the full CherryTree review][16] by Ben Cotton
|
||||
|
||||
![CherryTree's hierarchical note layout][17]
|
||||
|
||||
### Bonus: Wekan—for fans of Kanban
|
||||
|
||||
> Kanban boards are a mainstay of today's agile processes. And many of us (myself included) use them to organize not just our work but also our personal lives. I know several artists who use apps like Trello to keep track of their commission lists as well as what's in progress and what's complete. But these apps are often linked to a work account or a commercial service. Enter [Wekan][18], an open source kanban board you can run locally or on the service of your choice. Wekan offers much of the same functionality as other Kanban apps, such as creating boards, lists, swimlanes, and cards, dragging and dropping between lists, assigning to users, labeling cards, and doing pretty much everything else you'd expect in a modern kanban board.
|
||||
|
||||
[Read the full Wekan review][19]* by Kevin Sonney*
|
||||
|
||||
![Wekan kanban board][20]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/alternatives-list
|
||||
|
||||
作者:[Jen Wike Huger][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/jen-wike
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team)
|
||||
[2]: https://f-droid.org/en/packages/org.tasks/
|
||||
[3]: https://opensource.com/sites/default/files/uploads/screenshot_tasks_resized.jpg (Screenshot of Tasks interface)
|
||||
[4]: https://play.google.com/store/apps/details?id=org.dmfs.tasks
|
||||
[5]: https://opensource.com/article/17/1/task-management-time-tracking-android
|
||||
[6]: https://opensource.com/sites/default/files/uploads/opentasks_rezied.jpg (OpenTasks in Google Play store)
|
||||
[7]: https://mirakel.azapps.de/
|
||||
[8]: https://opensource.com/sites/default/files/uploads/mirakel_web_resized.jpg (Screenshot from website of Mirakel app)
|
||||
[9]: http://todotxt.org/
|
||||
[10]: https://opensource.com/article/20/1/open-source-to-do-list
|
||||
[11]: https://opensource.com/sites/default/files/uploads/todo.txtmenu_3.png (Drop-down menu for Todo.txt)
|
||||
[12]: https://joplin.cozic.net/
|
||||
[13]: https://opensource.com/article/19/1/productivity-tool-joplin
|
||||
[14]: https://opensource.com/sites/default/files/uploads/joplin-1.png (Joplin graphical version )
|
||||
[15]: https://www.giuspen.com/cherrytree/
|
||||
[16]: https://opensource.com/article/19/5/cherrytree-notetaking
|
||||
[17]: https://opensource.com/sites/default/files/uploads/cherrytree.png (CherryTree's hierarchical note layout)
|
||||
[18]: https://wekan.github.io/
|
||||
[19]: https://opensource.com/article/19/1/productivity-tool-wekan
|
||||
[20]: https://opensource.com/sites/default/files/uploads/wekan-board.png (Wekan kanban board)
|
@ -1,157 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Ubuntu Cinnamon Remix 20.04 Review: The Perfect Blend of Ubuntu With Cinnamon)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-cinnamon-remix-review/)
|
||||
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
|
||||
|
||||
Ubuntu Cinnamon Remix 20.04 Review: The Perfect Blend of Ubuntu With Cinnamon
|
||||
======
|
||||
|
||||
GNOME 3 was introduced in 2011, and the GNOME Shell immediately generated both positive and negative responses. Many users and developers liked the original GNOME interface enough that a few groups forked it and one of those, Linux Mint team, created the [Cinnamon desktop environment][1].
|
||||
|
||||
The Cinnamon desktop became the identity of Linux Mint. For years, Cinnamon has been synonymous to [Linux Mint][2]. It has changed slightly in the past few years as the popularity for Cinnamon grew. Now other distributions have also started offering Cinnamon desktop environment. [Manjaro][3] is one such example.
|
||||
|
||||
A few months back, we introduced you to a [new Ubuntu flavor that provides an out of the box Cinnamon desktop experience][4]. let’s take a deeper look at [Ubuntu Cinnamon Remix][5] today.
|
||||
|
||||
### Why Ubuntu Cinnamon Remix and not Linux Mint?
|
||||
|
||||
It is true that Linux Mint is based on Ubuntu and Many Linux Mint users will have the question: Does it make any sense to switch over to Ubuntu as Linux Mint is such a mature project and the user experience will remain more or less the same?
|
||||
|
||||
Ubuntu Cinnamon Remix has a number of small differences from Linux Mint, but has has one key difference that a Linux enthusiast can’t ignore.
|
||||
|
||||
Linux Mint is based on “LTS” (Long-Term Support) versions of Ubuntu, meaning it stays behind the Canonical’s 6-month update cadence. Ubuntu Cinnamon Remix benefits from a newer kernel to other 6-month cycle feature upgrade and more recent software.
|
||||
|
||||
Another key difference is that Ubuntu Cinnamon Remix will “inherit” [Snap support][6], and Linux Mint embraces [FlatPak][7]. Ubuntu Cinnamon Remix uses Ubuntu Software Center instead of Mint Software Manager.
|
||||
|
||||
That said, I am a huge fan of Cinnamon. So I chose to review this mix of Ubuntu and Cinnamon and here I share my experience with it.
|
||||
|
||||
### Experiencing Ubuntu Cinnamon Remix
|
||||
|
||||
By any chance given, I will always mention how fast [Calamares installer][8] is and thanks to Ubuntu Cinnamon Remix Team for choosing so.
|
||||
|
||||
![Calamares Installer][9]
|
||||
|
||||
A fresh installation of Ubuntu Cinnamon Remix consumes approximately 750 MB of RAM. This is very similar to Linux Mint Cinnamon.
|
||||
|
||||
![An idle Cinnamon takes 750 MB of RAM][10]
|
||||
|
||||
I was also impressed by the beautiful [Kimmo theme][11] and the orange toned Ubuntu wallpaper which seems to be a result of a very meticulous effort.
|
||||
|
||||
![Ubuntu Cinammon Remix 20.04 Desktop][12]
|
||||
|
||||
#### Enough tools to get you started
|
||||
|
||||
As with any other Ubuntu distribution, Ubuntu Cinnamon Remix is packed with the essential productivity tools, to name a few:
|
||||
|
||||
* Firefox Web Browser
|
||||
* Thunderbird – Email Client
|
||||
* LibreOffice suite
|
||||
* Celluloid – Multimedia player
|
||||
* [GIMP][13] – Image processing software
|
||||
* Synaptic Package Manager
|
||||
* Gnome Software Center
|
||||
* [Gparted][14] – Partition Manager
|
||||
|
||||
|
||||
|
||||
Using Ubuntu Cinnamon Remix as my main runner for a few days, fulfilled my high expectations. Ubuntu is rock-solid stable, very fast and I didn’t face a single issue at my day to day tasks.
|
||||
|
||||
#### Ubuntu for Linux Mint Lovers
|
||||
|
||||
Are you enthusiastic about Ubuntu Cinnamon but got used to Linux Mint theme? Click below to see how you can get a full Linux Mint theme pack and how to configure it to keep the Ubuntu heritage.
|
||||
|
||||
Give Ubuntu Cinnamon Remix the real Mint touch
|
||||
|
||||
Firstly you have to download and unpack the following, easily done via terminal.
|
||||
|
||||
**Get the Linux Mint-X icon pack**
|
||||
|
||||
```
|
||||
wget http://packages.linuxmint.com/pool/main/m/mint-x-icons/mint-x-icons_1.5.5_all.deb
|
||||
```
|
||||
|
||||
**Get the Linux Mint-Y icon pack**
|
||||
|
||||
```
|
||||
wget http://packages.linuxmint.com/pool/main/m/mint-y-icons/mint-y-icons_1.3.9_all.deb
|
||||
```
|
||||
|
||||
**Get the Linux Mint Themes**
|
||||
|
||||
```
|
||||
wget http://packages.linuxmint.com/pool/main/m/mint-themes/mint-themes_1.8.4_all.deb
|
||||
```
|
||||
|
||||
**Install the downloaded content**
|
||||
|
||||
```
|
||||
sudo dpkg -i ./mint-x-icons_1.5.5_all.deb ./mint-y-icons_1.3.9_all.deb ./mint-themes_1.8.4_all.deb
|
||||
```
|
||||
|
||||
When done, click on the Menu button at the bottom left corner and type themes. You can also find themes in system settings.
|
||||
|
||||
![Accessing Themes][15]
|
||||
|
||||
Once opened replace the kimmo icons and theme as shown below. The Linux Mint default “Green” is the plain Mint-Y but the orange colour is a perfect selection for Ubuntu.
|
||||
|
||||
![Linux Mint Theme Settings][16]
|
||||
|
||||
#### A treat for Cinnamon fans
|
||||
|
||||
Let’s accept it, aesthetics are important. Cinnamon has a clean and elegant look, easy to read fonts and nice colour contrast themes. Cinnamon offers an uncluttered desktop with easily configured desktop icons simply by accessing the Desktop menu under System Settings. You can also choose the desktop icons to be shown only on the primary monitor, only on secondary monitor, or on both. This also applies to a beyond two monitor setup.
|
||||
|
||||
![Ubuntu Cinnamon Remix Desklets][17]
|
||||
|
||||
Desklets and applets are small, single-purpose applications that can be added to your desktop or your panel respectively. The most commonly used among the many you can choose are CPU or resources monitor, a weather applet, sticky notes, and calendar.
|
||||
|
||||
The Cinnamon Control Center provides centralized access to many of the desktop configuration options. By accessing the themes section you can choose the desktop basic scheme and icons, window borders, mouse pointers, and controls look. Fonts can have a great impact on the overall desktop look and cinnamon makes the change easier than ever.
|
||||
|
||||
The Cinnamon Control Center makes the configuration simple enough for a new user, compared to KDE Plasma that can lead a new user to confusion, due to the massive number of configuration options.
|
||||
|
||||
![][18]
|
||||
|
||||
The Cinnamon Panel contains the menu used to launch programs, a basic system tray, and an application selector. The panel is easy to configure and adding new program launchers is simply done by locating the program you want to add in the main Menu, right click on the icon and select “Add to panel.” You can also add the launcher icon to the desktop, and to the Cinnamon “Favourites” launcher bar. If you don’t like the order of the icons at your panel, just right click at the panel bar, enter panel’s Edit mode and rearrange the icons.
|
||||
|
||||
#### **Conclusions**
|
||||
|
||||
Whether you decide to “spice” up your desktop or thinking to move from [Windows to Linux][19], the Cinnamon Community has made plenty of spices for you.
|
||||
|
||||
Traditional yet elegant, customizable but simple, Ubuntu Cinnamon Remix is an interesting project with a promising future, and for existing fans of the Cinnamon Desktop who love Ubuntu, this is probably a no-brainer.
|
||||
|
||||
What do you think of Ubuntu Cinnamon Remix? Have you used it already?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-cinnamon-remix-review/
|
||||
|
||||
作者:[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://en.wikipedia.org/wiki/Cinnamon_(desktop_environment)
|
||||
[2]: https://www.linuxmint.com/
|
||||
[3]: https://manjaro.org/
|
||||
[4]: https://itsfoss.com/ubuntudde/
|
||||
[5]: https://ubuntucinnamon.org/
|
||||
[6]: https://snapcraft.io/
|
||||
[7]: https://flatpak.org/
|
||||
[8]: https://calamares.io/
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/Calamares-Installer.png?resize=800%2C426&ssl=1
|
||||
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/htop-running-on-Ubuntu-Cinnamon-Remix-20.04.png?ssl=1
|
||||
[11]: https://github.com/Ubuntu-Cinnamon-Remix/kimmo-gtk-theme
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-Cinammon-Remix-20.04-desktop.png?resize=800%2C450&ssl=1
|
||||
[13]: https://itsfoss.com/gimp-2-10-release/
|
||||
[14]: https://itsfoss.com/gparted/
|
||||
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/accessing-themes.png?ssl=1
|
||||
[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/Linux-Mint-theme-settings.png?ssl=1
|
||||
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-cinnamon-remix-desklets.jpg?fit=800%2C450&ssl=1
|
||||
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-cinnamon-control.jpg?fit=800%2C450&ssl=1
|
||||
[19]: https://itsfoss.com/windows-like-linux-distributions/
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (HankChow)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,177 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Ubuntu Budgie 20.04 Review: Smooth, Polished & Plenty of Changes)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-budgie-20-04-review/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
Ubuntu Budgie 20.04 Review: Smooth, Polished & Plenty of Changes
|
||||
======
|
||||
|
||||
As we promised our readers, we’ll be reviewing all major flavors of [Ubuntu 20.04 LTS release][1]. In that continuation, here’s our take on the Ubuntu Budgie.
|
||||
|
||||
![Ubuntu Budgie Desktop][2]
|
||||
|
||||
[Ubuntu Budgie][3], as the name implies, is an [official flavor of Ubuntu][4] using the [Budgie desktop environment][5]. This flavor is a newer member of the Ubuntu family. Ubuntu Budgie’s first release was 16.04 and it was accepted as an official flavor with the 17.04 release.
|
||||
|
||||
Their [goal][6] is to “combine the simplicity and elegance of the Budgie interface to produce a traditional desktop orientated distro with a modern paradigm”.
|
||||
|
||||
### Ubuntu 20.04 Review: What has changed and what has not!
|
||||
|
||||
There have been a surprising number of updates and improvements to [Ubuntu Budgie since the 18.04 LTS release][7].
|
||||
|
||||
* New stylish menu apple
|
||||
* Budgie-based network manager applet as default
|
||||
* New Window Shuffler allows you to tile applications from the keyboard
|
||||
* New tool to quickly switch desktop layout
|
||||
* 4k resolution support
|
||||
* GNOME Firmware and Drawing are new default applications
|
||||
* Backport packages have now been rebuilt for 20.04
|
||||
* Firefox is the default browser.
|
||||
* Catfish file and text search is now the default
|
||||
* budgie-nemo integration
|
||||
* System Tray applet removed due to bugs
|
||||
* Event alerts sounds are disabled by default
|
||||
* Fix for keyboard shortcuts mysteriously going missing
|
||||
* Better lock screen styling
|
||||
* Files (Nautilus) has been replaced with Files (Nemo) due to community demand
|
||||
* Plank dock has now been switched to the bottom of the screen, is transparent and has the bounce animations by default
|
||||
* The Quick Notes and Hot Corners applets have been ported from Python to Vala to improve speed
|
||||
* Celluloid replaces MPV
|
||||
* GNOME dependencies have been updated
|
||||
|
||||
|
||||
|
||||
![][8]
|
||||
|
||||
Ubuntu Budgie now ships with the most recent release of the Budgie desktop environment (10.5.1). Improvements include:
|
||||
|
||||
* New Raven section in Budgie Desktop Settings
|
||||
* Raven Notification grouping and the ability to turn off notifications
|
||||
* Icon Task List has been revamped
|
||||
* Ability to set number of virtual desktops
|
||||
|
||||
|
||||
|
||||
Ubuntu Budgie comes with a whole slew of Budgie applets and min-apps. They can be installed through Ubuntu Budgie Welcome.
|
||||
|
||||
![Ubuntu Budgie Welcome][9]
|
||||
|
||||
* WeatherShow – shows the forecast for the next five days and updates every 3 hours
|
||||
* Wallstreet – a wallpaper utility that allows you to cycle through a folder of images
|
||||
* Visual-space – a compact workspace switcher
|
||||
* Dropby – this applet allows you to quickly manage USB thumb drives from the panel
|
||||
* Kangaroo – quickly browser folders from the panel
|
||||
* Trash applet – manage your trash can
|
||||
* Fuzzyclock – shows time in a fuzzy way
|
||||
* Workspace stopwatch – allows you to keep track of the time spent in each workspace
|
||||
|
||||
|
||||
|
||||
For a complete list of changes and updates, visit the [changelog][10].
|
||||
|
||||
#### System Requirements
|
||||
|
||||
Ubuntu Budgie 20.04 has updated the [system requirements][11]:
|
||||
|
||||
* 4GB or more of RAM
|
||||
* 64-bit capable Intel and AMD processors
|
||||
* UEFI PCs booting in CSM mode
|
||||
* Modern Intel-based Apple Macs
|
||||
|
||||
|
||||
|
||||
As you can see, Budgie is not really a lightweight option here.
|
||||
|
||||
#### Included Apps
|
||||
|
||||
![][12]
|
||||
|
||||
The following useful applications are included in Ubuntu Budgie by default:
|
||||
|
||||
* AisleRiot Solitaire
|
||||
* Geary
|
||||
* Catfish search tool
|
||||
* Cheese webcam tool
|
||||
* GNOME Drawing
|
||||
* GNOME 2048
|
||||
* GNOME Mahjongg
|
||||
* GNOME Mines
|
||||
* GNOME Sudoku
|
||||
|
||||
|
||||
* Gthumb
|
||||
* LibreOffice
|
||||
* Maps
|
||||
* Rhythmbox
|
||||
* Tilix
|
||||
* Ubuntu Budgie Welcome
|
||||
* Evince document viewer
|
||||
* Plank
|
||||
* Celluloid
|
||||
|
||||
|
||||
|
||||
![Ubuntu Budgie Ram Usage][13]
|
||||
|
||||
### Installation
|
||||
|
||||
Initially, I was unable to get Ubuntu Budgie to do into the live environment so that I could install it. It turned out that Ubuntu Budgie was trying to boot via EFI. I contacted the [Ubuntu Budgie forum][14] and was able to get a solution.
|
||||
|
||||
Once the purple splash screen I had to hit ESC and select legacy. After that, it booted as normal and installed without issue. I have only run into this issue with Ubuntu Budgie. I downloaded and tried the Ubuntu MATE 20.04 ISO, but didn’t have a similar issue.
|
||||
|
||||
### Experience with Ubuntu Budgie 20.04
|
||||
|
||||
![][15]
|
||||
|
||||
Other than the minor installation issue, my time with Ubuntu Budgie was very pleasant. The Budgie desktop has come a long way since [Ikey][16] first created it and it has become a very mature option. The goal of Ubuntu Budgie is to “produce a traditional desktop orientated distro”. It does that in spades. All the changes that they have made continually add more polish to their product.
|
||||
|
||||
Overall, Ubuntu Budgie is a very nice looking distro. From the default theme to wallpaper options, you can tell that a lot of effort was put into making the visual experience very appealing.
|
||||
|
||||
One thing to keep in mind is that Ubuntu Budgie is not intended for low spec systems. I’m running it on my Dell Latitude D630. Without any applications open, it used about 700 MB of RAM.
|
||||
|
||||
One part of Ubuntu Budgie that I enjoyed more than I should have, was the inclusion of the [Tilix terminal emulator][17]. Tilix allows you to add terminal windows to the right or below. It has a whole host of features and just loved using it. I’m planning to install on my other Linux systems.
|
||||
|
||||
### Final Thoughts on Ubuntu Budgie 20.04
|
||||
|
||||
Ubuntu Budgie is a welcome addition to the litany of official flavors. Budgie feels very smooth and polished. It gets out of your way and lets you get work done.
|
||||
|
||||
If you are tired of your current desktop environment and want to take a look at something new, check it out. If you’re happy with your current setup, check Ubuntu Budgie’s live DVD. You just might like it.
|
||||
|
||||
![Ubuntu Budgie About][18]
|
||||
|
||||
Have you already tried Ubuntu 20.04 Budgie? How’s your experience with it? If not, which Ubuntu 20.04 flavor are you using right now?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-budgie-20-04-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/download-ubuntu-20-04/
|
||||
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-busgie-desktop.png?resize=800%2C500&ssl=1
|
||||
[3]: https://ubuntubudgie.org/
|
||||
[4]: https://itsfoss.com/which-ubuntu-install/
|
||||
[5]: https://en.wikipedia.org/wiki/Budgie_(desktop_environment
|
||||
[6]: https://ubuntubudgie.org/about-us/
|
||||
[7]: https://itsfoss.com/ubuntu-budgie-18-review/
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-desktop-settings.jpeg?ssl=1
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-welcome.png?resize=800%2C472&ssl=1
|
||||
[10]: https://ubuntubudgie.org/2020/04/21/ubuntu-budgie-20-04lts-release-notes-for-18-04-upgraders/
|
||||
[11]: https://ubuntubudgie.org/downloads/
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-applications.jpeg?ssl=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-ram-usage.png?resize=800%2C600&ssl=1
|
||||
[14]: https://discourse.ubuntubudgie.org/t/cant-get-ub-to-boot/3397
|
||||
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-20-04.jpg?ssl=1
|
||||
[16]: https://itsfoss.com/ikey-doherty-serpent-interview/
|
||||
[17]: https://gnunn1.github.io/tilix-web/
|
||||
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/ubuntu-budgie-about.png?resize=800%2C648&ssl=1
|
@ -1,173 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Ubuntu MATE 20.04 LTS Review: Better Than Ever)
|
||||
[#]: via: (https://itsfoss.com/ubuntu-mate-20-04-review/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Ubuntu MATE 20.04 LTS Review: Better Than Ever
|
||||
======
|
||||
|
||||
Ubuntu MATE 20.04 LTS is undoubtedly one of the most popular [official flavors of Ubuntu][1].
|
||||
|
||||
It’s not just me, but [Ubuntu 20.04 survey results][2] also pointed out the same. Popular or not, it is indeed an impressive Linux distribution specially for older hardware. As a matter of fact, it is also one of the [best lightweight Linux distros][3] available out there.
|
||||
|
||||
So, I thought of trying it out for a while in a virtual machine setting to provide you an overview of what you can expect out of it. And, whether it’s worth trying out.
|
||||
|
||||
### What’s New In Ubuntu MATE 20.04 LTS?
|
||||
|
||||
[Subscribe to our YouTube channel for more Linux videos][4]
|
||||
|
||||
The primary highlight on Ubuntu MATE 20.04 LTS would be the addition of MATE Desktop 1.24.
|
||||
|
||||
You can expect all the new features of the MATE Desktop 1.24 to come packed in with Ubuntu MATE 20.04. In addition to that, there have been many significant changes, improvements, and additions.
|
||||
|
||||
Here’s an overview of what has changed in Ubuntu MATE 20.04:
|
||||
|
||||
* Addition of MATE Desktop 1.24
|
||||
* Numerous visual improvements
|
||||
* Dozens of bugs fixed
|
||||
* Based on [Linux Kernel 5.4][5] series
|
||||
* Addition of experimental [ZFS][6] support
|
||||
* Addition of GameMode from [Feral Interactive][7].
|
||||
* Several package updates
|
||||
|
||||
|
||||
|
||||
Now, to get a better idea on Ubuntu MATE 20.04, I’ll give you some more details.
|
||||
|
||||
### User Experience Improvements
|
||||
|
||||
![][8]
|
||||
|
||||
Considering that more users are leaning towards Linux on Desktop, the user experience plays a vital role in that.
|
||||
|
||||
If it’s something easy to use and pleasant to look at that makes all the difference as the first impression.
|
||||
|
||||
With Ubuntu MATE 20.04 LTS, I wasn’t disappointed either. Personally, I’m a fan of the latest [GNOME 3.36][9]. I like it on my [Pop OS 20.04][10] but with the presence of [MATE 1.24][11], it Ubuntu MATE was also a good experience.
|
||||
|
||||
You will see some significant changes to the window manager including the addition of **invisible resize borders**, **icons rendering in HiDPI**, **rework of ALT+TAB workspace switcher pop ups**, and a couple of other changes that comes as part of the latest MATE 1.24 desktop.
|
||||
|
||||
![][12]
|
||||
|
||||
Also, **MATE Tweak** has got some sweet improvements where you get to preserve user preferences even if you change the layout of the desktop. The new **MATE Welcome screen** also informs the user about the ability to change the desktop layout, so they don’t have to fiddle around to know about it.
|
||||
|
||||
Among other things, one of my favorite additions would be the **minimized app preview feature**.
|
||||
|
||||
For instance, you have an app minimized but want to get a preview of it before launching it – now you can do that by simply hovering your mouse over the taskbar as shown in the image below.
|
||||
|
||||
![][13]
|
||||
|
||||
Now, I must mention that it does not work as expected for every application. So, I’d still say **this feature is buggy and needs improvements**.
|
||||
|
||||
### App Additions or Upgrades
|
||||
|
||||
![][14]
|
||||
|
||||
With MATE 20.04, you will notice a new **Firmware updater** which is a GTK frontend for [fwupd][15]. You can manage your drivers easily using the updater.
|
||||
|
||||
This release also **replaces** **Thunderbird with the Evolution** email client. While [Thunderbird][16] is a quite popular desktop email client, [Evolution][17] integrates better with the MATE desktop and proves to be more useful.
|
||||
|
||||
![][18]
|
||||
|
||||
Considering that we have MATE 1.24 on board, you will also find a **new time and date manager app**. Not just that, if you need a magnifier, [Magnus][19] comes baked in with Ubuntu MATE 20.04.
|
||||
|
||||
![][20]
|
||||
|
||||
Ubuntu MATE 20.04 also includes upgrades to numerous packages/apps that come pre-installed.
|
||||
|
||||
![][21]
|
||||
|
||||
While these are small additions – but help in a big way to make the distro more useful.
|
||||
|
||||
### Linux Kernel 5.4
|
||||
|
||||
Ubuntu MATE 20.04 ships with the last major stable kernel release of 2019 i.e [Linux Kernel 5.4][5].
|
||||
|
||||
With this, you will be getting the native [exFAT support][22] and improved hardware support as well. Not to mention, the support for [WireGuard][23] VPN is also a nice thing to have.
|
||||
|
||||
So, you will be noticing numerous benefits of Linux Kernel 5.4 including the kernel lock down feature. In case you’re curious, you can read our coverage on [Linux Kernel 5.4][5] to get more details on it.
|
||||
|
||||
### Adding GameMode by Feral Interactive
|
||||
|
||||
Feral Interactive – popularly known for bringing games to Linux platform came up with a useful command-line tool i.e. [GameMode][7].
|
||||
|
||||
You won’t get a GUI – but using the command-line you can apply temporary system optimizations before launching a game.
|
||||
|
||||
While this may not make a big difference for every system but it’s best to have more resources available for gaming and the GameMode ensures that you get the necessary optimizations.
|
||||
|
||||
### Experimental ZFS Install Option
|
||||
|
||||
You get the support for ZFS as your root file system. It is worth noting that it is an experimental feature and should not be used if you’re not sure what you’re doing.
|
||||
|
||||
To get a better idea of ZFS, I recommend you reading one of our articles on [What is ZFS][6] by [John Paul][24].
|
||||
|
||||
### Performance & Other Improvements
|
||||
|
||||
Ubuntu MATE is perfectly tailored as a lightweight distro and also something fit for modern desktops.
|
||||
|
||||
![][25]
|
||||
|
||||
In this case, I didn’t run any specific benchmark tools- but for an average user, I didn’t find any performance issues in my virtual machine setting. If it helps, I tested this on a host system with an i5-7400 processor with a GTX 1050 graphics card coupled with 16 Gigs of RAM. And, 7 GB of RAM + 768 MB of graphics memory + 2 cores of my processor was allocated for the virtual machine.
|
||||
|
||||
![][26]
|
||||
|
||||
When you test it out yourself, feel free to let me know how it was for you.
|
||||
|
||||
Overall, along with all the major improvements, there are subtle changes/fixes/improvements here and there that makes Ubuntu MATE 20.04 LTS a good upgrade.
|
||||
|
||||
### Should You Upgrade?
|
||||
|
||||
If you are running Ubuntu MATE 19.10, you should proceed upgrading it immediately as the support for it ends in **June 2020.**
|
||||
|
||||
For Ubuntu MATE 18.04 users (**supported until April 2021**) – it depends on what works for you. If you need the features of the latest release, you should choose to upgrade it immediately.
|
||||
|
||||
But, if you don’t necessarily need the new stuff, you can look around for the [list of existing bugs][27] and join the [Ubuntu MATE community][28] to know more about the issues revolving the latest release.
|
||||
|
||||
Once you do the research needed, you can then proceed to upgrade your system to Ubuntu MATE 20.04 LTS which will be **supported until April 2023**.
|
||||
|
||||
_**Have you tried the latest Ubuntu MATE 20.04 yet? What do you think about it? Let me know your thoughts in the comments.**_
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/ubuntu-mate-20-04-review/
|
||||
|
||||
作者:[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://itsfoss.com/which-ubuntu-install/
|
||||
[2]: https://ubuntu.com/blog/ubuntu-20-04-survey-results
|
||||
[3]: https://itsfoss.com/lightweight-linux-beginners/
|
||||
[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
|
||||
[5]: https://itsfoss.com/linux-kernel-5-4/
|
||||
[6]: https://itsfoss.com/what-is-zfs/
|
||||
[7]: https://github.com/FeralInteractive/gamemode
|
||||
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-20-04.jpg?ssl=1
|
||||
[9]: https://itsfoss.com/gnome-3-36-release/
|
||||
[10]: https://itsfoss.com/pop-os-20-04-review/
|
||||
[11]: https://mate-desktop.org/blog/2020-02-10-mate-1-24-released/
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-desktop-layout.png?ssl=1
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-minimized-app.png?ssl=1
|
||||
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-20-04-firmware.png?ssl=1
|
||||
[15]: https://fwupd.org
|
||||
[16]: https://www.thunderbird.net/en-US/
|
||||
[17]: https://wiki.gnome.org/Apps/Evolution
|
||||
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-evolution.png?ssl=1
|
||||
[19]: https://kryogenix.org/code/magnus/
|
||||
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-magnus.jpg?ssl=1
|
||||
[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-apps.png?ssl=1
|
||||
[22]: https://cloudblogs.microsoft.com/opensource/2019/08/28/exfat-linux-kernel/
|
||||
[23]: https://wiki.ubuntu.com/WireGuard
|
||||
[24]: https://itsfoss.com/author/john/
|
||||
[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-system-reosource.jpg?ssl=1
|
||||
[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-mate-focal-neofetch.png?ssl=1
|
||||
[27]: https://bugs.launchpad.net/ubuntu-mate
|
||||
[28]: https://ubuntu-mate.community/
|
@ -1,356 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Simplify data visualization in Python with Plotly)
|
||||
[#]: via: (https://opensource.com/article/20/5/plotly-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
|
||||
Simplify data visualization in Python with Plotly
|
||||
======
|
||||
Plotly is a data plotting library with a clean interface designed to
|
||||
allow you to build your own APIs.
|
||||
![Colorful sound wave graph][1]
|
||||
|
||||
Plotly is a plotting ecosystem that allows you to make plots in [Python][2], as well as JavaScript and R. In this series of articles, I'm focusing on [plotting with Python libraries][3].
|
||||
|
||||
Plotly has three different Python APIs, giving you a choice of how to drive it:
|
||||
|
||||
* An [object-oriented API][4] that feels similar to Matplotlib
|
||||
* A [data-driven API][5] that specifies plots by constructing dictionaries of JSON-like data
|
||||
* A ["Plotly Express" API][6] that gives you high-level plotting functions similar to Seaborn
|
||||
|
||||
|
||||
|
||||
I'll explore each of these APIs by making the same plot in each one: a grouped bar plot of historical UK election results.
|
||||
|
||||
### Making plots using Graph Objects
|
||||
|
||||
Plotly's object-oriented API is named graph_objects. It's somewhat similar to [Matplotlib's object-oriented API][7].
|
||||
|
||||
To create a multi-bar plot, you can construct a figure object containing four bar plots:
|
||||
|
||||
|
||||
```
|
||||
# Import Plotly and our data
|
||||
import plotly.graph_objects as go
|
||||
from votes import wide as df
|
||||
|
||||
# Get a convenient list of x-values
|
||||
years = df['year']
|
||||
x = list(range(len(years)))
|
||||
|
||||
# Specify the plots
|
||||
bar_plots = [
|
||||
go.Bar(x=x, y=df['conservative'], name='Conservative', marker=go.bar.Marker(color='#0343df')),
|
||||
go.Bar(x=x, y=df['labour'], name='Labour', marker=go.bar.Marker(color='#e50000')),
|
||||
go.Bar(x=x, y=df['liberal'], name='Liberal', marker=go.bar.Marker(color='#ffff14')),
|
||||
go.Bar(x=x, y=df['others'], name='Others', marker=go.bar.Marker(color='#929591')),
|
||||
]
|
||||
|
||||
# Specify the layout
|
||||
layout = go.Layout(
|
||||
title=go.layout.Title(text="Election results", x=0.5),
|
||||
yaxis_title="Seats",
|
||||
xaxis_tickmode="array",
|
||||
xaxis_tickvals=list(range(27)),
|
||||
xaxis_ticktext=tuple(df['year'].values),
|
||||
)
|
||||
|
||||
# Make the multi-bar plot
|
||||
fig = go.Figure(data=bar_plots, layout=layout)
|
||||
|
||||
# Tell Plotly to render it
|
||||
fig.show()
|
||||
```
|
||||
|
||||
Unlike in Matplotlib, there's no need to calculate the x-positions of the bars manually; Plotly takes care of that for you.
|
||||
|
||||
Here's the final plot:
|
||||
|
||||
![A multi-bar plot made using Graph Objects][8]
|
||||
|
||||
A multi-bar plot made using Graph Objects (© 2019 [Anvil][9])
|
||||
|
||||
### Making plots using Python data structures
|
||||
|
||||
You can also specify your plot using basic Python data structures with the same structure as the object-oriented API. This corresponds directly to the JSON API for Plotly's JavaScript implementation.
|
||||
|
||||
|
||||
```
|
||||
# Specify the plots
|
||||
fig = {
|
||||
'data': [
|
||||
{'type': 'bar', 'x': x, 'y': df['conservative'], 'name': 'Conservative', 'marker': {'color': '#0343df'}},
|
||||
{'type': 'bar', 'x': x, 'y': df['labour'], 'name': 'Labour', 'marker': {'color': '#e50000'}},
|
||||
{'type': 'bar', 'x': x, 'y': df['liberal'], 'name': 'Liberal', 'marker': {'color': '#ffff14'}},
|
||||
{'type': 'bar', 'x': x, 'y': df['others'], 'name': 'Others', 'marker': {'color': '#929591'}},
|
||||
],
|
||||
'layout': {
|
||||
'title': {'text': 'Election results', 'x': 0.5},
|
||||
'yaxis': {'title': 'Seats'},
|
||||
'xaxis': {
|
||||
'tickmode': 'array',
|
||||
'tickvals': list(range(27)),
|
||||
'ticktext': tuple(df['year'].values),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Tell Plotly to render it
|
||||
pio.show(fig)
|
||||
```
|
||||
|
||||
The final plot looks exactly the same as the previous plot:
|
||||
|
||||
![A multi-bar plot made using JSON-like data structures][10]
|
||||
|
||||
A multi-bar plot made using JSON-like data structures (© 2019 [Anvil][9])
|
||||
|
||||
### Making plots using Plotly Express
|
||||
|
||||
[Plotly Express][11] is a high-level API that wraps Graph Objects.
|
||||
|
||||
You can make a multi-bar plot in Plotly Express using (almost) a single line:
|
||||
|
||||
|
||||
```
|
||||
# Import Plotly and our data
|
||||
import plotly.express as px
|
||||
from votes import long as df
|
||||
|
||||
# Define the colourmap to get custom bar colours
|
||||
cmap = {
|
||||
'Conservative': '#0343df',
|
||||
'Labour': '#e50000',
|
||||
'Liberal': '#ffff14',
|
||||
'Others': '#929591',
|
||||
}
|
||||
|
||||
# Make the plot!
|
||||
fig = px.bar(df, x="year", y="seats", color="party", barmode="group", color_discrete_map=cmap)
|
||||
```
|
||||
|
||||
This makes use of the data in [Long Form][12], also known as "tidy data." The columns are year, party, and seats, rather than being split by party. It's very similar to making a multi-bar plot in [Seaborn][13].
|
||||
|
||||
|
||||
```
|
||||
>> print(long)
|
||||
year party seats
|
||||
0 1922 Conservative 344
|
||||
1 1923 Conservative 258
|
||||
2 1924 Conservative 412
|
||||
3 1929 Conservative 260
|
||||
4 1931 Conservative 470
|
||||
.. ... ... ...
|
||||
103 2005 Others 30
|
||||
104 2010 Others 29
|
||||
105 2015 Others 80
|
||||
106 2017 Others 59
|
||||
107 2019 Others 72
|
||||
|
||||
[108 rows x 3 columns]
|
||||
```
|
||||
|
||||
You can access the underlying Graph Objects API to make detailed tweaks. Add a title and a y-axis label:
|
||||
|
||||
|
||||
```
|
||||
# Use the Graph Objects API to tweak our plot
|
||||
import plotly.graph_objects as go
|
||||
fig.layout = go.Layout(
|
||||
title=go.layout.Title(text="Election results", x=0.5),
|
||||
yaxis_title="Seats",
|
||||
)
|
||||
```
|
||||
|
||||
And finally, ask Plotly to show it to you:
|
||||
|
||||
|
||||
```
|
||||
# Tell Plotly to render it
|
||||
fig.show()
|
||||
```
|
||||
|
||||
This runs a temporary web server on an unused port and opens the default web browser to view the plot (the webserver is immediately torn down).
|
||||
|
||||
Unfortunately, the result is not perfect. The x-axis is treated as an integer, so the groups are far apart and small. This makes it quite difficult to see trends.
|
||||
|
||||
![A multi-bar plot made using Plotly Express][14]
|
||||
|
||||
A multi-bar plot made using Plotly Express (© 2019 [Anvil][9])
|
||||
|
||||
You might try to encourage Plotly Express to treat the x-values as strings by casting them to strings. You might expect this to result in them being plotted with even spacing and lexical ordering. Unfortunately, you still get them helpfully spaced numerically. Setting the xaxis_tickvals does not work as it did in graph_objects, either.
|
||||
|
||||
Unlike the similar example in [Seaborn][13], in this case, the abstraction does not appear to provide sufficient [escape hatches][15] to provide things exactly how you want them. But perhaps you could write your _own_ API?
|
||||
|
||||
### Building your own Plotly API
|
||||
|
||||
Not happy with how Plotly does something? Build your own Plotly API!
|
||||
|
||||
At its core, Plotly is a JavaScript library that makes plots using [D3][16] and [stack.gl][17]. The JavaScript library has an interface that consumes JSON structures that specify plots. So you just need to output JSON structures that the JavaScript library likes to consume.
|
||||
|
||||
Anvil did that to create a Python Plotly API that works entirely in the browser.
|
||||
|
||||
![Plotly uses a JavaScript library to create plots, driven by libraries in other languages via JSON][18]
|
||||
|
||||
Plotly uses a JavaScript library to create plots, driven by libraries in other languages via JSON (© 2019 [Anvil][9])
|
||||
|
||||
In the Anvil version, you can use both the Graph Objects API and the Python data structure approach explained above. You run exactly the same commands, assigning the data and layout to a [Plot component][19] in your Anvil app.
|
||||
|
||||
Here's the multi-bar plot written in Anvil's client-side Python API:
|
||||
|
||||
|
||||
```
|
||||
# Import Anvil libraries
|
||||
from ._anvil_designer import EntrypointTemplate
|
||||
from anvil import *
|
||||
import anvil.server
|
||||
|
||||
# Import client-side Plotly
|
||||
import plotly.graph_objs as go
|
||||
|
||||
# This is an Anvil Form
|
||||
class Entrypoint(EntrypointTemplate):
|
||||
def __init__(self, **properties):
|
||||
# Set Form properties and Data Bindings.
|
||||
self.init_components(**properties)
|
||||
|
||||
# Fetch the data from the server
|
||||
data = anvil.server.call('get_election_data')
|
||||
|
||||
# Get a convenient list of x-values
|
||||
years = data['year']
|
||||
x = list(range(len(years)))
|
||||
|
||||
# Specify the plots
|
||||
bar_plots = [
|
||||
go.Bar(x=x, y=data['conservative'], name='Conservative', marker=go.Marker(color='#0343df')),
|
||||
go.Bar(x=x, y=data['labour'], name='Labour', marker=go.Marker(color='#e50000')),
|
||||
go.Bar(x=x, y=data['liberal'], name='Liberal', marker=go.Marker(color='#ffff14')),
|
||||
go.Bar(x=x, y=data['others'], name='Others', marker=go.Marker(color='#929591')),
|
||||
]
|
||||
# Specify the layout
|
||||
layout = {
|
||||
'title': 'Election results',
|
||||
'yaxis': {'title': 'Seats'},
|
||||
'xaxis': {
|
||||
'tickmode': 'array',
|
||||
'tickvals': list(range(27)),
|
||||
'ticktext': data['year'],
|
||||
},
|
||||
}
|
||||
|
||||
# Make the multi-bar plot
|
||||
self.plot_1.data = bar_plots
|
||||
self.plot_1.layout = layout
|
||||
```
|
||||
|
||||
The plotting logic is the same as above, but it's running _entirely in the web browser_—the plot is created by the Plotly JavaScript library on the user's machine! This is a big advantage over all the other [Python plotting libraries][3] in this series. All the other Python libraries need to run on a server.
|
||||
|
||||
Here's the interactive Plotly plot running in an Anvil app:
|
||||
|
||||
![The election plot on the web using Anvil's client-side-Python Plotly library][20]
|
||||
|
||||
The election plot on the web using Anvil's [client-side-Python][21] Plotly library (© 2019 [Anvil][9])
|
||||
|
||||
You can [copy this example][22] as an Anvil app (Note: Anvil requires registration to use).
|
||||
|
||||
Running Plotly in the frontend has another advantage: it opens up many more options for customizing interactive behavior.
|
||||
|
||||
### Customizing interactivity in Plotly
|
||||
|
||||
Plotly plots aren't just dynamic; you can customize their interactive behavior. For example, you can customize the format of tool-tips using hovertemplate in each bar plot:
|
||||
|
||||
|
||||
```
|
||||
go.Bar(
|
||||
x=x,
|
||||
y=df['others'],
|
||||
name='others',
|
||||
marker=go.bar.Marker(color='#929591'),
|
||||
hovertemplate='Seats: <b>%{y}</b>',
|
||||
),
|
||||
```
|
||||
|
||||
Here's what you get when you apply this to each bar plot:
|
||||
|
||||
![A multi-bar plot with custom tool-tips][23]
|
||||
|
||||
A multi-bar plot with custom tool-tips (© 2019 [Anvil][9])
|
||||
|
||||
This is useful, but it would be even better if you could execute any code you want when certain events happen—like when a user hovers over the bar and you want to display an information box about the relevant election. In Anvil's Plotly library, you can bind event handlers to events such as hover, which makes that sort of complex interactivity possible!
|
||||
|
||||
![A multi-bar plot with a hover event handler][24]
|
||||
|
||||
A multi-bar plot with a hover event handler (© 2019 [Anvil][9])
|
||||
|
||||
You can achieve this by binding a method to the plot's hover event:
|
||||
|
||||
|
||||
```
|
||||
def plot_1_hover(self, points, **event_args):
|
||||
"""This method is called when a data point is hovered."""
|
||||
i = points[0]['point_number']
|
||||
self.label_year.text = self.data['year'][i]
|
||||
self.label_con.text = self.data['conservative'][i]
|
||||
self.label_lab.text = self.data['labour'][i]
|
||||
self.label_lib.text = self.data['liberal'][i]
|
||||
self.label_oth.text = self.data['others'][i]
|
||||
url = f"<https://en.wikipedia.org/wiki/{self.data\['year'\]\[i\]}\_United\_Kingdom\_general\_election>"
|
||||
self.link_more_info.text = url
|
||||
self.link_more_info.url = url
|
||||
```
|
||||
|
||||
This is a rather extreme level of interactivity, and from the developer's point of view, an extreme level of customizability. It's all thanks to Plotly's architecture—Plotly has a clean interface that is explicitly designed to allow you to build your own APIs. It would be helpful to see this kind of great design everywhere!
|
||||
|
||||
### Custom interactivity using Bokeh
|
||||
|
||||
You've seen how Plotly uses JavaScript to create dynamic plots, and you can edit them live in the browser using Anvil's client-side Python code.
|
||||
|
||||
Bokeh is another Python plotting library that outputs an HTML document you can embed in a web app and get similar dynamic features to those provided by Plotly. (That's "BOE-kay," if you're wondering how to pronounce it.)
|
||||
|
||||
Enjoy customizing charts and share tips and tricks in the comments below.
|
||||
|
||||
* * *
|
||||
|
||||
_This article is based on [How to make plots using Plotly][9] on Anvil's blog and is reused with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/5/plotly-python
|
||||
|
||||
作者:[Shaun Taylor-Morgan][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/shaun-taylor-morgan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph)
|
||||
[2]: https://opensource.com/resources/python
|
||||
[3]: https://opensource.com/article/20/4/plot-data-python
|
||||
[4]: tmp.c4bQMTUIxx#GraphObjects
|
||||
[5]: tmp.c4bQMTUIxx#DataDrivenAPI
|
||||
[6]: tmp.c4bQMTUIxx#PlotlyExpress
|
||||
[7]: https://opensource.com/article/20/5/matplotlib-python
|
||||
[8]: https://opensource.com/sites/default/files/uploads/plotly.png (A multi-bar plot made using Graph Objects)
|
||||
[9]: https://anvil.works/blog/plotting-in-plotly
|
||||
[10]: https://opensource.com/sites/default/files/uploads/plotly-pio.png (A multi-bar plot made using JSON-like data structures)
|
||||
[11]: https://plot.ly/python/plotly-express/
|
||||
[12]: https://anvil.works/blog/tidy-data
|
||||
[13]: https://opensource.com/article/20/5/seaborn-visualization-python
|
||||
[14]: https://opensource.com/sites/default/files/uploads/plotly-express.png (A multi-bar plot made using Plotly Express)
|
||||
[15]: https://anvil.works/blog/escape-hatches-and-ejector-seats
|
||||
[16]: https://d3js.org/
|
||||
[17]: http://stack.gl/
|
||||
[18]: https://opensource.com/sites/default/files/uploads/plotly-arch.png (Plotly uses a JavaScript library to create plots, driven by libraries in other languages via JSON)
|
||||
[19]: https://anvil.works/docs/client/components/plots
|
||||
[20]: https://opensource.com/sites/default/files/uploads/plotting-in-anvil.gif (The election plot on the web using Anvil's client-side-Python Plotly library)
|
||||
[21]: https://anvil.works/docs/client/python
|
||||
[22]: https://anvil.works/login?app-name=Plotting%20in%20Plotly&app-author=shaun%40anvil.works
|
||||
[23]: https://opensource.com/sites/default/files/uploads/plotly-tooltips.png (A multi-bar plot with custom tool-tips)
|
||||
[24]: https://opensource.com/sites/default/files/uploads/plotly-event-handling.gif (A multi-bar plot with a hover event handler)
|
@ -1,311 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to write a VS Code extension)
|
||||
[#]: via: (https://opensource.com/article/20/6/vs-code-extension)
|
||||
[#]: author: (Ashique Hussain Ansari https://opensource.com/users/uidoyen)
|
||||
|
||||
How to write a VS Code extension
|
||||
======
|
||||
Add missing features by writing your own extension for the popular code
|
||||
editor.
|
||||
![woman on laptop sitting at the window][1]
|
||||
|
||||
Visual Studio Code (VS Code) is a cross-platform code editor created by Microsoft for Linux, Windows, and macOS. Unfortunately, Microsoft's version of [VS Code][2] is released under the [Microsoft Software License][3], which is not an open source license. However, the source code is open source, released under the MIT license, with releases distributed by the [VSCodium][4] project.
|
||||
|
||||
VSCodium, like VS Code, has support for extensions, embedded Git control, GitHub integration, syntax highlighting, debugging, intelligent code completion, snippets, and more. In other words, for most users there's no difference between using VS Code and VSCodium, and the latter is completely open source!
|
||||
|
||||
### What are VS Code extensions?
|
||||
|
||||
Extensions allow you to add capabilities to VS Code or VSCodium. You can install extensions in the GUI or from a terminal.
|
||||
|
||||
You can also build your own extensions. There are several reasons you might want to learn to build an extension:
|
||||
|
||||
1. **To add something:** If a feature you want is missing, you can create an extension to add it.
|
||||
2. **For fun and learning:** The extension API allows you to explore how VSCodium works, which is a fun thing to do.
|
||||
3. **To improve your skills:** Creating an extension enhances your programming skills.
|
||||
4. **For fame:** Creating an extension that is useful to others can increase your public profile.
|
||||
|
||||
|
||||
|
||||
### Install the tools
|
||||
|
||||
Before you begin, you must already have [Node.js][5], [npm][6], and VS Code or [VSCodium][4] installed.
|
||||
|
||||
To generate an extension, you will also need the following tools: [Yeoman][7], an open source client-side scaffolding tool that helps you kickstart new projects, and [vscode-generator-code][8], a Yeoman generator build created by the VS Code team.
|
||||
|
||||
### Build an extension
|
||||
|
||||
In this tutorial, you will build an extension that initializes a Docker image for an application.
|
||||
|
||||
#### Generate an extension skeleton
|
||||
|
||||
To install and run the Yeoman generator globally, enter the following in a command prompt or terminal:
|
||||
|
||||
|
||||
```
|
||||
`npm install -g yo generator-code`
|
||||
```
|
||||
|
||||
Navigate to the folder where you want to generate the extension, type the following command, and hit **Enter**:
|
||||
|
||||
|
||||
```
|
||||
`yo code`
|
||||
```
|
||||
|
||||
At the prompt, you must answer some questions about your extension:
|
||||
|
||||
* **What type of extension do you want to create?** Choose one of the options by using the Up and Down arrows. In this article, I will explain only the first one, **New Extension (TypeScript)**.
|
||||
* **What's the name of your extension?** Enter the name of your extension. Mine is called **initdockerapp**. (I am sure you will have a better name.)
|
||||
* **What's the identifier of your extension?** Leave this as it is.
|
||||
* **What's the description of your extension?** Write something about your extension (you can fill this in or edit it later, too).
|
||||
* **Initialize a Git repository?** This initializes a Git repository, and you can add `set-remote` later.
|
||||
* **Which package manager to use?** You can choose yarn or npm; I will use npm.
|
||||
|
||||
|
||||
|
||||
Hit the **Enter** key, and it will start installing the required dependencies. And finally:
|
||||
|
||||
> "Your extension **initdockerapp** has been created!"
|
||||
|
||||
Excellent!
|
||||
|
||||
### Check the project's structure
|
||||
|
||||
Examine what you generated and the project structure. Navigate to the new folder and type `cd initdockerapp` in your terminal.
|
||||
|
||||
Once you are in, type `.code`. It will open in your editor and look something like this:
|
||||
|
||||
![Project file structure in VSCodium][9]
|
||||
|
||||
(Hussain Ansari, [CC BY-SA 4.0][10])
|
||||
|
||||
The two most important files to pay attention to are `package.json` and `extension.ts` inside the `src` folder.
|
||||
|
||||
#### package.json
|
||||
|
||||
First, look at `package.json`, which should look something like this:
|
||||
|
||||
|
||||
```
|
||||
{
|
||||
"name": "initdockerapp",
|
||||
"displayName": "initdockerapp",
|
||||
"description": "",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.44.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:initdockerapp.initialize"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "initdockerapp.initialize",
|
||||
"title": "Initialize A Docker Application"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint src --ext ts",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"test": "node ./out/test/runTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.44.0",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^13.11.0",
|
||||
"eslint": "^6.8.0",
|
||||
"@typescript-eslint/parser": "^2.26.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
||||
"glob": "^7.1.6",
|
||||
"mocha": "^7.1.1",
|
||||
"typescript": "^3.8.3",
|
||||
"vscode-test": "^1.3.0"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "initdockerapp",
|
||||
"displayName": "initdockerapp",
|
||||
"description": "",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.44.0"
|
||||
},
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onCommand:initdockerapp.initialize"
|
||||
],
|
||||
"main": "./out/extension.js",
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "initdockerapp.initialize",
|
||||
"title": "Initialize A Docker Application"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"compile": "tsc -p ./",
|
||||
"lint": "eslint src --ext ts",
|
||||
"watch": "tsc -watch -p ./",
|
||||
"pretest": "npm run compile && npm run lint",
|
||||
"test": "node ./out/test/runTest.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/vscode": "^1.44.0",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/node": "^13.11.0",
|
||||
"eslint": "^6.8.0",
|
||||
"@typescript-eslint/parser": "^2.26.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
||||
"glob": "^7.1.6",
|
||||
"mocha": "^7.1.1",
|
||||
"typescript": "^3.8.3",
|
||||
"vscode-test": "^1.3.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you are a Node.js developer, some of this might look familiar since `name`, `description`, `version`, and `scripts` are common parts of a Node.js project.
|
||||
|
||||
There are a few sections that are very important.
|
||||
|
||||
* `engines`: States which version of VSCodium the extension will support
|
||||
* `categories`: Sets the extension type; you can choose from Languages, Snippets, Linters, Themes, Debuggers, Formatters, Keymaps, and Other
|
||||
* `contributes`: A list of commands that can be used to run with your extension
|
||||
* `main`: The entry point of your extension
|
||||
* `activationEvents`: Specifies when the activation event happens. Specifically, this dictates when the extension will be loaded into your editor. Extensions are lazy-loaded, so they aren't activated until an activation event occurs
|
||||
|
||||
|
||||
|
||||
#### src/extension.ts
|
||||
|
||||
Next, look at `src/extension.ts`, which should look something like this:
|
||||
|
||||
|
||||
```
|
||||
// The module 'vscode' contains the VSCodium extensibility API
|
||||
// Import the module and reference it with the alias vscode in your code below
|
||||
import * as vscode from "vscode";
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
// this method is called when your extension is activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
// Use the console to output diagnostic information (console.log) and errors (console.error)
|
||||
// This line of code will only be executed once when your extension is activated
|
||||
console.log('Congratulations, your extension "initdockerapp" is now active!');
|
||||
|
||||
// The command has been defined in the package.json file
|
||||
// Now provide the implementation of the command with registerCommand
|
||||
// The commandId parameter must match the command field in package.json
|
||||
let disposable = vscode.commands.registerCommand('initdockerapp.initialize', () => {
|
||||
// The code you place here will be executed every time your command is executed
|
||||
|
||||
let fileContent =`
|
||||
FROM node:alpine
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json .
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["npm", "start"]
|
||||
`;
|
||||
|
||||
fs.writeFile(path.join(vscode.workspace.rootPath, "Dockerfile"), fileContent, (err:any) => {
|
||||
if (err) {
|
||||
return vscode.window.showErrorMessage("Failed to initialize docker file!");
|
||||
}
|
||||
vscode.window.showInformationMessage("Dockerfile has been created!");
|
||||
});
|
||||
});
|
||||
|
||||
context.subscriptions.push(disposable);
|
||||
}
|
||||
|
||||
// this method is called when your extension is deactivated
|
||||
export function deactivate() {}
|
||||
```
|
||||
|
||||
This is where you write the code for your extension. There's already some auto-generated code, which I'll break down.
|
||||
|
||||
Notice that the name `initdockerapp.initialize` inside `vscode.command.registerCommand` is the same as the command in `package.json`. It takes two parameters:
|
||||
|
||||
1. The name of the command to register
|
||||
2. A function to execute a command
|
||||
|
||||
|
||||
|
||||
The other function to note is `fs.writeFile`, which you wrote inside the `vscode.command.registerCommand` function. This creates a dockerfile inside your project root, and appends the code to create a Docker image.
|
||||
|
||||
### Debug the extension
|
||||
|
||||
Now that you've written the extension, its time to debug it. Click the **Run** menu and select **Start Debugging** (or just press **F5**) to open a debugging window.
|
||||
|
||||
Open the project inside the debugging window by clicking on either the **Add Folder** or the **Clone Repository** button.
|
||||
|
||||
Next, open a command panel with **Ctrl+Shift+P** (on macOS, substitute the Command key for Ctrl) and run **Initialize A Docker Application**.
|
||||
|
||||
* The first time you run this command, the activate function has not been executed since VSCodium was launched. Therefore, activate is called, and the activate function registers the command.
|
||||
* If the command has already been registered, then it executes.
|
||||
|
||||
|
||||
|
||||
You'll see a message in the lower-right corner that says: "Dockerfile has been created!" This created a Dockerfile with some pre-defined code that looks something like this:
|
||||
|
||||
![Running the new extension command][11]
|
||||
|
||||
(Hussain Ansari, [CC BY-SA 4.0][10])
|
||||
|
||||
### Summary
|
||||
|
||||
There are many helpful APIs that will help you create the extensions you want to build. The VS Code extension API has many other powerful methods you can use.
|
||||
|
||||
You can learn more about VS Code APIs in the VS Code Extension API documentation.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/vs-code-extension
|
||||
|
||||
作者:[Ashique Hussain Ansari][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/uidoyen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
|
||||
[2]: https://code.visualstudio.com/
|
||||
[3]: https://code.visualstudio.com/license
|
||||
[4]: https://vscodium.com/
|
||||
[5]: https://nodejs.org/en/
|
||||
[6]: https://www.npmjs.com/
|
||||
[7]: https://yeoman.io/
|
||||
[8]: https://github.com/Microsoft/vscode-generator-code
|
||||
[9]: https://opensource.com/sites/default/files/uploads/vscode-tree.png (Project file structure in VSCodium)
|
||||
[10]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[11]: https://opensource.com/sites/default/files/uploads/vscode-run-command.png (Running the new extension command)
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (MjSeven)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,144 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Using pandas to plot data in Python)
|
||||
[#]: via: (https://opensource.com/article/20/6/pandas-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
|
||||
Using pandas to plot data in Python
|
||||
======
|
||||
Pandas is a hugely popular Python data manipulation library. Learn how
|
||||
to use its API to plot data.
|
||||
![Two pandas sitting in bamboo][1]
|
||||
|
||||
In this series of articles on Python-based plotting libraries, we're going to have a conceptual look at plots using pandas, the hugely popular Python data manipulation library. Pandas is a standard tool in Python for scalably transforming data, and it has also become a popular way to [import and export from CSV and Excel formats][2].
|
||||
|
||||
On top of all that, it also contains a very nice plotting API. This is extremely convenient—you already have your data in a pandas DataFrame, so why not use the same library to plot it?
|
||||
|
||||
In this series, we'll be making the same multi-bar plot in each library so we can compare how they work. The data we'll use is UK election results from 1966 to 2020:
|
||||
|
||||
![Matplotlib UK election results][3]
|
||||
|
||||
### Data that plots itself
|
||||
|
||||
Before we go further, note that you may need to tune your Python environment to get this code to run, including the following.
|
||||
|
||||
* Running a recent version of Python (instructions for [Linux][4], [Mac][5], and [Windows][6])
|
||||
* Verify you're running a version of Python that works with these libraries
|
||||
|
||||
|
||||
|
||||
The data is available online and can be imported using pandas:
|
||||
|
||||
|
||||
```
|
||||
import pandas as pd
|
||||
df = pd.read_csv('<https://anvil.works/blog/img/plotting-in-python/uk-election-results.csv>')
|
||||
```
|
||||
|
||||
Now we're ready to go. We've seen some impressively simple APIs in this series of articles, but pandas has to take the crown.
|
||||
|
||||
To plot a bar plot with a group for each party and `year` on the x-axis, I simply need to do this:
|
||||
|
||||
|
||||
```
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
ax = df.plot.bar(x='year')
|
||||
|
||||
plt.show()
|
||||
```
|
||||
|
||||
Four lines—definitely the tersest multi-bar plot we've created in this series.
|
||||
|
||||
I’m using my data in [wide form][7], meaning there’s one column per political party:
|
||||
|
||||
|
||||
```
|
||||
year conservative labour liberal others
|
||||
0 1966 253 364 12 1
|
||||
1 1970 330 287 6 7
|
||||
2 Feb 1974 297 301 14 18
|
||||
.. ... ... ... ... ...
|
||||
12 2015 330 232 8 80
|
||||
13 2017 317 262 12 59
|
||||
14 2019 365 202 11 72
|
||||
```
|
||||
|
||||
This means pandas automatically knows how I want my bars grouped, and if I wanted them grouped differently, pandas makes it easy to [restructure my DataFrame][8].
|
||||
|
||||
As with [Seaborn][9], pandas' plotting feature is an abstraction on top of Matplotlib, which is why you call Matplotlib's `plt.show()` function to actually produce the plot.
|
||||
|
||||
Here's what it looks like:
|
||||
|
||||
![pandas unstyled data plot][10]
|
||||
|
||||
Looks great, especially considering how easy it was! Let's style it to look just like the [Matplotlib][11] example.
|
||||
|
||||
#### Styling it
|
||||
|
||||
We can easily tweak the styling by accessing the underlying Matplotlib methods.
|
||||
|
||||
Firstly, we can color our bars by passing a Matplotlib colormap into the plotting function:
|
||||
|
||||
|
||||
```
|
||||
from matplotlib.colors import ListedColormap
|
||||
cmap = ListedColormap(['#0343df', '#e50000', '#ffff14', '#929591'])
|
||||
ax = df.plot.bar(x='year', colormap=cmap)
|
||||
```
|
||||
|
||||
And we can set up axis labels and titles using the return value of the plotting function—it's simply a [Matplotlib `Axis` object][12].
|
||||
|
||||
|
||||
```
|
||||
ax.set_xlabel(None)
|
||||
ax.set_ylabel('Seats')
|
||||
ax.set_title('UK election results')
|
||||
```
|
||||
|
||||
Here's what it looks like now:
|
||||
|
||||
![pandas styled plot][13]
|
||||
|
||||
That's pretty much identical to the Matplotlib version shown above but in 8 lines of code rather than 16! My inner [code golfer][14] is very pleased.
|
||||
|
||||
### Abstractions must be escapable
|
||||
|
||||
As with Seaborn, the ability to drop down and access Matplotlib APIs to do the detailed tweaking was really helpful. This is a great example of giving an abstraction [escape hatches][15] to make it powerful as well as simple.
|
||||
|
||||
* * *
|
||||
|
||||
_This article is based on [How to make plots using Pandas][16] on Anvil's blog and is reused with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/pandas-python
|
||||
|
||||
作者:[Shaun Taylor-Morgan][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/shaun-taylor-morgan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/panda.png?itok=0lJlct7O (Two pandas sitting in bamboo)
|
||||
[2]: https://anvil.works/docs/data-tables/csv-and-excel
|
||||
[3]: https://opensource.com/sites/default/files/uploads/matplotlib_2.png (Matplotlib UK election results)
|
||||
[4]: https://opensource.com/article/20/4/install-python-linux
|
||||
[5]: https://opensource.com/article/19/5/python-3-default-mac
|
||||
[6]: https://opensource.com/article/19/8/how-install-python-windows
|
||||
[7]: https://anvil.works/blog/tidy-data
|
||||
[8]: https://anvil.works/blog/tidy-data#converting-between-long-and-wide-data-in-pandas
|
||||
[9]: https://anvil.works/blog/plotting-in-seaborn
|
||||
[10]: https://opensource.com/sites/default/files/uploads/pandas-unstyled.png (pandas unstyled data plot)
|
||||
[11]: https://opensource.com/article/20/5/matplotlib-python
|
||||
[12]: https://matplotlib.org/api/axis_api.html#axis-objects
|
||||
[13]: https://opensource.com/sites/default/files/uploads/pandas_3.png (pandas styled plot)
|
||||
[14]: https://en.wikipedia.org/wiki/Code_golf
|
||||
[15]: https://anvil.works/blog/escape-hatches-and-ejector-seats
|
||||
[16]: https://anvil.works/blog/plotting-in-pandas
|
@ -1,174 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Using the Lightweight Apt Package Manager Synaptic in Ubuntu and Other Debian-based Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/synaptic-package-manager/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
Using the Lightweight Apt Package Manager Synaptic in Ubuntu and Other Debian-based Linux Distributions
|
||||
======
|
||||
|
||||
This week’s open source software highlight is Synaptic. Learn what this good old package manager can do that the modern software managers cannot.
|
||||
|
||||
### What is Synaptic package manager?
|
||||
|
||||
[Synaptic][1] is a lightweight GUI front end to [apt package management system][2] used in Debian, Ubuntu, Linux Mint and many other Debian/Ubuntu based distributions.
|
||||
|
||||
Basically, everything that you can do [using the apt-get commands in the terminal][3] can be achieved with Synaptic.
|
||||
|
||||
![][4]
|
||||
|
||||
There was a time when Synaptic was the default graphical software manager on almost all Debian-based Linux distributions. It was considered to be a user-friendly, easy to use way of managing applications.
|
||||
|
||||
Things changed as modern software manager tools like [GNOME Software][5] and [KDE Discover][6] came up with more modern and intuitive UI. These software managers have better interface, display the package information in a more friendly way with thumbnails, ratings and reviews.
|
||||
|
||||
Eventually, Synaptic got [confined to mostly lightweight Linux distributions][7].
|
||||
|
||||
#### Why would you use an ‘ancient’ software like Synaptic package manager?
|
||||
|
||||
You don’t have to. Not most of the time, of course.
|
||||
|
||||
But Synaptic is still a lot versatile than the likes of GNOME Software. Remember, it is basically GUI front end to apt which means it can do (almost) everything you do with [apt commands in the terminal][8].
|
||||
|
||||
For example, if you want to [prevent the update of a specific package in Ubuntu][9], you can do that in Synaptic but not in GNOME/Ubuntu Software Center.
|
||||
|
||||
![][10]
|
||||
|
||||
Also, I have noticed some issues with the Software Center in Ubuntu 20.04. It’s slow to load, it’s slow when searching for software and it is full of snap application (that not everyone prefers).
|
||||
|
||||
Synaptic is also [one of the lightweight applications you can use in Ubuntu][7] to speed up your system a bit.
|
||||
|
||||
#### Synaptic package manager features
|
||||
|
||||
Here is a summary of what you can do with Synaptic:
|
||||
|
||||
* Update the package cache
|
||||
* Upgrade the entire system
|
||||
* Manage package repositories
|
||||
* Search for packages by name, description, maintainer, version, dependencies etc
|
||||
* List packages by section, status (installed), origin or more
|
||||
* Sort packages by name, status, size or version
|
||||
* Get information related to a package
|
||||
* Lock package version
|
||||
* Install specific version of a package
|
||||
|
||||
|
||||
|
||||
There are more features that you may explore on your own.
|
||||
|
||||
### How to install Synaptic package manager on Ubuntu
|
||||
|
||||
Synaptic package manager is available in the Universe repository in Ubuntu. If it is enabled, you may find it in the Software Center:
|
||||
|
||||
![Synaptic in Ubuntu Software Center][11]
|
||||
|
||||
You may also install Synaptic via command line. Make sure to enable universe repository first:
|
||||
|
||||
```
|
||||
sudo add-apt-repository univers
|
||||
```
|
||||
|
||||
And then update the cache (not required in Ubuntu 18.04 and higher versions):
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
Now, use the command below to install synaptic package manager:
|
||||
|
||||
```
|
||||
sudo apt install synaptic
|
||||
```
|
||||
|
||||
That’s it.
|
||||
|
||||
### How to use Synaptic package manager
|
||||
|
||||
Once installed, you can search for Synaptic in the menu and start it from there:
|
||||
|
||||
![][12]
|
||||
|
||||
You can see that the interface is not among the best-looking ones here. Note the color of the checkboxes. White means the package is not installed, green means it is installed.
|
||||
|
||||
![][4]
|
||||
|
||||
You can search for an application and click on the checkbox to mark it for installation. It will also highlight packages (in green) that will be installed as dependencies. Hit apply to install the selected packages:
|
||||
|
||||
![][13]
|
||||
|
||||
You can [see all the installed packages in Ubuntu][14] using Synaptic. You can also choose to remove packages from this view.
|
||||
|
||||
![][15]
|
||||
|
||||
You can see packages available in individual repositories by displaying them based on Origin. Good way to see [which PPA offers what packages][16]. You can install or remove packages as described above.
|
||||
|
||||
![][17]
|
||||
|
||||
Usually, when you update Ubuntu, all the packages are updated at once. With Synaptic, you can easily choose which packages you want to update/upgrade to a newer version.
|
||||
|
||||
![][18]
|
||||
|
||||
You can also lock the version of packages so that they don’t get updated along with the system updates.
|
||||
|
||||
![][10]
|
||||
|
||||
You can also search for packages using Synaptic. This is like [searching for packages using apt-cache search command][19].
|
||||
|
||||
![][20]
|
||||
|
||||
If you think you made the wrong selection, you can click Undo from the Edit menu.
|
||||
|
||||
There are plenty more you can do with Synaptic and I cannot cover all the possible usages. I have covered the most common ones here and I leave you to explore it, if you are going to use Synaptic.
|
||||
|
||||
### Synaptic is not for everyone
|
||||
|
||||
If you don’t like Synaptic, you can remove it from the Software Center or using this command in terminal:
|
||||
|
||||
```
|
||||
sudo apt remove synaptic
|
||||
```
|
||||
|
||||
There was another lightweight software manager for Ubuntu called [AppGrid][21]. It hasn’t been updated in recent times as far as I know.
|
||||
|
||||
Synaptic is certainly not for everyone. It lists libraries and packages that you won’t otherwise see in the regular Software Center. If you removed a library that you were not aware of, it may cause issues.
|
||||
|
||||
I think that Synaptic is suitable for intermediate to advanced users who want better control over the package management without going the command line way.
|
||||
|
||||
What do you say? Have you ever used Synaptic for package management? Do you reply on software center or you just dive into the terminal? Do share your preference in the comment section.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/synaptic-package-manager/
|
||||
|
||||
作者:[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://www.nongnu.org/synaptic/
|
||||
[2]: https://en.wikipedia.org/wiki/APT_(software)
|
||||
[3]: https://itsfoss.com/apt-get-linux-guide/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/synaptic-interface.png?ssl=1
|
||||
[5]: https://wiki.gnome.org/Apps/Software
|
||||
[6]: https://userbase.kde.org/Discover
|
||||
[7]: https://itsfoss.com/lightweight-alternative-applications-ubuntu/
|
||||
[8]: https://itsfoss.com/apt-command-guide/
|
||||
[9]: https://itsfoss.com/prevent-package-update-ubuntu/
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/lock-version-synaptic.png?ssl=1
|
||||
[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/synaptic-ubuntu-software-center.png?ssl=1
|
||||
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/synaptic-package-manager-ubuntu.jpg?ssl=1
|
||||
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/install-packages-in-synaptic.png?ssl=1
|
||||
[14]: https://itsfoss.com/list-installed-packages-ubuntu/
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/remove-packages-using-synaptic.png?ssl=1
|
||||
[16]: https://itsfoss.com/ppa-guide/
|
||||
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/see-packages-by-repositories-synaptic.png?ssl=1
|
||||
[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/upgrade-packages-synaptic.png?ssl=1
|
||||
[19]: https://itsfoss.com/apt-search-command/
|
||||
[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/search-results-synaptic.png?ssl=1
|
||||
[21]: https://itsfoss.com/app-grid-lighter-alternative-ubuntu-software-center/
|
@ -1,104 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to generate an EPUB file on Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/how-to-generate-an-epub-file-on-fedora/)
|
||||
[#]: author: (John Paul Wohlscheid https://fedoramagazine.org/author/johnblood/)
|
||||
|
||||
How to generate an EPUB file on Fedora
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
It is becoming more popular to read content on smartphones. Every phone comes with its own ebook reader. Believe or not, it is very easy to create your own ebook files on Fedora.
|
||||
|
||||
This article shows two different methods to create an [EPUB][2]. The epub format is one of the most popular formats and is supported by many open-source applications.
|
||||
|
||||
Most people will ask “Why bother creating an EPUB file when PDFs are so easy to create?” The answer is: “Have you ever tried reading a sheet of paper when you can only see a small section at a time?” In order to read a PDF you have to keep zooming and moving around the document or scale it down to a small size to fit the screen. An EPUB file, on the other hand, is designed to fit many different screen types.
|
||||
|
||||
### Method 1: ghostwriter and pandoc
|
||||
|
||||
This first method creates a quick ebook file. It uses a Markdown editor named [ghostwriter][3] and a command-line document conversion tool named [pandoc][4].
|
||||
|
||||
You can either search for them and install them from the Software Center or you can install them from the terminal. If you are going to use the terminal to install them, run this command: _sudo dnf install pandoc ghostwriter_.
|
||||
|
||||
For those who are not aware of what [Markdown][5] is, here is a quick explanation. It is a simple markup language created a little over 15 years ago. It uses simple syntax to format plain text. Markdown files can then be converted to a whole slew of other document formats.
|
||||
|
||||
![ghostwriter][6]
|
||||
|
||||
Now for the tools. ghostwriter is a cross-platform Markdown editor that is easy to use and does not get in the way. pandoc is a very handy document converting tool that can handle hundreds of different formats.
|
||||
|
||||
To create your ebook, open ghostwriter, and start writing your document. If you have used Markdown before, you may be used to making the title of your document Heading 1 by putting a pound sign in front of it. Like this: _# My Man Jeeves_. However, pandoc will not recognize that as the title and put a big UNTITLED at the top of your ebook. Instead put a _%_ in front of your title. For example, _% My Man Jeeves_. Sections or chapters should be formatted as Heading 2, i.e. _## Leave It to Jeeves_. If you have subsections, use Heading 3 (_###_).
|
||||
|
||||
![][7]
|
||||
|
||||
Once your document is complete, click _File_ -> _Export_ (or press _Ctrl_ \+ _E_). In the dialog box, select between several options for the Markdown converter. If this is the first time you have used ghostwriter, the Sundown converter will be picked by default. From the dialog box, select pandoc. Next click _Export_. Your EPUB file is now created.
|
||||
|
||||
![ghostwriter export dialog box][8]
|
||||
|
||||
Note: If you get an error saying that there was an issue with pandoc, turn off _Smart Typography_ and try again.
|
||||
|
||||
### Method 2: calibre
|
||||
|
||||
If you want a more polished ebook, this is the method that you are looking for. It takes a few more steps, but it’s worth it.
|
||||
|
||||
![][9]
|
||||
|
||||
First, install an application named [calibre][10]. calibre is not just an ebook reader, it is an ebook management system. You can either install it from the Software Center or from the terminal via _sudo dnf install calibre_.
|
||||
|
||||
In this method, you can either write your document in LibreOffice, ghostwriter, or another editor of your choice. Make sure that the title of the book is formatted as Heading 1, chapters as Heading 2, and sub-sections as Heading 3.
|
||||
|
||||
Next, export your document as an HTML file.
|
||||
|
||||
Now add the file to calibre. Open calibre and click “_Add books_“. It will take calibre a couple of seconds to add the file.
|
||||
|
||||
![][11]
|
||||
|
||||
Once the file is imported, edit the file’s metadata by clicking on the “_Edit metadata_” button. Here you can fill out the title of the book and the author’s name. You can also upload a cover image (if you have one) or calibre will generate one for you.
|
||||
|
||||
![][12]
|
||||
|
||||
Next, click the “_Convert books_” button. In the new dialog box, select the “_Look & Feel_” section and the “_Layout_” tab. Check the “_Remove spacing between paragraphs_” option. This will tighten up the contents as indent each paragraph.
|
||||
|
||||
![][13]
|
||||
|
||||
Now, set up the table of contents. Select the “_Table of Contents_” section. There are three options to focus on: Level 1 TOC, Level 2 TOC, and Level 3 TOC. For each, click the wand at the end. In this new dialog box, select the HTML tag that applies to the table of contents entry. For example, select _h1_ for Level 1 TOC and so on.
|
||||
|
||||
![][14]
|
||||
|
||||
Next, tell calibre to include the table of contents. Select the “_EPUB output_” section and check the “_Insert Inline Table of Contents_“. To create the epub file, click “_OK_“.
|
||||
|
||||
![][15]
|
||||
|
||||
Now you have a professional-looking ebook file.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/how-to-generate-an-epub-file-on-fedora/
|
||||
|
||||
作者:[John Paul Wohlscheid][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/johnblood/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/05/epub-how_to-816x345.png
|
||||
[2]: https://en.wikipedia.org/wiki/EPUB
|
||||
[3]: https://github.com/wereturtle/ghostwriter
|
||||
[4]: https://pandoc.org/
|
||||
[5]: https://fedoramagazine.org/applications-for-writing-markdown/
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/05/ghostwriter-1024x640.jpg
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/05/ghostwriter-menu-1024x640.jpg
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/05/ghostwriter-export-1024x640.jpg
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-pre-1024x640.jpg
|
||||
[10]: https://calibre-ebook.com/
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-metadata-1024x640.jpg
|
||||
[12]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-lookandfeel-1024x640.jpg
|
||||
[13]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-toc2-1024x640.jpg
|
||||
[14]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-epub-output-1024x640.jpg
|
||||
[15]: https://fedoramagazine.org/wp-content/uploads/2020/05/calibre-post-1024x640.jpg
|
@ -1,80 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (lxbwolf)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5 ways to boost your Kubernetes knowledge)
|
||||
[#]: via: (https://opensource.com/article/20/6/kubernetes-anniversary)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
5 ways to boost your Kubernetes knowledge
|
||||
======
|
||||
On its anniversary, get to know Kubernetes with these deep-dives and
|
||||
hands-on projects.
|
||||
![Ship captain sailing the Kubernetes seas][1]
|
||||
|
||||
When the cloud was still in its formative years, developers discovered that it was convenient to write applications in small, atomic, minimal Linux images that shared resources with the server they ran on. Technically based on kernel namespaces, these small environment definitions came to be called [containers][2]. As containers proliferated, sysadmins quickly realized it was becoming essential to develop a tool that could help them manage not only containers but also the virtualized infrastructure underneath. And that's when [Kubernetes][3] was born.
|
||||
|
||||
Kubernetes is an extensible open source platform for wrangling containers. It helps administrators and developers manage workloads, services, and processes around containers. It facilitates declarative configuration and easy automation. In its relatively short lifespan, it has fostered a rapidly growing ecosystem with services, support, and tools from many companies and projects.
|
||||
|
||||
If you're looking to get better acquainted with this important cloud technology, here are a few articles to help you dive deep and five projects to help you try out what you learn.
|
||||
|
||||
### Containing container chaos
|
||||
|
||||
In 2016, we published [Containing the container chaos with Kubernetes][4], an introductory article by Terry Ryan about how Kubernetes is helping admins and architects grapple with containers. If you need a ground-level introduction to what containers do and how Kubernetes makes it easy, then this is the article to read first. It assumes no prior knowledge and explains all the most important concepts, so you can get up to speed fast.
|
||||
|
||||
For an advanced look into some of the magic happening at the kernel level, read Jessica Cherry's explanation of [Kubernetes namespaces][5].
|
||||
|
||||
### Kubernetes: Why does it matter?
|
||||
|
||||
Kubernetes provides the benefits of an Infrastructure-as-a-Service (IaaS) solution (like OpenStack) and a full Platform as a Service (PaaS). It gives you abstractions for managing infrastructure and the tools you need to troubleshoot at the base level of bare metal. If you have the impulse to cling to a single bare-metal server, you might want to read Tim Potter's take on [why Kubernetes matters][6]. His article compares IaaS and PaaS and gives his perspective on why Kubernetes has been so widely adopted. You don't always need Kubernetes or containers, but it's important to know when you do.
|
||||
|
||||
### Run it on a Raspberry Pi
|
||||
|
||||
There's no better way to get familiar with Kubernetes than to run it yourself. Unfortunately, not everyone has a cloud (nor the money to rent time on one) at their disposal. Luckily, Chris Collins has provided a guide for running [Kubernetes on a Pi][7]. Combined with his equally elucidating tutorials about [Cloud-init][8] and [Cloud-init services][9] (also on a Pi), you can build whatever kind of homelab you want so that you can learn how to manage your very own open hybrid cloud.
|
||||
|
||||
### Kubernetes commands
|
||||
|
||||
Once you have Kubernetes up and running, take a look at Jessica Cherry's article and accompanying cheat sheet that provides you with all the [essential Kubernetes commands][10]. In her article, she explains the syntax of `kubectl` commands and provides an overview of what each command and subcommand is meant to do.
|
||||
|
||||
### Fun Kubernetes projects
|
||||
|
||||
Nothing's more frustrating than having access to technology but not knowing what to do with it. For instance, it's one thing to have a Raspberry Pi on your desk, but it's an entirely different matter to decide what it ought to spend its CPU cycles doing. We've published plenty of articles to give some guidance to your Kubernetes explorations:
|
||||
|
||||
* [Helm][11] is a package manager for Kubernetes. Exploring it is an easy way to get comfortable with living in Kubernetes.
|
||||
* Learn all about [Operator SDK][12] to get familiar with Kubernetes objects and operators.
|
||||
* Provide a [network file system (NFS) on top of Kubernetes.][13]
|
||||
* Learn how to route traffic with [Skipper][14] or [Traefik.][15]
|
||||
|
||||
|
||||
|
||||
Most importantly, take the time to get comfortable with containers and Kubernetes. Whether you first embrace containerized apps on the server, cloud, or desktop, they're an important paradigm to understand, because they're a powerful construct that's made applications on Linux better, stronger, more robust, and easier. Invest time to learn more about them. You'll be glad you did.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/kubernetes-anniversary
|
||||
|
||||
作者:[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/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas)
|
||||
[2]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[3]: https://opensource.com/resources/what-is-kubernetes
|
||||
[4]: https://opensource.com/life/16/9/containing-container-chaos-kubernetes
|
||||
[5]: https://opensource.com/article/19/12/kubernetes-namespaces
|
||||
[6]: https://opensource.com/article/17/6/introducing-kubernetes
|
||||
[7]: https://opensource.com/article/20/6/kubernetes-raspberry-pi
|
||||
[8]: https://opensource.com/article/20/5/cloud-init-raspberry-pi-homelab
|
||||
[9]: https://opensource.com/article/20/5/create-simple-cloud-init-service-your-homelab
|
||||
[10]: https://opensource.com/article/20/5/kubectl-cheat-sheet
|
||||
[11]: https://opensource.com/article/20/2/kubectl-helm-commands
|
||||
[12]: https://opensource.com/article/20/3/kubernetes-operator-sdk
|
||||
[13]: https://opensource.com/article/20/6/kubernetes-nfs-client-provisioning
|
||||
[14]: https://opensource.com/article/20/4/http-kubernetes-skipper
|
||||
[15]: https://opensource.com/article/20/3/kubernetes-traefik
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,130 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Style your data plots in Python with Pygal)
|
||||
[#]: via: (https://opensource.com/article/20/6/pygal-python)
|
||||
[#]: author: (Shaun Taylor-Morgan https://opensource.com/users/shaun-taylor-morgan)
|
||||
|
||||
Style your data plots in Python with Pygal
|
||||
======
|
||||
An introduction one of the more stylish Python plotting libraries.
|
||||
![Python in a coffee cup.][1]
|
||||
|
||||
[Python][2] is full of libraries that can visualize data. One of the more interactive options comes from Pygal, which I consider the library for people who like things to look good. It generates beautiful SVG (Scalable Vector Graphics) files that users can interact with. SVG is a standard format for interactive graphics, and it can lead to rich user experiences with only a few lines of Python.
|
||||
|
||||
### Using Pygal for stylish Python plots
|
||||
|
||||
In this introduction, we want to recreate this multi-bar plot, which represents the UK election results from 1966 to 2020:
|
||||
|
||||
![Pygal plot][3]
|
||||
|
||||
Before we go further, note that you may need to tune your Python environment to get this code to run, including the following.
|
||||
|
||||
* Running a recent version of Python (instructions for [Linux][4], [Mac][5], and [Windows][6])
|
||||
* Verify you're running a version of Python that works with these libraries
|
||||
|
||||
|
||||
|
||||
The data is available online and can be imported using pandas:
|
||||
|
||||
|
||||
```
|
||||
import pandas as pd
|
||||
df = pd.read_csv('<https://anvil.works/blog/img/plotting-in-python/uk-election-results.csv>')
|
||||
```
|
||||
|
||||
Now we're ready to go. The data looks like this:
|
||||
|
||||
|
||||
```
|
||||
year conservative labour liberal others
|
||||
0 1966 253 364 12 1
|
||||
1 1970 330 287 6 7
|
||||
2 Feb 1974 297 301 14 18
|
||||
.. ... ... ... ... ...
|
||||
12 2015 330 232 8 80
|
||||
13 2017 317 262 12 59
|
||||
14 2019 365 202 11 72
|
||||
```
|
||||
|
||||
|
||||
|
||||
Plotting this in Pygal builds up in a way that I find easy to read. First, we define the style object in a way that will simplify our bar chart definition. Then we pass the custom style along with other metadata to a `Bar` object:
|
||||
|
||||
|
||||
```
|
||||
import pygal
|
||||
from pygal.style import Style
|
||||
|
||||
custom_style = Style(
|
||||
colors=('#0343df', '#e50000', '#ffff14', '#929591'),
|
||||
font_family='Roboto,Helvetica,Arial,sans-serif',
|
||||
background='transparent',
|
||||
label_font_size=14,
|
||||
)
|
||||
|
||||
c = pygal.Bar(
|
||||
title="UK Election Results",
|
||||
style=custom_style,
|
||||
y_title='Seats',
|
||||
width=1200,
|
||||
x_label_rotation=270,
|
||||
)
|
||||
```
|
||||
|
||||
Then, we `add` our data into the `Bar` object:
|
||||
|
||||
|
||||
```
|
||||
c.add('Conservative', df['conservative'])
|
||||
c.add('Labour', df['labour'])
|
||||
c.add('Liberal', df['liberal'])
|
||||
c.add('Others', df['others'])
|
||||
|
||||
c.x_labels = df['year']
|
||||
```
|
||||
|
||||
Finally, we save the plot as an SVG file:
|
||||
|
||||
|
||||
```
|
||||
`c.render_to_file('pygal.svg')`
|
||||
```
|
||||
|
||||
The result is an interactive SVG plot you can see in this gif:
|
||||
|
||||
![The Python pygal library can generate rich SVG files as seen here][7]
|
||||
|
||||
Beautifully simple, and with beautiful results.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Some plotting options in Python require building every object in great detail, and Pygal gives you that functionality from the start. Give Pygal a go if you have data on hand and you want to make a clean, beautiful, and simple plot for user interaction.
|
||||
|
||||
\---
|
||||
|
||||
_This article was first shared [here][8] and is edited and republished with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/pygal-python
|
||||
|
||||
作者:[Shaun Taylor-Morgan][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/shaun-taylor-morgan
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_python.jpg?itok=G04cSvp_ (Python in a coffee cup.)
|
||||
[2]: https://opensource.com/article/20/4/plot-data-python
|
||||
[3]: https://opensource.com/sites/default/files/uploads/pygal_1.png (Pygal plot)
|
||||
[4]: https://opensource.com/article/20/4/install-python-linux
|
||||
[5]: https://opensource.com/article/19/5/python-3-default-mac
|
||||
[6]: https://opensource.com/article/19/8/how-install-python-windows
|
||||
[7]: https://opensource.com/sites/default/files/uploads/pygal-interactive_3.gif (The Python pygal library can generate rich SVG files as seen here)
|
||||
[8]: https://anvil.works/blog/plotting-in-pygal
|
@ -1,241 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (5 ways to examine the content of files on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3561490/5-ways-to-examine-the-content-of-files-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
5 ways to examine the content of files on Linux
|
||||
======
|
||||
How to use the cat, more, head and tail commands to look at the content of Linux files, not just text files.
|
||||
[mari lezhava / Unsplash][1] [(CC0)][2]
|
||||
|
||||
Linux provides many commands for examining the contents of files including **cat**, **more,** **head** and **tail,** but that's just a start.
|
||||
|
||||
For one thing, even the most obvious commands have a lot more options than many Linux users ever get around to using. And there are some less obvious commands that offer some unique features. In this post, we’ll both at commands for viewing the contents of files and options for tailoring those views to better cater to your needs.
|
||||
|
||||
### cat
|
||||
|
||||
The cat command sends the entire contents of text files to your terminal window for viewing. In fact, if you type “cat” followed by the name of a file with thousands of lines, those lines will whiz by your window so fast, you won’t be able to make out much more of it than the last screenful of text. Yet, as familiar as the cat command is to Linux users, even this basic command provides a lot of useful options such as numbering the lines in the output that many of us likely haven’t ever used. To expand on that, not only can you number lines; you have some choices in how you do the numbering.
|
||||
|
||||
Numbering every line looks like this:
|
||||
|
||||
```
|
||||
$ cat -n msg
|
||||
1 Hello --
|
||||
2
|
||||
3 I hope you are having a wonderful day!
|
||||
4
|
||||
5
|
||||
6 That's it for ... now
|
||||
7
|
||||
8 bye!
|
||||
9
|
||||
10 s.
|
||||
```
|
||||
|
||||
You can also number only lines with content. Note that a line containing only blanks is not considered “empty” for this command and would be numbered.
|
||||
|
||||
```
|
||||
$ cat -b msg
|
||||
1 Hello --
|
||||
|
||||
2 I hope you are having a wonderful day!
|
||||
|
||||
|
||||
3 That's it for ... now
|
||||
|
||||
4 bye!
|
||||
|
||||
5 s.
|
||||
```
|
||||
|
||||
The cat command allows you to ignore repeated blank lines with the -s option, but you have to add another command to suppress blanks lines altogether.
|
||||
|
||||
```
|
||||
$ cat -s msg
|
||||
Hello --
|
||||
|
||||
I hope you are having a wonderful day!
|
||||
|
||||
That's it for ... now
|
||||
|
||||
bye!
|
||||
|
||||
s.
|
||||
```
|
||||
|
||||
To ignore all of the blank lines, just pipe the output from **cat** to a **grep** command as follows. The dot (.) matches text including blank characters, so it will display lines that contain only blanks and only look empty.
|
||||
|
||||
```
|
||||
$ cat msg | grep .
|
||||
Hello --
|
||||
I hope you are having a wonderful day!
|
||||
That's it for ... now
|
||||
bye!
|
||||
s.
|
||||
```
|
||||
|
||||
The **-E** optoin provides a visual cue to show whether there are extra blanks at the ends of lines by sticking a $ at the end of every line.
|
||||
|
||||
```
|
||||
$ cat -E msg
|
||||
Hello --$
|
||||
$
|
||||
I hope you are having a wonderful day! $
|
||||
$
|
||||
$
|
||||
That's it for ... now$
|
||||
$
|
||||
bye!$
|
||||
$
|
||||
s.$
|
||||
```
|
||||
|
||||
With **-A**, you get both the $ characters at the end of each line and tabs showing up as **^I** rather than empty space.
|
||||
|
||||
```
|
||||
$ cat -A msg
|
||||
Hello --$
|
||||
$
|
||||
I hope you are having a wonderful day!$
|
||||
$
|
||||
$
|
||||
That’s it for …^Inow$
|
||||
$
|
||||
bye!$
|
||||
$
|
||||
s.$
|
||||
```
|
||||
|
||||
### Displaying portions of files with head and tail
|
||||
|
||||
The **head** and **tail** commands show the tops or bottoms of files and default to ten lines. You can specify a different number of lines to view by using strings like -3 (show 3 lines) or -11 (show 11 lines). The **tail** command works the same way as **head** but displays the bottoms of files rather than the tops.
|
||||
|
||||
```
|
||||
$ head -3 msg
|
||||
Hello --
|
||||
I hope you are having a wonderful day!
|
||||
$ tail -3 msg
|
||||
bye!
|
||||
|
||||
s.
|
||||
```
|
||||
|
||||
You can also combine **head** and **tail** commands to view text between the tops of bottoms of files. You just have to pick your starting point and how many lines you want to see. In this example, the command would display the second hundred lines in a file and, with **cat**'s help, numbering those lines.
|
||||
|
||||
```
|
||||
$ cat -b mybigfile | head -200 | tail -100
|
||||
101 Invoice #2020-06-07a sent to vendor
|
||||
...
|
||||
```
|
||||
|
||||
### Browsing text a screenful at a time with more or less
|
||||
|
||||
The **more** command is an obvious choice for browsing through a file’s content a screenful at a time while **less** adds the ability to move up and down in a file by using the up and down keyboard arrows so that you can start scanning and then back up in the file.
|
||||
|
||||
### Looking at text files two ways at once with od
|
||||
|
||||
The **od** (octal dump) command allows you to view a file both as normal text and as a series of ASCII values (i.e., how that text is actually encoded in the files). As you can see in the example below, the numbered lines show the numeric ASCII values and the alternate lines show the text and non-printable characters.
|
||||
|
||||
```
|
||||
$ od -bc msg
|
||||
0000000 110 145 154 154 157 040 055 055 012 012 111 040 150 157 160 145
|
||||
H e l l o - - \n \n I h o p e
|
||||
0000020 040 171 157 165 040 141 162 145 040 150 141 166 151 156 147 040
|
||||
y o u a r e h a v i n g
|
||||
0000040 141 040 167 157 156 144 145 162 146 165 154 040 144 141 171 041
|
||||
a w o n d e r f u l d a y !
|
||||
0000060 012 012 012 124 150 141 164 047 163 040 151 164 040 146 157 162
|
||||
\n \n \n T h a t ' s i t f o r
|
||||
0000100 040 056 056 056 011 156 157 167 012 012 142 171 145 041 012 012
|
||||
. . . \t n o w \n \n b y e ! \n \n
|
||||
0000120 163 056 012
|
||||
s . \n
|
||||
```
|
||||
|
||||
Notice how newline characters are shown as **\n** (octal 012) and tabs are shown as **\t** (octal 011).
|
||||
|
||||
One of the especially helpful uses of the **od** command is for looking at non-text files for information that identifies the file types. In this case, we see the **JFIF** (JPEG File Interchange Format) label that identifies it as a jpg file to commands like **file** that report on file types. There's a lot of other useful information in there as well, especially if you're curious about how these files are formatted.
|
||||
|
||||
In this next command, we are looking at the beginning portion of a jpg file.
|
||||
|
||||
```
|
||||
$ od -bc arrow.jpg | head -12
|
||||
0000000 377 330 377 340 000 020 112 106 111 106 000 001 001 000 000 001
|
||||
377 330 377 340 \0 020 J F I F \0 001 001 \0 \0 001
|
||||
0000020 000 001 000 000 377 333 000 103 000 003 002 002 002 002 002 003
|
||||
\0 001 \0 \0 377 333 \0 C \0 003 002 002 002 002 002 003
|
||||
0000040 002 002 002 003 003 003 003 004 006 004 004 004 004 004 010 006
|
||||
002 002 002 003 003 003 003 004 006 004 004 004 004 004 \b 006
|
||||
0000060 006 005 006 011 010 012 012 011 010 011 011 012 014 017 014 012
|
||||
006 005 006 \t \b \n \n \t \b \t \t \n \f 017 \f \n
|
||||
0000100 013 016 013 011 011 015 021 015 016 017 020 020 021 020 012 014
|
||||
\v 016 \v \t \t \r 021 \r 016 017 020 020 021 020 \n \f
|
||||
0000120 022 023 022 020 023 017 020 020 020 377 333 000 103 001 003 003
|
||||
022 023 022 020 023 017 020 020 020 377 333 \0 C 001 003 003
|
||||
```
|
||||
|
||||
If we were to ask the **file** command for information on this image file, we might see something like this. The file command is pulling all this descriptive information from data at the beginning of the file.
|
||||
|
||||
```
|
||||
$ file arrow.jpg
|
||||
arrow.png: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 500x375, components 3
|
||||
```
|
||||
|
||||
### Looking at files as text-based images with jp2a
|
||||
|
||||
If you are limited to the command line and want to get an idea what a particular image file contains, you can use a tool like **jp2a** (jpeg to ascii) to give you a character rendition. How recognizable the image will be in this format depends on the file. Don’t expect much as the version of the image you will see is going to put “low res” to the test! This one’s a very low resolution emperor penguin.
|
||||
|
||||
```
|
||||
$ jp2a Emperor_Penguin.jpg
|
||||
MMMMMMMMWOdkNMMMMMMMMMMMMMMMMMMM
|
||||
MMMXK0kc.... ,OKMMMMMMMMMMMMMMMM
|
||||
MMNK0Ol... :Xx'dNMMMMMMMMMMMMM
|
||||
MMMMMMMd;lx00Oo. ..xMMMMMMMMMMMM
|
||||
MMMMMMK.OXMMMMMN,...lMMMMMMMMMMM
|
||||
MMMMMMx'KXNNMMMMK....0MMMMMMMMMM
|
||||
MMMMMMx:kkKNWWMMMl.. 'NMMMMMMMMM
|
||||
MMMMMMddx0NNNWMMMK'...;NMMMMMMMM
|
||||
MMMMMMck0NNWWWWWMMd ..lMMMMMMMM
|
||||
MMMMMM.d0KXNWWWWMMo ...WMMMMMMM
|
||||
MMMMMM.xOXNNWNMMMW. ....KMMMMMMM
|
||||
MMMMMM'kKNKWXWMMMK ..'.0MMMMMMM
|
||||
MMMMMMxckXNNNNMMMX .:..XMMMMMMM
|
||||
MMMMMMW;xKNWWWMMMM. .;. NMMMMMMM
|
||||
MMMMMMMok0NNWNWMMMx .l..MMMMMMMM
|
||||
MMMMMMMkxOKXWXNMMMMl.:'dMMMMMMMM
|
||||
MMMMMMM0dKOdKXXNMMMMNx,WMMMMMMMM
|
||||
MMMMMMMWoKxldXKNNMMMMM;MMMMMMMMM
|
||||
MMMMMMMMxxxxdNWNXNMMMM;MMMMMMMMM
|
||||
MMMMMMMMxOcoo0XOOOOWMW,kMMMMMMMM
|
||||
MMMMMMM0xK;.cO0dNX:0XXd;NMMMMMMM
|
||||
MMMNkdd:,'ldXXO0xl;x0kx:;lKMMMMM
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
```
|
||||
|
||||
#### Wrap-Up
|
||||
|
||||
There are quite a few commands on Linux for examining the content of files in various ways. Some have options which can prove very helpful when you need to manipulate file contents. Others are just … interesting.
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3561490/5-ways-to-examine-the-content-of-files-on-linux.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://unsplash.com/photos/q65bNe9fW-w
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -1,130 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Change Folder Color in Ubuntu 20.04)
|
||||
[#]: via: (https://itsfoss.com/folder-color-ubuntu/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Change Folder Color in Ubuntu 20.04
|
||||
======
|
||||
|
||||
The default Yaru theme in [Ubuntu 20.04][1] gives it a polished, modern look. The folders in the default Yaru theme have a purple-aubergine touch to keep in line with the branding of Ubuntu.
|
||||
|
||||
If you are not a fan of the purple shade, you have the freedom to change the color theme in Ubuntu.
|
||||
|
||||
You may change the theme of Ubuntu to give it a different color but that would mean ditching Yaru theme.
|
||||
|
||||
If you just want to change the folder color in Ubuntu 20.04, there are two ways to do that:
|
||||
|
||||
* Give a different color and emblem to selected folders (for better organizing the files and folders)
|
||||
* Change the colors for all folders by changing the Yaru color theme
|
||||
|
||||
|
||||
|
||||
Let me show you both methods.
|
||||
|
||||
### Change folder colors and emblem for selected files and folders
|
||||
|
||||
![][2]
|
||||
|
||||
I know that some people keep their folders in different color/location to indicate whether a work is in progress or pending or completed.
|
||||
|
||||
If you are one of those people, you can use the [Folder Color utility][3] and change the color of the folders. You may also add emblem to the folders (the green tick sign for competition, + sign for new, exclamation mark for important etc). You can see some examples in the previous image.
|
||||
|
||||
You can also use the Folder Color utility on files. You cannot change the color files icons but you can add emblems to them.
|
||||
|
||||
If you are [using Yaru theme][4] in Ubuntu 20.04, you can use the [official PPA][5]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:costales/yaru-colors-folder-color
|
||||
```
|
||||
|
||||
Now install Folder Color with Yaru compatibility package.
|
||||
|
||||
```
|
||||
sudo apt install folder-color yaru-colors-folder-color
|
||||
```
|
||||
|
||||
Once installed, you’ll have to restart Nautilus file manager using **nautilus -q** command. After that, you can go to the file manager, right click on a folder or file. You’ll see a Folder’s Color option in the context menu. You’ll see the color and emblem options here.
|
||||
|
||||
![][6]
|
||||
|
||||
You can also **restore the original folder color by choosing Default** in the menu.
|
||||
|
||||
For Ubuntu 18.04 or older versions, Folder Color is available to install from the software center. The Folder Color utility is also available for Linux Mint/Cinnamon desktop’s Nemo file manager and MATE desktop’s [Caja file manager][7].
|
||||
|
||||
How to remove Folder Color tool?
|
||||
|
||||
If you don’t want to use Folder Color, you may remove the app and delete the PPA. First remove the app:
|
||||
|
||||
```
|
||||
sudo apt remove folder-color yaru-colors-folder-color
|
||||
```
|
||||
|
||||
Now [remove the PPA][8]:
|
||||
|
||||
```
|
||||
sudo add-apt-repository -r ppa:costales/yaru-colors-folder-color
|
||||
```
|
||||
|
||||
### Yaru Colors theme pack to change the color variant of Yaru theme
|
||||
|
||||
![Yaru Colors Blue Theme Variant][9]
|
||||
|
||||
If you want to keep on using Yaru theme but with a different color variant, [Yaru Colors theme pack][10] is what you need.
|
||||
|
||||
Yaru Colors consists of 12 color variants of Yaru. The colors are aqua, blue, brown, deep blue, green, grey, MATE green, orange, pink, purple, red and yellow.
|
||||
|
||||
The themes consist of GTK theme, icons, cursor them and GNOME shell theme.
|
||||
|
||||
* Icons- Changes the accent color of folders
|
||||
* GTK themes- Changes the accent color of the application windows
|
||||
* cursor theme- Adds an almost negligible colored outline to the cursor
|
||||
* GNOME Shell theme- Changes the accent color in the message tray and system tray
|
||||
|
||||
|
||||
|
||||
You can download Yaru Colors theme pack from its GitHub repository:
|
||||
|
||||
Download Yaru Colors theme pack
|
||||
|
||||
When you extract the content you’ll find icons, Themes folders and both of these folders contains the twelve mentioned color variants. You can copy the icons and Themes folder in ~/.local/share/.icons and ~/.local/share/themes folders respectively.
|
||||
|
||||
If you are not comfortable doing it all by yourself, you’ll find the install.sh shell script in the extract folder. You can run it to install all or selected few themes via an interactive terminal session.
|
||||
|
||||
![][11]
|
||||
|
||||
To change the GNOME Shell theme, you’ll have to [use GNOME Tweak tool][12]. You may also use GNOME Tweak to change the icons and themes back to the default ones.
|
||||
|
||||
![][13]
|
||||
|
||||
Enjoy adding color to your Ubuntu life :)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/folder-color-ubuntu/
|
||||
|
||||
作者:[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/download-ubuntu-20-04/
|
||||
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/folder-colors-yaru-ubuntu.png?ssl=1
|
||||
[3]: https://foldercolor.tuxfamily.org/
|
||||
[4]: https://itsfoss.com/ubuntu-community-theme/
|
||||
[5]: https://launchpad.net/folder-color
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/change-folder-color-ubuntu.png?ssl=1
|
||||
[7]: https://github.com/mate-desktop/caja
|
||||
[8]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
|
||||
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/yaru-colors-blue-theme-variant.jpg?ssl=1
|
||||
[10]: https://github.com/Jannomag/Yaru-Colors
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/yaru-colors-theme-install.png?resize=800%2C513&ssl=1
|
||||
[12]: https://itsfoss.com/gnome-tweak-tool/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/restore-yaru-gnome-tweak.png?resize=800%2C557&ssl=1
|
@ -1,106 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to write functions in Bash)
|
||||
[#]: via: (https://opensource.com/article/20/6/bash-functions)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
How to write functions in Bash
|
||||
======
|
||||
Reduce redundancy and maintenance in your code by writing functions.
|
||||
![woman on laptop sitting at the window][1]
|
||||
|
||||
When you're programming, you're literally defining a procedure, or a _routine_, you want the computer to perform. A simple analogy compares computer programming to baking bread: you list ingredients once to set up the work environment, then you list the steps you must take to end up with a loaf of bread. In both programming and baking, some steps must be repeated at different intervals. In baking bread, for instance, this could be the process of feeding a sourdough culture:
|
||||
|
||||
|
||||
```
|
||||
STIR=100
|
||||
SNOOZE=86400
|
||||
|
||||
function feed_culture {
|
||||
remove_from(pantry)
|
||||
add(flour, water)
|
||||
stir($STIR)
|
||||
sleep($SNOOZE)
|
||||
}
|
||||
```
|
||||
|
||||
And later, kneading and proofing the dough:
|
||||
|
||||
|
||||
```
|
||||
KNEAD=600
|
||||
SNOOZE=7200
|
||||
|
||||
function process_dough {
|
||||
remove_from(proofing_drawer)
|
||||
knead($KNEAD)
|
||||
return_to_drawer($SNOOZE)
|
||||
}
|
||||
```
|
||||
|
||||
In programming, these subroutines can be expressed as _functions_. Functions are important for programmers because they help reduce redundancy in code, which in turn reduces the amount of maintenance required. For example, in the imaginary scenario of baking bread programmatically, if you need to change the amount of time the dough proofs, as long as you've used a function before, you merely have to change the value of the seconds once, either by using a variable (called **SNOOZE** in the sample code) or directly in the subroutine that processes dough. That can save you a lot of time, because you don't have to hunt through your codebase for every possible mention of rising dough, much less worry about missing one. Many a bug's been caused by a missed value that didn't get changed or by a poorly executed **`sed`** command in hopes of catching every last match without having to hunt for them manually.
|
||||
|
||||
In [Bash][2], defining a function is as easy as setting it either in the script file you're writing or in a separate file. If you save functions to a dedicated file, you can `source` it into your script as you would `include` a library in C or C++ or `import` a module into Python. To create a Bash function, use the keyword `function`:
|
||||
|
||||
|
||||
```
|
||||
function foo {
|
||||
# code here
|
||||
}
|
||||
```
|
||||
|
||||
Here's a simple (and somewhat contrived, as this could be made simpler) example of how a function works with arguments:
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/env bash
|
||||
ARG=$1
|
||||
|
||||
function mimic {
|
||||
if [[ -z $ARG ]]; then
|
||||
ARG='world'
|
||||
fi
|
||||
echo "hello $ARG"
|
||||
}
|
||||
|
||||
mimic $ARG
|
||||
```
|
||||
|
||||
Here are the results:
|
||||
|
||||
|
||||
```
|
||||
$ ./mimic
|
||||
hello world
|
||||
$ ./mimic everybody
|
||||
hello everybody
|
||||
```
|
||||
|
||||
Note the final line of the script, which executes the function. This is a common point of confusion for beginning scripters and programmers: functions don't get executed automatically. They exist as _potential_ routines until they are called.
|
||||
|
||||
Without a line calling the function, the function would only be defined and would never run.
|
||||
|
||||
If you're new to Bash, try executing the sample script once with the last line included and again with the last line commented out.
|
||||
|
||||
### Using functions
|
||||
|
||||
Functions are vital programming concepts, even for simple scripts. The more comfortable you become with functions, the better off you'll be when you're faced with a complex problem that needs something more dynamic than just declarative lines of commands. Keeping general-purpose functions in separate files can also save you some work, as it'll help you build up routines you commonly use so that you can reuse them across projects. Look at your scripting habits and see where functions might fit.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/bash-functions
|
||||
|
||||
作者:[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/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
|
||||
[2]: https://opensource.com/resources/what-bash
|
@ -1,140 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How I stream video with OBS and WebSockets)
|
||||
[#]: via: (https://opensource.com/article/20/6/obs-websockets-streaming)
|
||||
[#]: author: (Kevin Sonney https://opensource.com/users/ksonney)
|
||||
|
||||
How I stream video with OBS and WebSockets
|
||||
======
|
||||
Take control of your streaming with these open source supporting tools
|
||||
that simplify WebSockets.
|
||||
![An old-fashioned video camera][1]
|
||||
|
||||
[OBS][2] is one of the staples of live streaming videos now. It is the preferred software for streaming to Twitch, one of the most popular live video sites around. There are some really nice add-ons to allow a streamer to control things from their phone or another screen without disrupting the running video. It turns out, it is really easy to build your own control panel using [Node-RED][3] and the [obs-websockets][4] plugin.
|
||||
|
||||
![My OBS Control Dashboard][5]
|
||||
|
||||
My OBS control dashboard
|
||||
|
||||
I know what many of you are thinking—"He said WebSockets and easy in the same sentence?" Many people have had difficulty setting up and using WebSockets, which allow for bi-directional communication over a single connection via a web server. Node-RED has built-in support for WebSockets and is the part that makes this easy, at least compared to writing your own client/server.
|
||||
|
||||
Before starting, make sure you have OBS installed and configured. Start by downloading and installing the [latest stable release of the obs-websockets][6] plugin. For this article, the default settings are fine, but I strongly recommend following the instructions for securing obs-websockets in the future.
|
||||
|
||||
Next, [download and install Node-RED][7], either on the same system or on a different one (like a Raspberry Pi). Again, the default installation is fine for our purposes, but it would be wise to secure the installation following the directions on their site.
|
||||
|
||||
Now for the fun parts. Start Node-RED and open up the web interface (by default at <http://localhost:1880>), and you have a blank canvas. Open up the "hamburger" menu on the right and select "Manage Palate." Then click on the "Install" tab and search for the "node-red-contrib-dashboard" and "node-red-contrib-rbe" modules.
|
||||
|
||||
Once those are installed, click on the right-hand list and drag-and-drop the following blocks to the canvas:
|
||||
|
||||
* 1 Websocket Out
|
||||
* 1 Websocket In
|
||||
* 1 Debug
|
||||
* 1 Inject
|
||||
* 1 Switch
|
||||
* 1 Change
|
||||
* 2 JSON
|
||||
* 1 Catch
|
||||
|
||||
|
||||
|
||||
Connect them in the following orders:
|
||||
|
||||
|
||||
```
|
||||
Inject->Button->Change->JSON->Websocket Out
|
||||
|
||||
Websocket In->JSON->Switch->RBE->Debug
|
||||
|
||||
Catch->Debug
|
||||
```
|
||||
|
||||
![The basic flows][8]
|
||||
|
||||
The basic flows
|
||||
|
||||
When the button is pushed (or the Inject node sends a timestamp), a payload is sent through the change node, converted from a JSON object to a string, then sent to the WebSocket Out node. When a message is received by the WebSocket In node, it is converted to a JSON object, and if it is not a duplicate, sent to the Debug node for output. And the Catch node will catch any errors and put them into the debug panel.
|
||||
|
||||
What is in that payload? Let's set everything up and find out.
|
||||
|
||||
First, double click the `button` to open the settings dialog. Start by changing the payload to "JSON" using the drop-down menu. In the field, add the following:
|
||||
|
||||
|
||||
```
|
||||
{"request-type":"GetVersion"}
|
||||
```
|
||||
|
||||
Enable the checkbox for "If msg arrives on input, emulate a button click" and click Done to close the button config. When a message comes from the Inject node, or if the button is pressed in the UI, it will send the JSON payload to the next node.
|
||||
|
||||
![Setting up the button][9]
|
||||
|
||||
Setting up the button
|
||||
|
||||
Now open up the Change node. We want to set `msg.payload.message-id` to `msg._msgid` by changing the first field from `payload` to `payload.message-id` and then using the drop-down on the second field to change the type from `String` to `msg.,` then we will put `_msgid` in the field. This copies the unique message ID to the JSON object payload so that each request has a unique ID for tracking.
|
||||
|
||||
This is then sent to the JSON node to convert from a JSON object to a string, and then passed to the Websocket Out node. Open up the Websocket Out node to configure the connection to OBS. First, change the `Type` to `Connect to` and then click the pencil icon to create a new connection URL. Set that to `ws://OBSMachine:4444/` and close the dialog to save. `OBSMachine` is the name of the machine OBS and obs-websocket are running on. For example, if Node-RED is running on the same machine, this would be `ws://localhost:4444`, and if it is on a machine named "luxuria.local" then it would be `ws://luxuria.local:4444`. Close and update the Websocket Out node. This sends the payload text string to the WebSocket in OBS.
|
||||
|
||||
![Websocket Out Node configuration][10]
|
||||
|
||||
Websocket Out Node configuration
|
||||
|
||||
On to the WebSocket In flow! Open the WebSocket In node, and set it to a `Type` of `Connect to` and the URL to the connection we defined before (it should auto-fill). Next in line is the second JSON node, which we can leave alone. This accepts output from OBS and converts it into a payload object.
|
||||
|
||||
Next, we will filter the regular heartbeat and status updates from everything else. Open up the switch and set the "Property" value to `payload["update-type"]`. Now select `Is Not Null` from the drop-down below it. Click `+` to add a second option and select `otherwise` from the drop-down.
|
||||
|
||||
![Switch Node configuration][11]
|
||||
|
||||
Switch Node configuration
|
||||
|
||||
Connect the new output on the switch directly to the Debug node input.
|
||||
|
||||
The RBE node, which will filter out duplicates, needs to be told what field to watch for. Since it should be connected to the output from the switch that sends nothing but status updates, this is important, as obs-websocket is sending updates every few seconds. By default, the RBE compares the entire payload object, which will constantly be changing. Open up the RBE Node, and change the `Property` from `payload` to `payload.streaming`. If the `streaming` value of the payload changes, then pass the message through; otherwise, discard it.
|
||||
|
||||
The final step is to change the Debug node output from `msg.payload` to the complete msg object. This allows us to see the entire object, which sometimes has useful information outside the `payload`.
|
||||
|
||||
Now, click `Deploy` to activate the changes. Hopefully, the WebSocket nodes will have a green "Connected" message underneath them. If they are red or yellow, the connection URL is likely incorrect and needs to be updated, or the connection is being blocked. Make sure that port 4444 on the remote machine is open and available, and that OBS is running!
|
||||
|
||||
Without the RBE node filtering on the `streaming` value, the debug panel (the bug icon on the right of the canvas) would be filling with Heartbeat messages about now. Click the button to the left of the Inject node to send a signal that will simulate a button click. If all is well, you should see an object arrive that has a listing of all the things `obs-websocket` can do.
|
||||
|
||||
![The response to "GetVersion"][12]
|
||||
|
||||
The response to "GetVersion"
|
||||
|
||||
Now open up `http://localhost:1880/ui` in another tab or window. It should show a single button. Press it! The debug panel should show the same information as before.
|
||||
|
||||
Congrats! You have sent your first (and hopefully not last) WebSocket message to OBS!
|
||||
|
||||
This is just the beginning of what can be done with `obs-websockets` and Node-RED. The complete documentation of what is supported is documented in the protocol.md file in the GitHub repository for obs-websockets. With a little experimentation, you can create a full-featured control panel to start and stop streaming, change scenes, and a whole lot more. If you are like me, you'll have all kinds of controls set up before you know it.
|
||||
|
||||
![OBS Websocket][13]
|
||||
|
||||
I may have gotten a little mad with power.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/obs-websockets-streaming
|
||||
|
||||
作者:[Kevin Sonney][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/ksonney
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_film.png?itok=aElrLLrw (An old-fashioned video camera)
|
||||
[2]: https://obsproject.com/
|
||||
[3]: https://nodered.org/
|
||||
[4]: https://github.com/Palakis/obs-websocket
|
||||
[5]: https://opensource.com/sites/default/files/uploads/obscontrol-img1.png.jpg (My OBS Control Dashboard)
|
||||
[6]: https://github.com/palakis/obs-websocket/releases
|
||||
[7]: https://nodered.org/docs/getting-started/
|
||||
[8]: https://opensource.com/sites/default/files/uploads/obscontrol-img2.png.jpg (The basic flows)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/obscontrol-img3.png.jpg (Setting up the button)
|
||||
[10]: https://opensource.com/sites/default/files/uploads/obscontrol-img4.png.jpg (Websocket Out Node configuration)
|
||||
[11]: https://opensource.com/sites/default/files/uploads/obscontrol-img5.png.jpg (Switch Node configuration)
|
||||
[12]: https://opensource.com/sites/default/files/uploads/obscontrol-img6.png.jpg (The response to "GetVersion")
|
||||
[13]: https://opensource.com/sites/default/files/uploads/obscontrol-img7.png.jpg (OBS Websocket)
|
@ -1,576 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Stop debugging Go with Println and use Delve instead)
|
||||
[#]: via: (https://opensource.com/article/20/6/debug-go-delve)
|
||||
[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe)
|
||||
|
||||
Stop debugging Go with Println and use Delve instead
|
||||
======
|
||||
Delve is packed with functionality to make debugging a breeze.
|
||||
![Bug tracking magnifying glass on computer screen][1]
|
||||
|
||||
When was the last time you tried to learn a new programming language? Do you stick with your tried and true, or are you one of the brave souls who tries out a new one as soon as it is announced? Either way, learning a new language can be extremely useful, and a lot of fun.
|
||||
|
||||
You try out with a simple "Hello, world!" then move onto writing some sample code and executing it, making minor changes along the way and then moving on from there. I am sure we have all gone through this experience no matter which technology we've worked on. Though if you do manage to stay with a language for some time, and you wish to become proficient in it, there are a few things that can help you along the way.
|
||||
|
||||
One of those things is a debugger. Some people prefer debugging using simple "print" statements in code, and they are fine for a few simple line programs; however, if you are working on a large project with multiple developers and thousands of lines of code, it makes sense to invest in a debugger.
|
||||
|
||||
I've recently started learning the Go programming language, and in this article, we will explore a debugger called Delve. Delve is a special utility made to debug Go programs, and we will cover some of its features using some sample Go code. Don't worry about the Go code examples presented here; they are understandable even if you have never programmed in Go before. One of the goals of Go is simplicity, so the code is consistent, which can be easier to understand and interpret.
|
||||
|
||||
### Introduction to Delve
|
||||
|
||||
Delve is an open source project hosted at [GitHub][2].
|
||||
|
||||
In its own words:
|
||||
|
||||
_Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full-featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible._
|
||||
|
||||
Let's take a closer look.
|
||||
|
||||
My test system is a laptop running Fedora Linux along with the following Go compiler version:
|
||||
|
||||
|
||||
```
|
||||
$ cat /etc/fedora-release
|
||||
Fedora release 30 (Thirty)
|
||||
$
|
||||
$ go version
|
||||
go version go1.12.17 linux/amd64
|
||||
$
|
||||
```
|
||||
|
||||
### Golang installation
|
||||
|
||||
If you do not have Go installed, you can get it by simply running the following command to fetch it from your configured repositories.
|
||||
|
||||
|
||||
```
|
||||
`$ dnf install golang.x86_64`
|
||||
```
|
||||
|
||||
Alternatively, you can visit the [install page][3] for other installation options suitable for your OS distribution.
|
||||
|
||||
Before we get started, please ensure that the following required PATHS are set, as required by Go tools. If these paths are not set, some of the examples might not work. These can be easily set as environment variables in your SHELL's RC file, like the `$HOME/bashrc` file in my case.
|
||||
|
||||
|
||||
```
|
||||
$ go env | grep GOPATH
|
||||
GOPATH="/home/user/go"
|
||||
$
|
||||
$ go env | grep GOBIN
|
||||
GOBIN="/home/user/go/gobin"
|
||||
$
|
||||
```
|
||||
|
||||
### Delve installation
|
||||
|
||||
You can install Delve by running a simple `go get` command, as shown below. `go get` is the Golang way of downloading and installing required packages from external sources. If you do face any issues with installation, please refer to the install instructions for Delve [here][4].
|
||||
|
||||
|
||||
```
|
||||
$ go get -u github.com/go-delve/delve/cmd/dlv
|
||||
$
|
||||
```
|
||||
|
||||
Running the above command downloads Delve to your $GOPATH location, which, in the default case, happens to be $HOME/go. It will be different if you have set $GOPATH to something else.
|
||||
|
||||
You can move to the go/ directory, within which you will see `dlv` under bin/ directory.
|
||||
|
||||
|
||||
```
|
||||
$ ls -l $HOME/go
|
||||
total 8
|
||||
drwxrwxr-x. 2 user user 4096 May 25 19:11 bin
|
||||
drwxrwxr-x. 4 user user 4096 May 25 19:21 src
|
||||
$
|
||||
$ ls -l ~/go/bin/
|
||||
total 19596
|
||||
-rwxrwxr-x. 1 user user 20062654 May 25 19:17 dlv
|
||||
$
|
||||
```
|
||||
|
||||
Since you installed Delve under $GOPATH, it is also available as a regular shell command, so you do not have to move to the directory where it is installed every time. You can verify `dlv` is correctly installed by running it with the `version` option. The version it installed is 1.4.1.
|
||||
|
||||
|
||||
```
|
||||
$ which dlv
|
||||
~/go/bin/dlv
|
||||
$
|
||||
$ dlv version
|
||||
Delve Debugger
|
||||
Version: 1.4.1
|
||||
Build: $Id: bda606147ff48b58bde39e20b9e11378eaa4db46 $
|
||||
$
|
||||
```
|
||||
|
||||
Now, let's use Delve with some Go programs to understand its features and how to use them. As we do with all programs, let's start with a simple "Hello, world!" message, which, in Go, is called `hello.go`.
|
||||
|
||||
Remember, I am placing these sample programs within the $GOBIN directory.
|
||||
|
||||
|
||||
```
|
||||
$ pwd
|
||||
/home/user/go/gobin
|
||||
$
|
||||
$ cat hello.go
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, world!")
|
||||
}
|
||||
$
|
||||
```
|
||||
|
||||
To build a Go program, you run the `build` command and provide it with the source file using the .go extention. If the program is free of any syntax issues, the Go compiler compiles it and puts out a binary or executables file. This file can then be executed directly, and we see the "Hello, world!" message displayed onscreen.
|
||||
|
||||
|
||||
```
|
||||
$ go build hello.go
|
||||
$
|
||||
$ ls -l hello
|
||||
-rwxrwxr-x. 1 user user 1997284 May 26 12:13 hello
|
||||
$
|
||||
$ ./hello
|
||||
Hello, world!
|
||||
$
|
||||
```
|
||||
|
||||
### Loading a program in Delve
|
||||
|
||||
There are two ways to load a program into the Delve debugger.
|
||||
|
||||
**Using the debug argument when source code is not yet compiled to binary.**
|
||||
|
||||
The first way is to use the **debug** command when you simply need to source files. Delve compiles a binary for you named **__debug_bin**, and loads it into the debugger.
|
||||
|
||||
In this example, move to the directory where **hello.go** is present and run the **dlv debug** command. If there are multiple Go source files within a directory and each has its own main function, then Delve might throw an error, expecting a single program or a single project to build a binary from. Should that occur, you're better off using the second option, presented below.
|
||||
|
||||
|
||||
```
|
||||
$ ls -l
|
||||
total 4
|
||||
-rw-rw-r--. 1 user user 74 Jun 4 11:48 hello.go
|
||||
$
|
||||
$ dlv debug
|
||||
Type 'help' for list of commands.
|
||||
(dlv)
|
||||
```
|
||||
|
||||
Now open another terminal and list the contents of the same directory. You see an additional **__debug_bin** binary that was compiled from the source code and loaded into the debugger. You can now move to the **dlv** prompt to continue using Delve further.
|
||||
|
||||
|
||||
|
||||
```
|
||||
$ ls -l
|
||||
total 2036
|
||||
-rwxrwxr-x. 1 user user 2077085 Jun 4 11:48 __debug_bin
|
||||
-rw-rw-r--. 1 user user 74 Jun 4 11:48 hello.go
|
||||
$
|
||||
```
|
||||
|
||||
**Using the exec argument**
|
||||
The second method to load a program into Delve is useful when you have a pre-compiled Go binary, or one that you have already compiled using the **go build** command, and don't want Delve to compile it to a `__debug_bin` binary. In such cases, use the **exec** argument to load the binary directory into the Delve debugger.
|
||||
|
||||
|
||||
```
|
||||
$ ls -l
|
||||
total 4
|
||||
-rw-rw-r--. 1 user user 74 Jun 4 11:48 hello.go
|
||||
$
|
||||
$ go build hello.go
|
||||
$
|
||||
$ ls -l
|
||||
total 1956
|
||||
-rwxrwxr-x. 1 user user 1997284 Jun 4 11:54 hello
|
||||
-rw-rw-r--. 1 user user 74 Jun 4 11:48 hello.go
|
||||
$
|
||||
$ dlv exec ./hello
|
||||
Type 'help' for list of commands.
|
||||
(dlv)
|
||||
```
|
||||
|
||||
### Getting help within Delve
|
||||
|
||||
At the **dlv** prompt, you can run `help` to have a look at the various help options available in Delve. The command list is quite extensive, and we will cover some of the important features here. Following is an overview of Delve's functionality.
|
||||
|
||||
|
||||
```
|
||||
(dlv) help
|
||||
The following commands are available:
|
||||
|
||||
Running the program:
|
||||
|
||||
Manipulating breakpoints:
|
||||
|
||||
Viewing program variables and memory:
|
||||
|
||||
Listing and switching between threads and goroutines:
|
||||
|
||||
Viewing the call stack and selecting frames:
|
||||
|
||||
Other commands:
|
||||
|
||||
Type help followed by a command for full documentation.
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### Setting breakpoints
|
||||
|
||||
Now that we have loaded the hello.go program within the Delve debugger, let's set the breakpoint on our main function and then confirm it. Within Go, the main program starts with `main.main`, so you need to provide this name to the `break command`. Next, we will see if the breakpoint was set correctly using the `breakpoints` command.
|
||||
|
||||
Also, remember you can use shorthands for commands, so instead of using `break main.main`, you can also use `b main.main` to the same effect, or `bp` instead of `breakpoints`. To find the exact shorthand for a command, please refer to the help section by running the `help` command.
|
||||
|
||||
|
||||
```
|
||||
(dlv) break main.main
|
||||
Breakpoint 1 set at 0x4a228f for main.main() ./hello.go:5
|
||||
(dlv) breakpoints
|
||||
Breakpoint runtime-fatal-throw at 0x42c410 for runtime.fatalthrow() /usr/lib/golang/src/runtime/panic.go:663 (0)
|
||||
Breakpoint unrecovered-panic at 0x42c480 for runtime.fatalpanic() /usr/lib/golang/src/runtime/panic.go:690 (0)
|
||||
print runtime.curg._panic.arg
|
||||
Breakpoint 1 at 0x4a228f for main.main() ./hello.go:5 (0)
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### Continue execution of the program
|
||||
|
||||
Now, let's continue running the program using "continue." It will run until it hits a breakpoint, which, in our case, is the `main.main` or the main function. From there, we can use the `next` command to execute the program line by line. Notice that, once we move ahead of `fmt.Println("Hello, world!")`, we can see that `Hello, world!` is printed to the screen while we are still within the debugger session.
|
||||
|
||||
|
||||
```
|
||||
(dlv) continue
|
||||
> main.main() ./hello.go:5 (hits goroutine(1):1 total:1) (PC: 0x4a228f)
|
||||
1: package main
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
=> 5: func main() {
|
||||
6: fmt.Println("Hello, world!")
|
||||
7: }
|
||||
(dlv) next
|
||||
> main.main() ./hello.go:6 (PC: 0x4a229d)
|
||||
1: package main
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
5: func main() {
|
||||
=> 6: fmt.Println("Hello, world!")
|
||||
7: }
|
||||
(dlv) next
|
||||
Hello, world!
|
||||
> main.main() ./hello.go:7 (PC: 0x4a22ff)
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
5: func main() {
|
||||
6: fmt.Println("Hello, world!")
|
||||
=> 7: }
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### Quitting Delve
|
||||
|
||||
If you wish to quit the debugger at any time, you can run the `quit` command, and you will be returned to the shell prompt. Pretty simple, right?
|
||||
|
||||
|
||||
```
|
||||
(dlv) quit
|
||||
$
|
||||
```
|
||||
|
||||
Let's use some other Go programs to explore some other Delve features. This time, we will pick a program from the [Golang tour][5]. If you are learning Go, the Golang tour should be your first stop.
|
||||
|
||||
The following program, `functions.go`, simply displays how functions are defined and called in a Go program. Here, we have a simple `add()` function that adds two numbers and returns their value. You can build the program and execute it, as shown below.
|
||||
|
||||
|
||||
```
|
||||
$ cat functions.go
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func add(x int, y int) int {
|
||||
return x + y
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println(add(42, 13))
|
||||
}
|
||||
$
|
||||
```
|
||||
|
||||
You can build the program and execute it as shown below.
|
||||
|
||||
|
||||
```
|
||||
$ go build functions.go && ./functions
|
||||
55
|
||||
$
|
||||
```
|
||||
|
||||
#### Stepping into functions
|
||||
|
||||
As shown earlier, let's load the binary into the Delve debugger using one of the options mentioned earlier, again setting a breakpoint at `main.main` and continuing to run the program while we hit the breakpoint. Then hit `next` until you reach `fmt.Println(add(42, 13))`; here we make a call to the `add()` function. We can use the Delve `step` command to move from the `main` function to the `add()` function, as seen below.
|
||||
|
||||
|
||||
```
|
||||
$ dlv debug
|
||||
Type 'help' for list of commands.
|
||||
(dlv) break main.main
|
||||
Breakpoint 1 set at 0x4a22b3 for main.main() ./functions.go:9
|
||||
(dlv) c
|
||||
> main.main() ./functions.go:9 (hits goroutine(1):1 total:1) (PC: 0x4a22b3)
|
||||
4:
|
||||
5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
=> 9: func main() {
|
||||
10: fmt.Println(add(42, 13))
|
||||
11: }
|
||||
(dlv) next
|
||||
> main.main() ./functions.go:10 (PC: 0x4a22c1)
|
||||
5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
=> 10: fmt.Println(add(42, 13))
|
||||
11: }
|
||||
(dlv) step
|
||||
> main.add() ./functions.go:5 (PC: 0x4a2280)
|
||||
1: package main
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
=> 5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
10: fmt.Println(add(42, 13))
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### Set breakpoint using filename: linenumber
|
||||
|
||||
Above, we went through `main` and then moved to the `add()` function, but you can also use the `filename:linenumber` combination to set a breakpoint directly where we want it. Following is another way of setting a breakpoint at the start of the `add()` function.
|
||||
|
||||
|
||||
```
|
||||
(dlv) break functions.go:5
|
||||
Breakpoint 1 set at 0x4a2280 for main.add() ./functions.go:5
|
||||
(dlv) continue
|
||||
> main.add() ./functions.go:5 (hits goroutine(1):1 total:1) (PC: 0x4a2280)
|
||||
1: package main
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
=> 5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
10: fmt.Println(add(42, 13))
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### View current stack details
|
||||
|
||||
Now that we are at the `add()` function, we can view the current contents of the stack using the `stack` command in Delve. This shows the topmost function `add()` at 0 where we are, followed by `main.main` at 1 from where the `add()` function was called. Functions below `main.main` belong to the Go runtime, which is responsible for loading and executing the program.
|
||||
|
||||
|
||||
```
|
||||
(dlv) stack
|
||||
0 0x00000000004a2280 in main.add
|
||||
at ./functions.go:5
|
||||
1 0x00000000004a22d7 in main.main
|
||||
at ./functions.go:10
|
||||
2 0x000000000042dd1f in runtime.main
|
||||
at /usr/lib/golang/src/runtime/proc.go:200
|
||||
3 0x0000000000458171 in runtime.goexit
|
||||
at /usr/lib/golang/src/runtime/asm_amd64.s:1337
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### Move between frames
|
||||
|
||||
Using the `frame` command in Delve, we can switch between the above frames at will. In the example below, using `frame 1` switches us from within the `add()` frame to the `main.main` frame, and so on.
|
||||
|
||||
|
||||
```
|
||||
(dlv) frame 0
|
||||
> main.add() ./functions.go:5 (hits goroutine(1):1 total:1) (PC: 0x4a2280)
|
||||
Frame 0: ./functions.go:5 (PC: 4a2280)
|
||||
1: package main
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
=> 5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
10: fmt.Println(add(42, 13))
|
||||
(dlv) frame 1
|
||||
> main.add() ./functions.go:5 (hits goroutine(1):1 total:1) (PC: 0x4a2280)
|
||||
Frame 1: ./functions.go:10 (PC: 4a22d7)
|
||||
5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
=> 10: fmt.Println(add(42, 13))
|
||||
11: }
|
||||
(dlv)
|
||||
```
|
||||
|
||||
**Print function arguments**
|
||||
|
||||
A function often accepts multiple arguments to work on. In the case of the `add()` function, it accepts two integers. Delve has a handy command called `args`, which displays the command-line arguments passed to the function.
|
||||
|
||||
|
||||
```
|
||||
(dlv) args
|
||||
x = 42
|
||||
y = 13
|
||||
~r2 = 824633786832
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### View disassembly
|
||||
|
||||
Since we are dealing with compiled binaries, it is extremely helpful to be able to see the assembly language instructions produced by the compiler. Delve provides a `disassemble` command to view these. In the example below, we use it to view the disassembly instructions for the `add()` function.
|
||||
|
||||
|
||||
```
|
||||
(dlv) step
|
||||
> main.add() ./functions.go:5 (PC: 0x4a2280)
|
||||
1: package main
|
||||
2:
|
||||
3: import "fmt"
|
||||
4:
|
||||
=> 5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
10: fmt.Println(add(42, 13))
|
||||
(dlv) disassemble
|
||||
TEXT main.add(SB) /home/user/go/gobin/functions.go
|
||||
=> functions.go:5 0x4a2280 48c744241800000000 mov qword ptr [rsp+0x18], 0x0
|
||||
functions.go:6 0x4a2289 488b442408 mov rax, qword ptr [rsp+0x8]
|
||||
functions.go:6 0x4a228e 4803442410 add rax, qword ptr [rsp+0x10]
|
||||
functions.go:6 0x4a2293 4889442418 mov qword ptr [rsp+0x18], rax
|
||||
functions.go:6 0x4a2298 c3 ret
|
||||
(dlv)
|
||||
```
|
||||
|
||||
#### Stepout of functions
|
||||
|
||||
Another feature is `stepout`, which allows us to return back to where the function was called from. In our example, if we wish to return to the `main.main` function, we can simply run the `stepout` command and it will take us back. This can be quite a handy tool to help you move around in a large codebase.
|
||||
|
||||
|
||||
```
|
||||
(dlv) stepout
|
||||
> main.main() ./functions.go:10 (PC: 0x4a22d7)
|
||||
Values returned:
|
||||
~r2: 55
|
||||
|
||||
5: func add(x int, y int) int {
|
||||
6: return x + y
|
||||
7: }
|
||||
8:
|
||||
9: func main() {
|
||||
=> 10: fmt.Println(add(42, 13))
|
||||
11: }
|
||||
(dlv)
|
||||
```
|
||||
|
||||
Let's use another sample program from the [Go tour][6] to see how Delve deals with variables in Go. The following sample program defines and initializes some variables of different types. You can build the program and execute it.
|
||||
|
||||
|
||||
```
|
||||
$ cat variables.go
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
var i, j int = 1, 2
|
||||
|
||||
func main() {
|
||||
var c, python, java = true, false, "no!"
|
||||
fmt.Println(i, j, c, python, java)
|
||||
}
|
||||
$
|
||||
|
||||
$ go build variables.go && ./variables
|
||||
1 2 true false no!
|
||||
$
|
||||
```
|
||||
|
||||
#### Print variable information
|
||||
|
||||
As stated earlier, use `delve debug` to load the program in the debugger. You can use the `print` command from within Delve along with the variable name to show their current values.
|
||||
|
||||
|
||||
```
|
||||
(dlv) print c
|
||||
true
|
||||
(dlv) print java
|
||||
"no!"
|
||||
(dlv)
|
||||
```
|
||||
|
||||
Alternatively, you can use the `locals` command to print all local variables within a function.
|
||||
|
||||
|
||||
```
|
||||
(dlv) locals
|
||||
python = false
|
||||
c = true
|
||||
java = "no!"
|
||||
(dlv)
|
||||
```
|
||||
|
||||
If you are not aware of the type of the variable, you can use the `whatis` command along with the variable name to print the type.
|
||||
|
||||
|
||||
```
|
||||
(dlv) whatis python
|
||||
bool
|
||||
(dlv) whatis c
|
||||
bool
|
||||
(dlv) whatis java
|
||||
string
|
||||
(dlv)
|
||||
```
|
||||
|
||||
### Conclusion
|
||||
|
||||
So far, we have only scratched the surface of the features Delve offers. You can refer to the `help` section and try out various other commands. Some of the other useful features include attaching Delve to running Go programs (daemons!) or even using Delve to explore some of the internals of Golang libraries, provided you have the Go source code package installed. Keep exploring!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/debug-go-delve
|
||||
|
||||
作者:[Gaurav Kamathe][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/gkamathe
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y (Bug tracking magnifying glass on computer screen)
|
||||
[2]: https://github.com/go-delve/delve
|
||||
[3]: https://golang.org/doc/install
|
||||
[4]: https://github.com/go-delve/delve/blob/master/Documentation/installation/linux/install.md
|
||||
[5]: https://tour.golang.org/basics/4
|
||||
[6]: https://tour.golang.org/basics/9
|
@ -0,0 +1,488 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Fedora 32: Simple Local File-Sharing with Samba)
|
||||
[#]: via: (https://fedoramagazine.org/fedora-32-simple-local-file-sharing-with-samba/)
|
||||
[#]: author: (da2ce7 https://fedoramagazine.org/author/da2ce7/)
|
||||
|
||||
Fedora 32: Simple Local File-Sharing with Samba
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
Sharing files with Fedora 32 using Samba is cross-platform, convenient, reliable, and performant.
|
||||
|
||||
### What is ‘Samba’?
|
||||
|
||||
[Samba][2] is a high-quality implementation of [Server Message Block protocol (SMB)][3]. Originally developed by Microsoft for connecting windows computers together via local-area-networks, it is now extensively used for internal network communications.
|
||||
|
||||
Apple used to maintain it’s own independent file sharing called “[Apple Filing Protocol (**AFP**)][4]“, however in [recent times][5], it also has also switched to SMB.
|
||||
|
||||
**In this guide we provide the minimal instructions to enable:**
|
||||
|
||||
* Public Folder Sharing (Both Read Only and Read Write)
|
||||
* User Home Folder Access
|
||||
|
||||
|
||||
|
||||
```
|
||||
Note about this guide: The convention '~]$' for a local user command prompt, and '~]#' for a super user prompt will be used.
|
||||
```
|
||||
|
||||
### Public Sharing Folder
|
||||
|
||||
Having a shared public place where authenticated users on an internal network can access files, or even modify and change files if they are given permission, can be very convenient. This part of the guide walks through the process of setting up a shared folder, ready for sharing with Samba.
|
||||
|
||||
```
|
||||
Please Note: This guide assumes the public sharing folder is on a Modern Linux Filesystem; other filesystems such as NTFS or FAT32 will not work. Samba uses POSIX Access Control Lists (ACLs).
|
||||
|
||||
For those who wish to learn more about Access Control Lists, please consider reading the documentation: "Red Hat Enterprise Linux 7: System Administrator's Guide: Chapter 5. Access Control Lists", as it likewise applies to Fedora 32.
|
||||
|
||||
In General, this is only an issue for anyone who wishes to share a drive or filesystem that was created outside of the normal Fedora Installation process. (such as a external hard drive).
|
||||
|
||||
It is possible for Samba to share filesystem paths that do not support POSIX ACLs, however this is out of the scope of this guide.
|
||||
```
|
||||
|
||||
#### Create Folder
|
||||
|
||||
For this guide the _**/srv/public/**_ folder for sharing will be used.
|
||||
|
||||
> The _/srv/_ directory contains site-specific data served by a Red Hat Enterprise Linux system. This directory gives users the location of data files for a particular service, such as FTP, WWW, or CVS. Data that only pertains to a specific user should go in the _/home/_ directory.
|
||||
>
|
||||
> [Red Hat Enterprise Linux 7, Storage Administration Guide: Chapter 2. File System Structure and Maintenance: 2.1.1.8. The /srv/ Directory][6]
|
||||
|
||||
```
|
||||
Make the Folder (will provide an error if the folder already exists).
|
||||
~]# mkdir --verbose /srv/public
|
||||
|
||||
Verify folder exists:
|
||||
~]$ ls --directory /srv/public
|
||||
|
||||
Expected Output:
|
||||
/srv/public
|
||||
```
|
||||
|
||||
#### Set Filesystem Security Context
|
||||
|
||||
To have _read and write_ access to the public folder the _public_content_rw_t_ security context will be used for this guide. Those wanting _read only_ may use: _public_content_t_.
|
||||
|
||||
> Label files and directories that have been created with the _public_content_rw_t_ type to share them with read and write permissions through vsftpd. Other services, such as Apache HTTP Server, Samba, and NFS, also have access to files labeled with this type. Remember that booleans for each service must be enabled before they can write to files labeled with this type.
|
||||
>
|
||||
> [Red Hat Enterprise Linux 7, SELinux User’s and Administrator’s Guide: Chapter 16. File Transfer Protocol: 16.1. Types: public_content_rw_t][7]
|
||||
|
||||
Add _/srv/public_ as _“public_content_rw_t”_ in the system’s local filesystem security context customization registry:
|
||||
|
||||
```
|
||||
Add new security filesystem security context:
|
||||
~]# semanage fcontext --add --type public_content_rw_t "/srv/public(/.*)?"
|
||||
|
||||
Verifiy new security filesystem security context:
|
||||
~]# semanage fcontext --locallist --list
|
||||
|
||||
Expected Output: (should include)
|
||||
/srv/public(/.*)? all files system_u:object_r:public_content_rw_t:s0
|
||||
```
|
||||
|
||||
Now that the folder has been added to the local system’s filesystem security context registry; The **restorecon** command can be used to ‘restore’ the context to the folder:
|
||||
|
||||
```
|
||||
Restore security context to the /srv/public folder:
|
||||
$~]# restorecon -Rv /srv/public
|
||||
|
||||
Verify security context was correctly applied:
|
||||
~]$ ls --directory --context /srv/public/
|
||||
|
||||
Expected Output:
|
||||
unconfined_u:object_r:public_content_rw_t:s0 /srv/public/
|
||||
```
|
||||
|
||||
#### User Permissions
|
||||
|
||||
##### Creating the Sharing Groups
|
||||
|
||||
To allow a user to either have _read only_, or _read and write_ accesses to the public share folder create two new groups that govern these privileges: _public_readonly_ and _public_readwrite_.
|
||||
|
||||
User accounts can be granted access to _read only_, or _read and write_ by adding their account to the respective group (and allow login via Samba creating a smb password). This process is demonstrated in the section: “Test Public Sharing (localhost)”.
|
||||
|
||||
```
|
||||
Create the public_readonly and public_readwrite groups:
|
||||
~]# groupadd public_readonly
|
||||
~]# groupadd public_readwrite
|
||||
|
||||
Verify successful creation of groups:
|
||||
~]$ getent group public_readonly public_readwrite
|
||||
|
||||
Expected Output: (Note: x:1...: number will probability differ on your System)
|
||||
public_readonly:x:1009:
|
||||
public_readwrite:x:1010:
|
||||
```
|
||||
|
||||
##### Set Permissions
|
||||
|
||||
Now set the appropriate user permissions to the public shared folder:
|
||||
|
||||
```
|
||||
Set User and Group Permissions for Folder:
|
||||
~]# chmod --verbose 2700 /srv/public
|
||||
~]# setfacl -m group:public_readonly:r-x /srv/public
|
||||
~]# setfacl -m default:group:public_readonly:r-x /srv/public
|
||||
~]# setfacl -m group:public_readwrite:rwx /srv/public
|
||||
~]# setfacl -m default:group:public_readwrite:rwx /srv/public
|
||||
|
||||
Verify user permissions have been correctly applied:
|
||||
~]$ getfacl --absolute-names /srv/public
|
||||
|
||||
Expected Output:
|
||||
file: /srv/public
|
||||
owner: root
|
||||
group: root
|
||||
flags: -s-
|
||||
user::rwx
|
||||
group::---
|
||||
group:public_readonly:r-x
|
||||
group:public_readwrite:rwx
|
||||
mask::rwx
|
||||
other::---
|
||||
default:user::rwx
|
||||
default:group::---
|
||||
default:group:public_readonly:r-x
|
||||
default:group:public_readwrite:rwx
|
||||
default:mask::rwx
|
||||
default:other::---
|
||||
```
|
||||
|
||||
### Samba
|
||||
|
||||
#### Installation
|
||||
|
||||
```
|
||||
~]# dnf install samba
|
||||
```
|
||||
|
||||
#### Hostname (systemwide)
|
||||
|
||||
Samba will use the name of the computer when sharing files; it is good to set a hostname so that the computer can be found easily on the local network.
|
||||
|
||||
```
|
||||
View Your Current Hostname:
|
||||
~]$ hostnamectl status
|
||||
```
|
||||
|
||||
If you wish to change your hostname to something more descriptive, use the command:
|
||||
|
||||
```
|
||||
Modify your system's hostname (example):
|
||||
~]# hostnamectl set-hostname "simple-samba-server"
|
||||
```
|
||||
|
||||
```
|
||||
For a more complete overview of the hostnamectl command, please read the previous Fedora Magazine Article: "How to set the hostname on Fedora".
|
||||
```
|
||||
|
||||
#### Firewall
|
||||
|
||||
Configuring your firewall is a complex and involved task. This guide will just have the most minimal manipulation of the firewall to enable Samba to pass through.
|
||||
|
||||
```
|
||||
For those who are interested in learning more about configuring firewalls; please consider reading the documentation: "Red Hat Enterprise Linux 8: Securing networks: Chapter 5. Using and configuring firewall", as it generally applies to Fedora 32 as well.
|
||||
```
|
||||
|
||||
```
|
||||
Allow Samba access through the firewall:
|
||||
~]# firewall-cmd --add-service=samba --permanent
|
||||
~]# firewall-cmd --reload
|
||||
|
||||
Verify Samba is included in your active firewall:
|
||||
~]$ firewall-cmd --list-services
|
||||
|
||||
Output (should include):
|
||||
samba
|
||||
```
|
||||
|
||||
#### Configuration
|
||||
|
||||
##### Remove Default Configuration
|
||||
|
||||
The stock configuration that is included with Fedora 32 is not required for this simple guide. In particular it includes support for sharing printers with Samba.
|
||||
|
||||
For this guide make a backup of the default configuration and create a new configuration file from scratch.
|
||||
|
||||
```
|
||||
Create a backup copy of the existing Samba Configuration:
|
||||
~]# cp --verbose --no-clobber /etc/samba/smb.conf /etc/samba/smb.conf.fedora0
|
||||
|
||||
Empty the configuration file:
|
||||
~]# > /etc/samba/smb.conf
|
||||
```
|
||||
|
||||
##### Samba Configuration
|
||||
|
||||
```
|
||||
Please Note: This configuration file does not contain any global definitions; the defaults provided by Samba are good for purposes of this guide.
|
||||
```
|
||||
|
||||
```
|
||||
Edit the Samba Configuration File with Vim:
|
||||
~]# vim /etc/samba/smb.conf
|
||||
```
|
||||
|
||||
Add the following to _/etc/samba/smb.conf_ file:
|
||||
|
||||
```
|
||||
# smb.conf - Samba Configuration File
|
||||
|
||||
# The name of the share is in square brackets [],
|
||||
# this will be shared as //hostname/sharename
|
||||
|
||||
# There are a three exceptions:
|
||||
# the [global] section;
|
||||
# the [homes] section, that is dynamically set to the username;
|
||||
# the [printers] section, same as [homes], but for printers.
|
||||
|
||||
# path: the physical filesystem path (or device)
|
||||
# comment: a label on the share, seen on the network.
|
||||
# read only: disable writing, defaults to true.
|
||||
|
||||
# For a full list of configuration options,
|
||||
# please read the manual: "man smb.conf".
|
||||
|
||||
[global]
|
||||
|
||||
[public]
|
||||
path = /srv/public
|
||||
comment = Public Folder
|
||||
read only = No
|
||||
```
|
||||
|
||||
#### Write Permission
|
||||
|
||||
By default Samba is not granted permission to modify any file of the system. Modify system’s security configuration to allow Samba to modify any filesystem path that has the security context of _public_content_rw_t_.
|
||||
|
||||
For convenience, Fedora has a built-in SELinux Boolean for this purpose called: _smbd_anon_write_, setting this to _true_ will enable Samba to write in any filesystem path that has been set to the security context of _public_content_rw_t_.
|
||||
|
||||
For those who are wishing Samba only have a read-only access to their public sharing folder, they may choose skip this step and not set this boolean.
|
||||
|
||||
```
|
||||
There are many more SELinux boolean that are available for Samba. For those who are interested, please read the documentation: "Red Hat Enterprise Linux 7: SELinux User's and Administrator's Guide: 15.3. Samba Booleans", it also apply to Fedora 32 without any adaptation.
|
||||
```
|
||||
|
||||
```
|
||||
Set SELinux Boolean allowing Samba to write to filesystem paths set with the security context public_content_rw_t:
|
||||
~]# setsebool -P smbd_anon_write=1
|
||||
|
||||
Verify bool has been correctly set:
|
||||
$ getsebool smbd_anon_write
|
||||
|
||||
Expected Output:
|
||||
smbd_anon_write --> on
|
||||
```
|
||||
|
||||
### Samba Services
|
||||
|
||||
The Samba service is divided into two parts that we need to start.
|
||||
|
||||
#### Samba ‘smb’ Service
|
||||
|
||||
The Samba “Server Message Block” (SMB) services is for sharing files and printers over the local network.
|
||||
|
||||
Manual: “[smbd – server to provide SMB/CIFS services to clients][8]“
|
||||
|
||||
#### Enable and Start Services
|
||||
|
||||
```
|
||||
For those who are interested in learning more about configuring, enabling, disabling, and managing services, please consider studying the documentation: "Red Hat Enterprise Linux 7: System Administrator's Guide: 10.2. Managing System Services".
|
||||
```
|
||||
|
||||
```
|
||||
Enable and start smb and nmb services:
|
||||
~]# systemctl enable smb.service
|
||||
~]# systemctl start smb.service
|
||||
|
||||
Verify smb service:
|
||||
~]# systemctl status smb.service
|
||||
```
|
||||
|
||||
#### Test Public Sharing (localhost)
|
||||
|
||||
To demonstrate allowing and removing access to the public shared folder, create a new user called _samba_test_user_, this user will be granted permissions first to read the public folder, and then access to read and write the public folder.
|
||||
|
||||
The same process demonstrated here can be used to grant access to your public shared folder to other users of your computer.
|
||||
|
||||
The _samba_test_user_ will be created as a locked user account, disallowing normal login to the computer.
|
||||
|
||||
```
|
||||
Create 'samba_test_user', and lock the account.
|
||||
~]# useradd samba_test_user
|
||||
~]# passwd --lock samba_test_user
|
||||
|
||||
Set a Samba Password for this Test User (such as 'test'):
|
||||
~]# smbpasswd -a samba_test_user
|
||||
```
|
||||
|
||||
##### Test Read Only access to the Public Share:
|
||||
|
||||
```
|
||||
Add samba_test_user to the public_readonly group:
|
||||
~]# gpasswd --add samba_test_user public_readonly
|
||||
|
||||
Login to the local Samba Service (public folder):
|
||||
~]$ smbclient --user=samba_test_user //localhost/public
|
||||
|
||||
First, the ls command should succeed,
|
||||
Second, the mkdir command should not work,
|
||||
and finally, exit:
|
||||
smb: \> ls
|
||||
smb: \> mkdir error
|
||||
smb: \> exit
|
||||
|
||||
Remove samba_test_user from the public_readonly group:
|
||||
gpasswd --delete samba_test_user public_readonly
|
||||
```
|
||||
|
||||
##### Test Read and Write access to the Public Share:
|
||||
|
||||
```
|
||||
Add samba_test_user to the public_readwrite group:
|
||||
~]# gpasswd --add samba_test_user public_readwrite
|
||||
|
||||
Login to the local Samba Service (public folder):
|
||||
~]$ smbclient --user=samba_test_user //localhost/public
|
||||
|
||||
First, the ls command should succeed,
|
||||
Second, the mkdir command should work,
|
||||
Third, the rmdir command should work,
|
||||
and finally, exit:
|
||||
smb: \> ls
|
||||
smb: \> mkdir success
|
||||
smb: \> rmdir success
|
||||
smb: \> exit
|
||||
|
||||
Remove samba_test_user from the public_readwrite group:
|
||||
~]# gpasswd --delete samba_test_user public_readwrite
|
||||
```
|
||||
|
||||
After testing is completed, for security, disable the **samba_test_user**‘s ability to login in via samba.
|
||||
|
||||
```
|
||||
Disable samba_test_user login via samba:
|
||||
~]# smbpasswd -d samba_test_user
|
||||
```
|
||||
|
||||
### Home Folder Sharing
|
||||
|
||||
In this last section of the guide; Samba will be configured to share a user home folder.
|
||||
|
||||
For example: If the user bob has been registered with _smbpasswd_, bob’s home directory _/home/bob_, would become the share _//server-name/bob_.
|
||||
|
||||
This share will only be available for bob, and no other users.
|
||||
|
||||
```
|
||||
This is a very convenient way of accessing your own local files; however naturally it carries at a security risk.
|
||||
```
|
||||
|
||||
#### Setup Home Folder Sharing
|
||||
|
||||
##### Give Samba Permission for Public Folder Sharing
|
||||
|
||||
```
|
||||
Set SELinux Boolean allowing Samba to read and write to home folders:
|
||||
~]# setsebool -P samba_enable_home_dirs=1
|
||||
|
||||
Verify bool has been correctly set:
|
||||
$ getsebool samba_enable_home_dirs
|
||||
|
||||
Expected Output:
|
||||
samba_enable_home_dirs --> on
|
||||
```
|
||||
|
||||
##### Add Home Sharing to the Samba Configuration
|
||||
|
||||
**Append the following to the systems smb.conf file:**
|
||||
|
||||
```
|
||||
# The home folder dynamically links to the user home.
|
||||
|
||||
# If 'bob' user uses Samba:
|
||||
# The homes section is used as the template for a new virtual share:
|
||||
|
||||
# [homes]
|
||||
# ... (various options)
|
||||
|
||||
# A virtual section for 'bob' is made:
|
||||
# Share is modified: [homes] -> [bob]
|
||||
# Path is added: path = /home/bob
|
||||
# Any option within the [homes] section is appended.
|
||||
|
||||
# [bob]
|
||||
# path = /home/bob
|
||||
# ... (copy of various options)
|
||||
|
||||
|
||||
# here is our share,
|
||||
# same as is included in the Fedora default configuration.
|
||||
|
||||
[homes]
|
||||
comment = Home Directories
|
||||
valid users = %S, %D%w%S
|
||||
browseable = No
|
||||
read only = No
|
||||
inherit acls = Yes
|
||||
```
|
||||
|
||||
##### Reload Samba Configuration
|
||||
|
||||
```
|
||||
Tell Samba to reload it's configuration:
|
||||
~]# smbcontrol all reload-config
|
||||
```
|
||||
|
||||
#### Test Home Directory Sharing
|
||||
|
||||
```
|
||||
Switch to samba_test_user and create a folder in it's home directory:
|
||||
~]# su samba_test_user
|
||||
samba_test_user:~]$ cd ~
|
||||
samba_test_user:~]$ mkdir --verbose test_folder
|
||||
samba_test_user:~]$ exit
|
||||
|
||||
Enable samba_test_user to login via Samba:
|
||||
~]# smbpasswd -e samba_test_user
|
||||
|
||||
Login to the local Samba Service (samba_test_user home folder):
|
||||
$ smbclient --user=samba_test_user //localhost/samba_test_user
|
||||
|
||||
Test (all commands should complete without error):
|
||||
smb: \> ls
|
||||
smb: \> ls test_folder
|
||||
smb: \> rmdir test_folder
|
||||
smb: \> mkdir home_success
|
||||
smb: \> rmdir home_success
|
||||
smb: \> exit
|
||||
|
||||
Disable samba_test_user from login in via Samba:
|
||||
~]# smbpasswd -d samba_test_user
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/fedora-32-simple-local-file-sharing-with-samba/
|
||||
|
||||
作者:[da2ce7][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/da2ce7/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/sambabasics-816x346.png
|
||||
[2]: https://www.samba.org/samba/
|
||||
[3]: https://en.wikipedia.org/wiki/Server_Message_Block
|
||||
[4]: https://en.wikipedia.org/wiki/Apple_Filing_Protocol
|
||||
[5]: https://appleinsider.com/articles/13/06/11/apple-shifts-from-afp-file-sharing-to-smb2-in-os-x-109-mavericks
|
||||
[6]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-filesystem#s3-filesystem-srv
|
||||
[7]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/chap-managing_confined_services-file_transfer_protocol#sect-Managing_Confined_Services-File_Transfer_Protocol-Types
|
||||
[8]: https://www.samba.org/samba/docs/current/man-html/smbd.8.html
|
@ -0,0 +1,194 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Use Microsoft OneDrive in Linux With Rclone Open-Source Tool [For Intermediate to Expert Users])
|
||||
[#]: via: (https://itsfoss.com/use-onedrive-linux-rclone/)
|
||||
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
|
||||
|
||||
How to Use Microsoft OneDrive in Linux With Rclone Open-Source Tool [For Intermediate to Expert Users]
|
||||
======
|
||||
|
||||
_**Brief: A step-by-step tutorial showing how to use the rclone command line tool to synchronize OneDrive in Linux.**_
|
||||
|
||||
There are [several cloud storage services available for Linux][1]. There is [Dropbox][2] that gives 2 GB of free space. You can also use [Mega][3] where you can get 15 GB of free storage.
|
||||
|
||||
Microsoft’s own Cloud storage service, OneDrive gives 5 GB of free storage to any Microsoft account holder. The one major problem is that unlike Dropbox and Mega, Microsoft does not provide a desktop client for Linux.
|
||||
|
||||
This means that you’ll have to resort to using web browser for accessing your files in OneDrive which is not very convinient.
|
||||
|
||||
There is a hassle-free, GUI application [Insync][4] that lets you [use OneDrive on Linux easily][5]. But it’s a premium software and not everyone would like that.
|
||||
|
||||
If you are not afraid of the Linux terminal, let me show you a command line tool rclone that you can use for synchronizing Microsoft OneDrive in Linux.
|
||||
|
||||
![][6]
|
||||
|
||||
### What is rclone?
|
||||
|
||||
Rclone is an open source command line tool that enables you to synchronize a local Linux directory with various cloud storage services.
|
||||
|
||||
With rclone, you can backup files to cloud storage, restore files from cloud storage, mirror cloud data, migrate data between cloud services, use multiple cloud storage as disk.
|
||||
|
||||
You can use it with Google Drive, OneDrive, Nextcloud, Amazon S3 and over [40 such cloud services][7].
|
||||
|
||||
Rclone is an extensive command line tool and using it could be confusing with so many options. This is why I wrote this tutorial to show you how to use rclone with Microsoft OneDrive.
|
||||
|
||||
### Sync Microsoft OneDrive in Linux with rclone
|
||||
|
||||
Using Rclone in Linux is not that complicated but requires some patience and familiarity with the Linux terminal. You need to tweak the configuration a little to make it work. Let’s see how to do that.
|
||||
|
||||
#### Step 1: Install Rclone
|
||||
|
||||
I am [using Ubuntu 20.04][8] in this tutorial but you should be able to follow this tutorial in pretty much any Linux distribution. Just the rclone installation instruction could be different but the rest of steps remains the same.
|
||||
|
||||
In Debian/Ubuntu based distributions use:
|
||||
|
||||
```
|
||||
sudo apt install rclone
|
||||
```
|
||||
|
||||
For Arch-based distributions, use:
|
||||
|
||||
```
|
||||
sudo pacman -S rclone
|
||||
```
|
||||
|
||||
For other distributions, please use your distribution’s package manager.
|
||||
|
||||
#### Step 2: Adding new remote
|
||||
|
||||
Once you have installed rclone successfully, you need to configure rclone. Enter the following command in the terminal:
|
||||
|
||||
```
|
||||
rclone config
|
||||
```
|
||||
|
||||
If it’s your first time using rclone, you have to add a new remote to rclone. Select ‘**n**‘ to add new remote.
|
||||
|
||||
![Configuring Rclone][9]
|
||||
|
||||
Now you have to enter the name of remote. You can enter any name here that matches the cloud service so that it is easy to identify. I am using ‘**onedrive**‘.
|
||||
|
||||
![Configuring Rclone ][10]
|
||||
|
||||
#### Step 3: Select cloud service you want to sync with rclone
|
||||
|
||||
After entering name and hitting enter, you will see a list of cloud services like Google cloud storage, Box, One Drive and others.
|
||||
|
||||
You have to enter the number of the service you want to use. In this case, it’s ‘One Drive’. Make sure you enter the correct number.
|
||||
|
||||
![Selecting Cloud Service][11]
|
||||
|
||||
As you don’t need to enter client ID or secret ID hit **Enter** twice.
|
||||
|
||||
Next enter **‘N’** for selecting **no** for advanced configuration. Of course, if you want to configure something very specific, you can go ahead with **Y**.
|
||||
|
||||
![Configuring OneDrive][12]
|
||||
|
||||
When you’re asked for **‘Use auto config’**, press **Y**.
|
||||
|
||||
#### Step 4: Login to OneDrive account
|
||||
|
||||
When you enter ‘y’ and hit enter, your default browser will open and here you have to log into your Microsoft account. And if it asks for permission click on **‘yes’**.
|
||||
|
||||
![One Drive Logging In][13]
|
||||
|
||||
#### Step 5: Enter account type
|
||||
|
||||
Now you have to select account type. For most of the users it will be the first one, **‘One drive Personal or business’**. I believe it is personal so go with 1.
|
||||
|
||||
![][14]
|
||||
|
||||
After that, you will get a list of ‘Drives’ associated with your account. So, for the most part, you need to select ‘0’ to select your drive and enter ‘**Y**‘ for yes in next step.
|
||||
|
||||
![][15]
|
||||
|
||||
It will ask for one last time if this configuration is okay? Hit **‘Y’** if it is.
|
||||
|
||||
![][16]
|
||||
|
||||
And then enter **‘q’** to exit the Rclone configuration menu.
|
||||
|
||||
![][17]
|
||||
|
||||
#### Step 5: Mounting OneDrive int file manager
|
||||
|
||||
Create folder in your home directory where you will mount OneDrive. I will name the folder “OneDrive”. You can name it whatever you want, but please make sure you change the name to yours in the commands.
|
||||
|
||||
[Create a new folder with mkdir command][18] in your home directory or wherever you want:
|
||||
|
||||
```
|
||||
mkdir ~/OneDrive
|
||||
```
|
||||
|
||||
Now you have to use the following command:
|
||||
|
||||
```
|
||||
rclone --vfs-cache-mode writes mount "one drive": ~/OneDrive
|
||||
```
|
||||
|
||||
In above command “one drive” is the name of the “remote”, so you should use the correct name there if yours is different. You can check the name of the “remote” in step 2 of this tutorial.
|
||||
|
||||
![Mounting One Drive][19]
|
||||
|
||||
This command will mount one drive in given location and will continue to run in terminal. When you stop the process with,`ctrl + c` the one drive will be unmounted.
|
||||
|
||||
To mount one drive on startup, follow the next step below.
|
||||
|
||||
#### Step 6: Mount One Drive on startup
|
||||
|
||||
Every Linux distribution gives some way to manage startup application. I am using [Ubuntu’s Startup Application Preferences tool][20] here.
|
||||
|
||||
Open “**Startup Applications**“. And click on “**Add**“. Now, in the command field, enter the following:
|
||||
|
||||
```
|
||||
sh -c "rclone --vfs-cache-mode writes mount onedrive: ~/OneDrive"
|
||||
```
|
||||
|
||||
![Mounting OneDrive On Startup][21]
|
||||
|
||||
That’s it. Now, you can easily use OneDrive on Linux without any hiccups.
|
||||
|
||||
As you can see, using OneDrive in Linux with rclone takes some effort. If you want an easy way out, get a GUI tool like [Insync][4]. and use OneDrive natively in Linux.
|
||||
|
||||
I hope you find this tutorial helpful. If you have any questions or suggestion, we’ll be happy to help you out.
|
||||
|
||||
### Sumeet
|
||||
|
||||
Computer engineer, FOSS lover, lower level computing enthusiast. Believe in helping others and spreading knowledge. When I get off from computer (it rarely happens) I do painting, reading and watching movies/series. Love the work of Sir Arthur Conan Doyle, J. R. R. Tolkien and J. K. Rowling. BTW, I use Arch.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/use-onedrive-linux-rclone/
|
||||
|
||||
作者:[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://itsfoss.com/cloud-services-linux/
|
||||
[2]: https://www.dropbox.com/
|
||||
[3]: https://itsfoss.com/recommends/mega/
|
||||
[4]: https://itsfoss.com/recommends/insync/
|
||||
[5]: https://itsfoss.com/use-onedrive-on-linux/
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/sync-onedrive-in-linux-rclone.png?ssl=1
|
||||
[7]: https://rclone.org/#providers
|
||||
[8]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Configuring-Rclone.png?resize=800%2C298&ssl=1
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Configuring-Rclone-1.png?resize=800%2C303&ssl=1
|
||||
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Selecting-cloud-service.png?resize=800%2C416&ssl=1
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Configuring-OneDrive-1.png?resize=800%2C416&ssl=1
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/One-Drive-logging-in.png?resize=800%2C432&ssl=1
|
||||
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Configuring-OneDrive-2.png?resize=800%2C430&ssl=1
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Configuring-OneDrive-3.png?resize=800%2C428&ssl=1
|
||||
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Configuring-One-Drive.png?resize=800%2C426&ssl=1
|
||||
[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Exiting-Rclone-Configuration.png?resize=800%2C255&ssl=1
|
||||
[18]: https://linuxhandbook.com/mkdir-command/
|
||||
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Mounting-one-drive-1.png?fit=800%2C432&ssl=1
|
||||
[20]: https://itsfoss.com/manage-startup-applications-ubuntu/
|
||||
[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Mounting-OneDrive-on-startup.png?fit=800%2C499&ssl=1
|
@ -0,0 +1,219 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Manjaro Linux Review: ‘Arch Linux for Human Beings’ Provides Rolling Release for Every User)
|
||||
[#]: via: (https://itsfoss.com/manjaro-linux-review/)
|
||||
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
|
||||
|
||||
Manjaro Linux Review: ‘Arch Linux for Human Beings’ Provides Rolling Release for Every User
|
||||
======
|
||||
|
||||
[Manjaro 20.0 Lysia][1] has been released lately. In this article, I’ll take a look at the features of [Manjaro Linux][2] in general, discuss [why people like Manjaro][3] and compare the performance of Cinnamon desktop with Linux Mint 19.3 Cinnamon edition.
|
||||
|
||||
### Manjaro Linux: Why so popular?
|
||||
|
||||
![Image Source][4]
|
||||
|
||||
To every stereotype there is some element of truth. One of the main reasons that Manjaro is so popular has to do with its roots. Manjaro is based on Arch Linux and inherits many elements of [Arch Linux][5] but it is a very distinct project.
|
||||
|
||||
Unlike Arch Linux, almost everything is pre-configured in Manjaro. This makes it one of the most [user-friendly Arch-based distributions][6]. A lot of new users get attracted to this idea and I can’t blame them.
|
||||
|
||||
Will Manjaro then can be the new Ubuntu for a new comer? My answer is Yes!
|
||||
|
||||
[Ubuntu][7] and [Canonical][8] will always have my utmost respect as it has a huge success on making Linux easily accessible to newcomers.
|
||||
|
||||
Just as Ubuntu made “Linux for human beings”, Manjaro made “Arch Linux for human beings”.
|
||||
|
||||
But his doesn’t mean Manjaro is a [Linux distribution for beginners][9] only. Manjaro can be suitable for both and experienced users.
|
||||
|
||||
Let me go over some of the main features of Manjaro.
|
||||
|
||||
#### Easy installation
|
||||
|
||||
[Installing Arch Linux can be a nightmare][10] for many users. On the other hand, [installing Manjaro Linux][11] is easier thanks to the [Calamares][12] graphical installer.
|
||||
|
||||
![Manjaro Linux graphical installer][13]
|
||||
|
||||
If you want to take control in your own hands, you can use [Manjaro Architect][14]. It provides a terminal-based installer. It is still easier than installing directly through commands.
|
||||
|
||||
![][15]
|
||||
|
||||
#### Desktop environments and Window Managers of your choice
|
||||
|
||||
Officially Manjaro Linux supports [Xfce desktop][16] as the default choice. The Xfce in Manjaro looks good thanks to the customization. Manjaro also offers GNOME and KDE Plasma variants.
|
||||
|
||||
If that is not enough, Manjaro community maintains [Awesome][17], [Bspwm][18], [Budgie][19], [Cinnamon][20], [i3][21], LXDE, LXQt, [MATE][22] and [Openbox][23].
|
||||
|
||||
![Desktop flavors available via Manjaro Architect][24]
|
||||
|
||||
#### X86 architecture is not a limitation for Manjaro
|
||||
|
||||
You are not limited to [X86 architecture][25] with Manjaro as it is ARM architecture friendly.
|
||||
|
||||
Images for [PineBook Pro][26], [Raspberry Pi][27], [Rock Pi][28] 4, Rock Pro 64, [Khadas Vim][29] 1 & 3 and [other single board computers][30] are available in Xfce and KDE Plasma flavors.
|
||||
|
||||
#### Rolling release but not rolling blindly
|
||||
|
||||
Manjaro is a stable bleeding edge rolling release and is claimed to be more tested than Arch Linux because it performs some [additional testing][31] before releasing the updates.
|
||||
|
||||
![][32]
|
||||
|
||||
#### **New** **hardware? One click and it’s done.**
|
||||
|
||||
Manjaro comes with a [hardware detection tool][33] known as MHWD. If you need drivers for your hardware, just open it, click on “Auto Install” and wait until it’s finished. That’s it.
|
||||
|
||||
![Manjaro hardware configuration GUI tool][34]
|
||||
|
||||
#### **Ease to switch Linux kernels.**
|
||||
|
||||
Power-users and people who need special features of the [Linux Kernel][35] that don’t come with the default one, can just switch to a different Kernel with one click.
|
||||
|
||||
* **RT-Kernel** (Real Time) is suitable for a multimedia user and for applications real time features.
|
||||
* **LTS kernel** is the way to go if stability your priority.
|
||||
* **Latest kernel** has the latest features and supports the latest hardware. Did you get a recently introduced to the market graphics card? The newest kernel is for you.
|
||||
|
||||
|
||||
|
||||
![Manjaro kernel GUI switch][36]
|
||||
|
||||
Manjaro supports multiple installed Kernels at the same time. Just re-boot your system and make your selection in the boot menu.
|
||||
|
||||
#### Access to the massive Arch User Repository (AUR)
|
||||
|
||||
What doesn’t work so well with Ubuntu-based distributions is managing [Personal Package Archives (PPAs)][37]. A PPA is a repository for a single or several applications, usually from an independent developer.
|
||||
|
||||
Managing PPAs can become troublesome. They should be purged as they can become abandoned and orphaned without notice. You need to reinstate them if you reinstall Ubuntu.
|
||||
|
||||
If you use Manjaro, you also have access to the [Arch User Repository][38] (AUR). The [AUR is probably the largest repository][39] catering for any distribution. It’s certainly stocked with the freshest produce.
|
||||
|
||||
#### Snap and Flatpack support in the Pamac software manager
|
||||
|
||||
![Snap applications in Pamac][40]
|
||||
|
||||
Pamac 9.4 series has enabled Snap and Flatpak support by default. You can now install snaps or flatpaks with Pamac in GUI or terminal and access an even [larger selection of the Linux applications][41].
|
||||
|
||||
#### Global set of mirrors
|
||||
|
||||
No-matter your location Manjaro has a [great number of servers][42] which is known as mirrors and you can choose the closest available.
|
||||
|
||||
Top tip!
|
||||
|
||||
If you are a frequent traveler all you have to do is to open the terminal and run the following command:
|
||||
|
||||
sudo pacman-mirrors –geoip && sudo pacman -Syyu
|
||||
|
||||
This simple command will ping a list of mirrors for your country only, rating each one and reordering the list so the faster mirrors are at the top. Don’t forget to run the command once you get back home!
|
||||
|
||||
#### ZFS filesystem support
|
||||
|
||||
As mentioned previously, command line interface installer is called Manjaro Architect and if you are an experienced user there is a [guide to follow][14]. You can use [ZFS filesystem][43] as root in Manjaro 20.0 Lysia Architect.
|
||||
|
||||
### Performance comparison of Manjaro 19 Cinnamon with Linux Mint 19.3 Cinnamon
|
||||
|
||||
I am not an expert on performance comparison and other low-level stuff. So, please forgive me if you dislike this comparison.
|
||||
|
||||
Manjaro feels snappier than Ubuntu and its derivatives. So, what can explain the speed benefits?
|
||||
A possible explanation could be the RAM and active tasks usage on idle.
|
||||
|
||||
Here are the stats for idle Manjaro Cinnamon. The idle memory usage is 577 MB.
|
||||
|
||||
![htop running on Manjaro 19.0.2 – Cinnamon 4.4.8][44]
|
||||
|
||||
Here are the stats for an idle Linux Mint Cinnamon. The idle memory usage is 656 MB.
|
||||
|
||||
![htop running on Linux Mint 19.3 – Cinnamon 4.4.8][45]
|
||||
|
||||
By running the below command you can [check the running services in Linux][46]:
|
||||
|
||||
```
|
||||
systemctl list-unit-files --state=enabled --no-pager
|
||||
```
|
||||
|
||||
The results on Manjaro:
|
||||
|
||||
![Manjaro running services][47]
|
||||
|
||||
The results on Linux Mint:
|
||||
|
||||
![Linux Mint running services][48]
|
||||
|
||||
Each of these services consume system resources, and more specifically system memory and kernel time.
|
||||
|
||||
#### Conclusion
|
||||
|
||||
Manjaro takes most of the risk out of the rolling model by delaying the release of new applications and features for several weeks. The rolling distribution, out-of-the-box Arch experience will win you over.
|
||||
|
||||
* No-hassle experience
|
||||
* Kernel management
|
||||
* Superior packaging system
|
||||
* Excellent hardware detection
|
||||
* Fast & responsive
|
||||
|
||||
|
||||
|
||||
Let me know your thoughts on Manjaro on the comments below and don’t forget to [subscribe to our weekly Linux newsletter][49].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/manjaro-linux-review/
|
||||
|
||||
作者:[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://itsfoss.com/manjaro-20-release/
|
||||
[2]: https://manjaro.org/
|
||||
[3]: https://itsfoss.com/why-use-manjaro-linux/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/manjaro_wallpaper.jpg?ssl=1
|
||||
[5]: https://www.archlinux.org/
|
||||
[6]: https://itsfoss.com/arch-based-linux-distros/
|
||||
[7]: https://ubuntu.com/
|
||||
[8]: https://canonical.com/
|
||||
[9]: https://itsfoss.com/best-linux-beginners/
|
||||
[10]: https://itsfoss.com/install-arch-linux/
|
||||
[11]: https://itsfoss.com/install-manjaro-linux/
|
||||
[12]: https://calamares.io/
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/manjaro_install_installer_partition-1.png?resize=800%2C499&ssl=1
|
||||
[14]: https://itsfoss.com/manjaro-architect-review/
|
||||
[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/06/manjaro-architect-main.png?ssl=1
|
||||
[16]: https://www.xfce.org/
|
||||
[17]: https://awesomewm.org/
|
||||
[18]: https://github.com/baskerville/bspwm
|
||||
[19]: https://github.com/solus-project/budgie-desktop
|
||||
[20]: https://github.com/linuxmint/Cinnamon
|
||||
[21]: https://i3wm.org/
|
||||
[22]: https://mate-desktop.org/
|
||||
[23]: http://openbox.org/wiki/Main_Page
|
||||
[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/06/manjaro-architect-de.png?ssl=1
|
||||
[25]: https://www.computerhope.com/jargon/x/x86.htm
|
||||
[26]: https://itsfoss.com/pinebook-pro/
|
||||
[27]: https://itsfoss.com/raspberrypi/
|
||||
[28]: https://rockpi.org/
|
||||
[29]: https://itsfoss.com/vim3l/
|
||||
[30]: https://itsfoss.com/raspberry-pi-alternatives/
|
||||
[31]: https://manjaro.org/features/fresh-and-stable/
|
||||
[32]: https://i1.wp.com/manjaro.org/img/features/repositories.png?ssl=1
|
||||
[33]: https://wiki.manjaro.org/index.php?title=Manjaro_Hardware_Detection
|
||||
[34]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/hardware-detection.png?ssl=1
|
||||
[35]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
|
||||
[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/Manjaro-kernel-switch.png?ssl=1
|
||||
[37]: https://itsfoss.com/ppa-guide/
|
||||
[38]: https://aur.archlinux.org/
|
||||
[39]: https://itsfoss.com/aur-arch-linux/
|
||||
[40]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/snap-app-pacman.jpg?resize=800%2C489&ssl=1
|
||||
[41]: https://itsfoss.com/essential-linux-applications/
|
||||
[42]: https://wiki.manjaro.org/Pacman-mirrors#Purpose
|
||||
[43]: https://itsfoss.com/what-is-zfs/
|
||||
[44]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/htop_manjaro_cinnamon.jpg?ssl=1
|
||||
[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/htop_mint.png?ssl=1
|
||||
[46]: https://itsfoss.com/start-stop-restart-services-linux/
|
||||
[47]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/Manjaro-cropped.png?ssl=1
|
||||
[48]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Mint-cropped.png?ssl=1
|
||||
[49]: https://itsfoss.com/subscribe-to-newsletter/
|
262
sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md
Normal file
262
sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md
Normal file
@ -0,0 +1,262 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (LaTeX Typesetting – Part 1 (Lists))
|
||||
[#]: via: (https://fedoramagazine.org/latex-typesetting-part-1/)
|
||||
[#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/)
|
||||
|
||||
LaTeX Typesetting – Part 1 (Lists)
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
This series builds on the previous articles: [Typeset your docs with LaTex and TeXstudio on Fedora][2] and [LaTeX 101 for beginners][3]. This first part of the series is about LaTeX lists.
|
||||
|
||||
### Types of lists
|
||||
|
||||
LaTeX lists are enclosed environments, and each item in the list can take a line of text to a full paragraph. There are three types of lists available in LaTeX. They are:
|
||||
|
||||
* **Itemized**: unordered or bullet
|
||||
* **Enumerated**: ordered
|
||||
* **Description**: descriptive
|
||||
|
||||
|
||||
|
||||
### Creating lists
|
||||
|
||||
To create a list, prefix each list item with the \_item_ command. Precede and follow the list of items with the \_begin_{<type>} and \_end_{<type>} commands respectively where <type> is substituted with the type of the list as illustrated in the following examples.
|
||||
|
||||
#### Itemized list
|
||||
|
||||
```
|
||||
\begin{itemize}
|
||||
\item Fedora
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][4]
|
||||
|
||||
#### Enumerated list
|
||||
|
||||
```
|
||||
\begin{enumerate}
|
||||
\item Fedora CoreOS
|
||||
\item Fedora Silverblue
|
||||
\item Fedora Spin
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
![][5]
|
||||
|
||||
#### Descriptive list
|
||||
|
||||
```
|
||||
\begin{description}
|
||||
\item[Fedora 6] Code name Zod
|
||||
\item[Fedora 8] Code name Werewolf
|
||||
\end{description}
|
||||
```
|
||||
|
||||
![][6]
|
||||
|
||||
### Spacing list items
|
||||
|
||||
The default spacing can be customized by adding \_usepackage{enumitem}_ to the preamble. The _enumitem_ package enables the _noitemsep_ option and the \_itemsep_ command which you can use on your lists as illustrated below.
|
||||
|
||||
#### Using the noitemsep option
|
||||
|
||||
Enclose the _noitemsep_ option in square brackets and place it on the \_begin_ command as shown below. This option removes the default spacing.
|
||||
|
||||
```
|
||||
\begin{itemize}[noitemsep]
|
||||
\item Fedora
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][7]
|
||||
|
||||
#### Using the \itemsep command
|
||||
|
||||
The \_itemsep_ command must be suffixed with a number to indicate how much space there should be between the list items.
|
||||
|
||||
```
|
||||
\begin{itemize} \itemsep0.75pt
|
||||
\item Fedora Silverblue
|
||||
\item Fedora CoreOS
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][8]
|
||||
|
||||
### Nesting lists
|
||||
|
||||
LaTeX supports nested lists up to four levels deep as illustrated below.
|
||||
|
||||
#### Nested itemized lists
|
||||
|
||||
```
|
||||
\begin{itemize}[noitemsep]
|
||||
\item Fedora Versions
|
||||
\begin{itemize}
|
||||
\item Fedora 8
|
||||
\item Fedora 9
|
||||
\begin{itemize}
|
||||
\item Werewolf
|
||||
\item Sulphur
|
||||
\begin{itemize}
|
||||
\item 2007-05-31
|
||||
\item 2008-05-13
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][9]
|
||||
|
||||
#### Nested enumerated lists
|
||||
|
||||
```
|
||||
\begin{enumerate}[noitemsep]
|
||||
\item Fedora Versions
|
||||
\begin{enumerate}
|
||||
\item Fedora 8
|
||||
\item Fedora 9
|
||||
\begin{enumerate}
|
||||
\item Werewolf
|
||||
\item Sulphur
|
||||
\begin{enumerate}
|
||||
\item 2007-05-31
|
||||
\item 2008-05-13
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\end{enumerate}
|
||||
\item Fedora Spin
|
||||
\item Fedora Silverblue
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
![][10]
|
||||
|
||||
### List style names for each list type
|
||||
|
||||
**Enumerated** | **Itemized**
|
||||
---|---
|
||||
\alph* | $\bullet$
|
||||
\Alph* | $\cdot$
|
||||
\arabic* | $\diamond$
|
||||
\roman* | $\ast$
|
||||
\Roman* | $\circ$
|
||||
| $-$
|
||||
|
||||
### Default style by list depth
|
||||
|
||||
**Level** | **Enumerated** | **Itemized**
|
||||
---|---|---
|
||||
1 | Number | Bullet
|
||||
2 | Lowercase alphabet | Dash
|
||||
3 | Roman numerals | Asterisk
|
||||
4 | Uppercase alphabet | Period
|
||||
|
||||
### Setting list styles
|
||||
|
||||
The below example illustrates each of the different itemiszed list styles.
|
||||
|
||||
```
|
||||
% Itemize style
|
||||
\begin{itemize}
|
||||
\item[$\ast$] Asterisk
|
||||
\item[$\diamond$] Diamond
|
||||
\item[$\circ$] Circle
|
||||
\item[$\cdot$] Period
|
||||
\item[$\bullet$] Bullet (default)
|
||||
\item[--] Dash
|
||||
\item[$-$] Another dash
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
![][11]
|
||||
|
||||
There are three methods of setting list styles. They are illustrated below. These methods are listed by priority; highest priority first. A higher priority will override a lower priority if more than one is defined for a list item.
|
||||
|
||||
#### List styling method 1 – per item
|
||||
|
||||
Enclose the name of the desired style in square brackets and place it on the \_item_ command as demonstrated below.
|
||||
|
||||
```
|
||||
% First method
|
||||
\begin{itemize}
|
||||
\item[$\ast$] Asterisk
|
||||
\item[$\diamond$] Diamond
|
||||
\item[$\circ$] Circle
|
||||
\item[$\cdot$] period
|
||||
\item[$\bullet$] Bullet (default)
|
||||
\item[--] Dash
|
||||
\item[$-$] Another dash
|
||||
\end{itemize}
|
||||
```
|
||||
|
||||
#### List styling method 2 – on the list
|
||||
|
||||
Prefix the name of the desired style with _label=_. Place the parameter, including the _label=_ prefix, in square brackets on the \_begin_ command as demonstrated below.
|
||||
|
||||
```
|
||||
% Second method
|
||||
\begin{enumerate}[label=\Alph*.]
|
||||
\item Fedora 32
|
||||
\item Fedora 31
|
||||
\item Fedora 30
|
||||
\end{enumerate}
|
||||
```
|
||||
|
||||
#### List styling method 3 – on the document
|
||||
|
||||
This method changes the default style for the entire document. Use the \_renewcommand_ to set the values for the labelitems. There is a different labelitem for each of the four label depths as demonstrated below.
|
||||
|
||||
```
|
||||
% Third method
|
||||
\renewcommand{\labelitemi}{$\ast$}
|
||||
\renewcommand{\labelitemii}{$\diamond$}
|
||||
\renewcommand{\labelitemiii}{$\bullet$}
|
||||
\renewcommand{\labelitemiv}{$-$}
|
||||
```
|
||||
|
||||
### Summary
|
||||
|
||||
LaTeX supports three types of lists. The style and spacing of each of the list types can be customized. More LaTeX elements will be explained in future posts.
|
||||
|
||||
Additional reading about LaTeX lists can be found here: [LaTeX List Structures][12]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/latex-typesetting-part-1/
|
||||
|
||||
作者:[Earl Ramirez][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/earlramirez/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/latex-series-816x345.png
|
||||
[2]: https://fedoramagazine.org/typeset-latex-texstudio-fedora
|
||||
[3]: https://fedoramagazine.org/fedora-classroom-latex-101-beginners
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-1.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-2.png
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-3.png
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-4.png
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-5.png
|
||||
[9]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-7.png
|
||||
[10]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-8.png
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2020/06/image-9.png
|
||||
[12]: https://en.wikibooks.org/wiki/LaTeX/List_Structures
|
@ -0,0 +1,65 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (My Linux Story: remixing distributions at 17 years old)
|
||||
[#]: via: (https://opensource.com/article/20/6/linux-remix)
|
||||
[#]: author: (Kai Lyons https://opensource.com/users/kailikeslinux)
|
||||
|
||||
My Linux Story: remixing distributions at 17 years old
|
||||
======
|
||||
Open source and Linux create an environment ripe for hands-on learning
|
||||
and experimentation, and it's never too early to start.
|
||||
![Person programming on a laptop on a building][1]
|
||||
|
||||
The [Lumina desktop][2] was originally developed by iXSystems for TrueOS, which later became Project Trident. It's well-known as the BSD desktop environment but has been ported to Linux. It introduces desktop elements like a panel, system tray, and so on, to the Fluxbox window manager, and is highly portable. It's a good desktop, and while it's generally easy to install, there aren't many distributions offering it by default.
|
||||
|
||||
I'm the sole contributor and maintainer to the Ubuntu Lumina remix. My work on the Ubuntu Lumina project has been a lengthy process, and much of it has been learning along the way. As of this writing, I'm 17 years old, but I've been a technology enthusiast since age six when a friend of mine helped me write my first ever "Hello, world" script.
|
||||
|
||||
### My introduction to Linux
|
||||
|
||||
Although I am a distribution developer, I haven't been on Linux all that long. I didn't start using Linux until 2018 when I first got into Fedora 29. My original reason for installing Linux was to build an operating system, and Linux taught me an important lesson—in open source, you can build upon the successful work of others. You can learn the components of the existing scaffolding, which grants you a substantial headstart in reaching your ultimate goal.
|
||||
|
||||
My original plan was to write a custom kernel. Once I learned what a monumental task it was, I decided to redirect that enthusiasm to working with the Linux kernel for a while, since I ultimately wanted to make an operating system.
|
||||
|
||||
I got started on Fedora using the Gnome desktop. I still couldn't tell you for sure how I got it to fit on a 1GB flash drive, but that's why Fedora 29 was my pick—I fell in love with Gnome 3 immediately, and [Gnome Boxes][3] was the first virtual machine I ever used. I've found many other desktops to love, too—Pantheon, Cinnamon, LXQt, and others. After testing FreeBSD for the first time only a short three months after finding Linux, I found Lumina.
|
||||
|
||||
### My first operating system attempts
|
||||
|
||||
My initial attempts to design my own distribution with Lumina as the default environment were mostly exercises in experimenting with tools. The tool I used most at first was [Linux-Live][4]. I never thought of working on an operating system from anything but the live-system. It actually wouldn't be until Ubuntu Lumina that I would even try to do it with an installed system.
|
||||
|
||||
My first distribution had no name, and it was a [Linux From Scratch][5] (LFS) system. It taught me a lot, but in the end, it wasn't what I really wanted; it didn't even have a proper installer.
|
||||
|
||||
My second through seventh tries were random assortments of mashing software together, and only one of them ever got "shipped." I don't remember the name of it, or even whether it worked, but it was something that I had made myself, and it showed me what was possible. While the end results weren't what I ultimately wanted, I still loved the process of making them.
|
||||
|
||||
I spent time reading LFS, remixing Gentoo and Arch, made a couple of weird Debian tries, and finally decided to create an Ubuntu Cinnamon remix. I soon found out that Joshua Peisach had already made one. I didn't get far on my own remix; it never booted, so I abandoned the idea. With Joshua's encouragement, there were a few intermediate attempts at remixes (a failed attempt at Pantheon, and then i3) before I settled on concentrating on Lumina.
|
||||
|
||||
### Lumina desktop on Linux
|
||||
|
||||
My Lumina-based distribution is still in development, meaning it's usable but has several significant omissions. The goal of the project is to provide a comfortable and lightweight OS. The Lumina desktop environment doesn't have many tools compared to a full desktop environment, including those considered to be minimal, like LXQt. And while Lumina is a little clunky, it's about as lightweight as XFCE.
|
||||
|
||||
While it's true that I'm the only contributor to the project, I have gotten a lot of help along the way. Advice from Martin Wimpress, Joshua Peisach, Rik Mills, Thomas Castleman, and many other incredible distribution developers has guided me through many a twist and turn on what could have been a discouraging learning curve.
|
||||
|
||||
### Open source knowledge
|
||||
|
||||
This is what remixing, and indeed, open source itself, is all about—learning and helping one another while making better technology. My work builds upon the work of other distribution maintainers, packagers, a BSD desktop, an ISO-Builder developed for Budgie, and the entire Linux community. There's no question in my mind that I wouldn't have a bootable OS to call my own and to share with others without Linux and open source.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/6/linux-remix
|
||||
|
||||
作者:[Kai Lyons][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/kailikeslinux
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building)
|
||||
[2]: https://opensource.com/article/19/12/linux-lumina-desktop
|
||||
[3]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
|
||||
[4]: https://www.linuxliveusb.com/
|
||||
[5]: http://www.linuxfromscratch.org/
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user