mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-03 01:10:13 +08:00
commit
cfc3c37b97
@ -0,0 +1,196 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11631-1.html)
|
||||
[#]: subject: (How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server)
|
||||
[#]: via: (https://www.linuxtechi.com/install-lemp-stack-fedora-30-server/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
如何在 Fedora 30 Server 上安装 LEMP(Linux、Nginx、MariaDB、PHP)
|
||||
======
|
||||
|
||||
在这篇文章中,我们将看看如何在 Fedora 30 Server 上安装 **LEMP** 。LEMP 代表:
|
||||
|
||||
* L -> Linux
|
||||
* E -> Nginx
|
||||
* M -> Maria DB
|
||||
* P -> PHP
|
||||
|
||||
我假设 [Fedora 30][1] 已经安装在你的电脑系统上。
|
||||
|
||||

|
||||
|
||||
LEMP 是一组强大的软件设置集合,它安装在一个 Linux 服务器上以帮助使用流行的开发平台来构建网站,LEMP 是 LAMP 的一个变种,在其中不是 Apache ,而是使用 EngineX(Nginx),此外,使用 MariaDB 代替 MySQL。这篇入门指南是一个安装 Nginx、Maria DB 和 PHP 的独立指南的作品集合。
|
||||
|
||||
### 在 Fedora 30 Server 上安装 Nginx、PHP 7.3 和 PHP-FPM
|
||||
|
||||
让我们看看如何在 Fedora 30 Server 上安装 Nginx 和 PHP 以及 PHP FPM。
|
||||
|
||||
#### 步骤 1) 切换到 root 用户
|
||||
|
||||
在系统上安装 Nginx 的第一步是切换到 root 用户。使用下面的命令:
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ sudo -i
|
||||
[sudo] password for pkumar:
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
#### 步骤 2) 使用 dnf 命令安装 Nginx、PHP 7.3 和 PHP FPM
|
||||
|
||||
使用下面的 `dnf` 命令安装 Nginx:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install nginx php php-fpm php-common -y
|
||||
```
|
||||
|
||||
#### 步骤 3) 安装额外的 PHP 模块
|
||||
|
||||
PHP 的默认安装仅自带基本模块和最需要的模块,如果你需要额外的模块,像 PHP 支持的 GD、XML、命令行接口、Zend OPCache 功能等等,你总是能够选择你的软件包,并一次性安装所有的东西。查看下面的示例命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# sudo dnf install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-pecl-mongodb php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml -y
|
||||
```
|
||||
|
||||
#### 步骤 4) 开始 & 启用 Nginx 和 PHP-fpm 服务
|
||||
|
||||
使用下面的命令来开始并启用 Nginx 服务:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# systemctl start nginx && systemctl enable nginx
|
||||
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
使用下面的命令来开始并启用 PHP-FPM 服务:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# systemctl start php-fpm && systemctl enable php-fpm
|
||||
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
#### 步骤 5) 核实 Nginx (Web 服务) 和 PHP 安装
|
||||
|
||||
注意:假使操作系统防火墙是启用的,并运行在你的 Fedora 30 系统上,那么使用下面的命令来准许 80 和 443 端口:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# firewall-cmd --permanent --add-service=http
|
||||
success
|
||||
[root@linuxtechi ~]#
|
||||
[root@linuxtechi ~]# firewall-cmd --permanent --add-service=https
|
||||
success
|
||||
[root@linuxtechi ~]# firewall-cmd --reload
|
||||
success
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
打开网页浏览器,输入下面的 URL: http://<Your-Server-IP> 。
|
||||
|
||||
![Test-Page-HTTP-Server-Fedora-30][4]
|
||||
|
||||
上面的屏幕证实 Nginx 已经成功地安装。
|
||||
|
||||
现在,让我们核实 PHP 安装,使用下面的命令创建一个测试 php 页(`info.php`):
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/info.php
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
在网页浏览器中输入下面的 URL, http://<Your-Server-IP>/info.php
|
||||
|
||||
![Php-info-page-fedora30][6]
|
||||
|
||||
上面的页面验证 PHP 7.3.5 已经被成功地安装。现在,让我们安装 MariaDB 数据库服务器。
|
||||
|
||||
### 在 Fedora 30 上安装 MariaDB
|
||||
|
||||
MariaDB 是 MySQL 数据库的一个极好的替代品,因为它的工作方式与 MySQL 非常类似,并且兼容性也与 MySQL 一致。让我们看看在 Fedora 30 Server 上安装 MariaDB 的步骤。
|
||||
|
||||
#### 步骤 1) 切换到 root 用户
|
||||
|
||||
在系统上安装 MariaDB 的第一步是切换到 root 用户,或者你可以使用有 root 权限的本地用户。使用下面的命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# sudo -i
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
#### 步骤 2) 使用 dnf 命令安装 MariaDB(10.3)的最新版本
|
||||
|
||||
在 Fedora 30 Server 上使用下面的命令来安装 MariaDB:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install mariadb-server -y
|
||||
```
|
||||
|
||||
#### 步骤 3) 开启并启用 MariaDB 服务
|
||||
|
||||
在步骤 2 中成功地安装 MariaDB 后,接下来的步骤是开启 MariaDB 服务。使用下面的命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# systemctl start mariadb.service ; systemctl enable mariadb.service
|
||||
```
|
||||
|
||||
#### 步骤 4) 保护安装好的 MariaDB
|
||||
|
||||
当我们安装 MariaDB 服务器时,因为默认情况下没有 root 密码,在数据库中也会创建匿名用户。因此,要保护安装好的 MariaDB,运行下面的 `mysql_secure_installation` 命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# mysql_secure_installation
|
||||
```
|
||||
|
||||
接下来你将被提示一些问题,仅回答下面展示的问题:
|
||||
|
||||
![Secure-MariaDB-Installation-Part1][7]
|
||||
|
||||
![Secure-MariaDB-Installation-Part2][8]
|
||||
|
||||
#### 步骤 5) 测试 MariaDB 安装
|
||||
|
||||
在你安装后,你总是能够测试是否 MariaDB 被成功地安装在 Fedora 30 Server 上。使用下面的命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# mysql -u root -p
|
||||
Enter password:
|
||||
```
|
||||
|
||||
接下来,你将被提示一个密码。输入在保护安装好的 MariaDB 期间你设置的密码,接下来你可以看到 MariaDB 欢迎屏幕。
|
||||
|
||||
```
|
||||
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
||||
Your MariaDB connection id is 17
|
||||
Server version: 10.3.12-MariaDB MariaDB Server
|
||||
|
||||
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
|
||||
|
||||
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
||||
|
||||
MariaDB [(none)]>
|
||||
```
|
||||
|
||||
最后,我们已经在你的 Fedora 30 Server 上成功地完成安装 LEMP(Linux、Nginx、MariaDB 和 PHP)的所有工作。请在下面的反馈部分发布你的评论和建议,我们将尽快在后面回应。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/install-lemp-stack-fedora-30-server/
|
||||
|
||||
作者:[Pradeep Kumar][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://www.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linuxtechi.com/fedora-30-workstation-installation-guide/
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/LEMP-Stack-Fedora30.jpg
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Test-Page-HTTP-Server-Fedora-30-1024x732.jpg
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Test-Page-HTTP-Server-Fedora-30.jpg
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Php-info-page-fedora30-1024x732.jpg
|
||||
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Php-info-page-fedora30.jpg
|
||||
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Secure-MariaDB-Installation-Part1.jpg
|
||||
[8]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Secure-MariaDB-Installation-Part2.jpg
|
@ -0,0 +1,101 @@
|
||||
Linux 平台上的写作者必备工具
|
||||
======
|
||||
|
||||

|
||||
|
||||
我从事作家已有 20 多年了。我撰写了数千篇有关各种技术主题的文章和指南,并撰写了 40 多本小说。因此,书面文字不仅对我很重要,还很熟悉,成为了我的第二种自然交流的方式。在过去的二十年中(而且还在继续),我几乎都是在 Linux 平台上完成的所有工作。我必须承认,在早期,这并不总是那么容易。格式并不总是与编辑器所需要的相吻合,在某些情况下,开源平台根本没有完成工作所需的必要工具。
|
||||
|
||||
那时已经过去,现在已经不同了。
|
||||
|
||||
Linux 演进和基于 Web 的工具的相得益彰使得它可以让任何写作者都能在 Linux 上完成工作(并且做得很好)。但是你需要什么工具?你可能会惊讶地发现,在某些情况下,使用 100% 开源的工具无法有效完成这项工作。不过即使如此,工作总是可以完成的。让我们来看看我作为技术作家和小说作者一直使用的工具。我将通过小说和非小说类的写作过程来概述这一点(因为过程不同,需要特定的工具)。
|
||||
|
||||
对认真的 Linux 硬核用户预先做个预警。很久以前,我就放弃了使用 LaTeX 和 DocBook 之类的工具进行写作。为什么?因为对我而言,重点必须放在内容上,而不是过程上。当你面临最后期限时,必须以效率为先。
|
||||
|
||||
### 非小说类
|
||||
|
||||
我们将从非虚构写作入手,因为这是两者中较简单的过程。为了编写技术指南,我与不同的编辑人员合作,并且在某些情况下,必须将内容复制/粘贴到 CMS 中。但是就像我的小说一样,整个过程总是从 Google 云端硬盘开始。在这一点上,许多开源纯粹主义者会转身走开。不用担心,你始终可以选择将所有文件保存在本地,也可以使用更开放友好的云服务(例如 [Zoho][1] 或 [nextCloud][2])。
|
||||
|
||||
为什么要从云端开始?多年来,我发现我需要能够随时随地访问那些内容。最简单的解决方案是迁移到云上。我对丢失工作成果这件事也很偏执。为此,我使用了 [Insync][3] 之类的工具来使我的 Google 云端硬盘与桌面保持同步。有了桌面同步功能,我知道我的工作成果总是有备份,以防万一 Google 云端硬盘出了问题。
|
||||
|
||||
对于那些我必须与之一起将内容输入到内容管理系统(CMS)的客户,该过程到此结束。我可以直接从 Google 文档复制/粘贴到 CMS 中,并完成此操作。当然,对于技术内容,总是涉及到屏幕截图。为此,我使用 [Gimp][4],它使得截取屏幕截图变得简单:
|
||||
|
||||
![screenshot with Gimp][6]
|
||||
|
||||
*图 1:使用 Gimp 截屏。*
|
||||
|
||||
1. 打开 Gimp。
|
||||
2. 单击“文件>创建>屏幕快照”。
|
||||
3. 选择单个窗口、整个屏幕或要抓取的区域(图 1)。
|
||||
4. 单击“抓取”。
|
||||
|
||||
我的大多数客户倾向于使用 Google 文档,因为我可以共享文件夹,以便他们可以可靠地访问该内容。我有一些无法使用 Google 文档的客户,因此我必须将文件下载为可以使用的格式。为此,我要做的是下载 .odt 格式,以 [LibreOffice][8] 打开文档(图 2),根据需要设置格式,保存为客户所需的格式,然后发送文档。
|
||||
|
||||
![Google Doc][10]
|
||||
|
||||
*图 2:在 LibreOffice 中打开我下载的 Google 文档。*
|
||||
|
||||
非小说类作品这样就行了。
|
||||
|
||||
### 小说类
|
||||
|
||||
这里会稍微变得有点复杂。开始的步骤是相同的,因为我总是在 Google 文档中写小说的每个初稿。完成后,我将文件下载到 Linux 桌面,在 LibreOffice 中打开文件,根据需要设置格式,然后另存为编辑器支持的文件类型(不幸的是,这意味着是 .docx)。
|
||||
|
||||
该过程的下一步变得有些琐碎。我的编辑更喜欢使用注释来跟踪更改(因为这使我们俩阅读文档和做出更改一样容易)。因此,一个 60k 的 word 文档可以包含成百上千的注释,这会使 LibreOffice 慢的像爬一样。从前,你可以增加用于文档的内存,但是从 LibreOffice 6 开始,这不再可行。这意味着任何较大的、像小说一样长的、带有大量注释的文档都将无法使用。因此,我不得不采取一些极端的措施,使用 [WPS Office][11](图 3)。尽管这不是开源解决方案,但 WPS Office 在文档中包含大量注释的情况下做得很好,因此无需处理 LibreOffice 所带来的麻烦(当处理带有数百个注释的大型文件时)。
|
||||
|
||||
![comments][13]
|
||||
|
||||
*图 3:WPS 可以轻松处理大量注释。*
|
||||
|
||||
一旦我和我的编辑完成了对书的编辑(所有评论都已删除),我就可以在 LibreOffice 中打开文件进行最终格式化。格式化完成后,我将文件保存为 .html 格式,然后以 [Calibre][14] 打开文件以将文件导出为 .mobi 和 .epub 格式。
|
||||
|
||||
对于希望在 Amazon、Barnes&Noble、Smashwords 或其他平台上出版的任何人,Calibre 都是必备工具。Caliber 比其他类似解决方案更好地方是,它使你可以直接编辑 .epub 文件(图 4)。对于 Smashword 来说,这是绝对必要的(因为导出过程将添加 Smashwords 转换工具上不接受的元素)。
|
||||
|
||||
![Calibre][16]
|
||||
|
||||
*图 4:直接在 Calibre 中编辑 epub 文件。*
|
||||
|
||||
写作过程结束后(或有时在等待编辑完成一校时),我将开始为书制作封面。该任务完全在 Gimp 中处理(图 5)。
|
||||
|
||||
![Using Gimp][19]
|
||||
|
||||
*图 5:在 Gimp 中创建 POTUS 的封面。*
|
||||
|
||||
这样就完成了在 Linux 平台上创建小说的过程。由于文档的篇幅以及某些编辑人员的工作方式,与创建非小说类的过程相比,它可能会变得有些复杂,但这远没有挑战性。实际上,在 Linux 上创建小说与其他平台一样简单(并且更可靠)。
|
||||
|
||||
### 希望这可以帮助你
|
||||
|
||||
我希望这可以帮助有抱负的作家有信心在 Linux 平台上进行写作。还有许多其他工具可供使用,但是多年来我在这里列出的工具很好地服务了我。而且,尽管我确实使用了几个专有的工具,但只要它们在 Linux 上都能正常运行,我觉得是可以的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/2018/11/must-have-tools-writers-linux-platform
|
||||
|
||||
作者:[Jack Wallen][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://www.linux.com/users/jlwallen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.zoho.com/
|
||||
[2]: https://nextcloud.com/
|
||||
[3]: https://www.insynchq.com
|
||||
[4]: https://www.gimp.org/
|
||||
[5]: /files/images/writingtools1jpg
|
||||
[6]: https://lcom.static.linuxfound.org/sites/lcom/files/writingtools_1.jpg (screenshot with Gimp)
|
||||
[7]: /licenses/category/used-permission
|
||||
[8]: https://www.libreoffice.org/
|
||||
[9]: /files/images/writingtools2jpg
|
||||
[10]: https://lcom.static.linuxfound.org/sites/lcom/files/writingtools_2.jpg (Google Doc)
|
||||
[11]: https://www.wps.com/en-US/
|
||||
[12]: /files/images/writingtools3jpg
|
||||
[13]: https://lcom.static.linuxfound.org/sites/lcom/files/writingtools_3.jpg (comments)
|
||||
[14]: https://calibre-ebook.com/
|
||||
[15]: /files/images/writingtools4jpg
|
||||
[16]: https://lcom.static.linuxfound.org/sites/lcom/files/writingtools_4.jpg (Calibre)
|
||||
[17]: /licenses/category/creative-commons-zero
|
||||
[18]: /files/images/writingtools5jpg
|
||||
[19]: https://lcom.static.linuxfound.org/sites/lcom/files/writingtools_5.jpg (Using Gimp)
|
||||
[20]: https://training.linuxfoundation.org/training/introduction-to-open-source-development-git-and-linux/?utm_source=linux.com&utm_medium=article&utm_campaign=lfd201
|
@ -0,0 +1,77 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11607-1.html)
|
||||
[#]: subject: (Can Better Task Stealing Make Linux Faster?)
|
||||
[#]: via: (https://www.linux.com/blog/can-better-task-stealing-make-linux-faster)
|
||||
[#]: author: (Oracle )
|
||||
|
||||
更好的任务窃取可以使 Linux 更快吗?
|
||||
======
|
||||
|
||||

|
||||
|
||||
> Oracle Linux 内核开发人员 Steve Sistare 参与了这场有关内核调度程序改进的讨论。
|
||||
|
||||
### 通过可扩展的任务窃取进行负载平衡
|
||||
|
||||
Linux 任务调度程序通过将唤醒的任务推送到空闲的 CPU,以及在 CPU 空闲时从繁忙的 CPU 中拉取任务来平衡整个系统的负载。在大型系统上的推送侧和拉取侧,有效的伸缩都是挑战。对于拉取,调度程序搜索连续的更大范围中的所有 CPU,直到找到过载的 CPU,然后从最繁忙的组中拉取任务。这代价非常昂贵,在大型系统上要花费 10 到 100 微秒,因此搜索时间受到平均空闲时间的限制,并且某些范围不会被搜索。并非总能达到平衡,而且闲置的 CPU 依旧闲置。
|
||||
|
||||
我实现了一种备用机制,该机制在 `idle_balance()` 中的现有搜索中自身受限并且没有找到之后被调用。我维护了一个过载的 CPU 的位图,当可运行的 CFS 任务计数超过 1 时,CPU 会设置该位。这个位图是稀疏的,每个高速缓存线的有效位数量有限。当许多线程同时设置、清除和访问元素时,这可以减少缓存争用。每个末级缓存都有一个位图。当 CPU 空闲时,它将搜索该位图以查找第一个具有可迁移任务的过载 CPU,然后将其窃取。这种简单的窃取会比单独的 `idle_balance()` 产生更高的 CPU 利用率,因为该搜索的成本很便宜,花费 1 到 2 微秒,因此每次 CPU 即将空闲时都可以调用它。窃取不会减轻全局最繁忙的队列的负担,但是它比根本不执行任何操作要好得多。
|
||||
|
||||
### 结果
|
||||
|
||||
偷窃仅在调度程序代码中占用少量 CPU 开销即可提高利用率。在以下实验中,以不同数量的组(每个组 40 个任务)运行 hackbench,并对每次运行结果显示 `/proc/schedstat` 中的增量(按 CPU 平均),并增加了这些非标准的统计信息:
|
||||
|
||||
* `%find`:在旧函数和新函数中花费的时间百分比,这些函数用于搜索空闲的 CPU 和任务以窃取并设置过载的 CPU 位图。
|
||||
* `steal`:任务从另一个 CPU 窃取的次数。经过的时间增加了 8% 到 36%,最多增加了 0.4% 的发现时间。
|
||||
|
||||
![load balancing][1]
|
||||
|
||||
如下图的绿色曲线所示,新内核的 CPU 繁忙利用率接近 100%,作为比较的基线内核是橙色曲线:
|
||||
|
||||
![][3]
|
||||
|
||||
根据负载的不同,窃取可将 Oracle 数据库 OLTP 性能提高多达 9%,并且我们已经看到 MySQL、Pgsql、gcc、Java 和网络方面有了一些不错的改进。通常,窃取对上下文切换率高的工作负载最有帮助。
|
||||
|
||||
### 代码
|
||||
|
||||
截至撰写本文时,这项工作尚未完成,但最新的修补程序系列位于 [https://lkml.org/lkml/2018/12/6/1253][4]。如果你的内核是使用 `CONFIG_SCHED_DEBUG=y` 构建的,则可以使用以下命令验证其是否包含窃取优化:
|
||||
|
||||
```
|
||||
# grep -q STEAL /sys/kernel/debug/sched_features && echo Yes
|
||||
Yes
|
||||
```
|
||||
|
||||
如果要尝试使用,请注意,对于具有 2 个以上 NUMA 节点的系统,禁用了窃取功能,因为 hackbench 在此类系统上发生了回归,正如我在 [https://lkml.org/lkml/2018/12/6/1250][5] 中解释的那样。但是,我怀疑这种影响是特定于 hackbench 的,并且窃取将有助于多节点系统上的其他工作负载。要尝试使用它,请用内核参数 `sched_steal_node_limit=8`(或更大)重新启动。
|
||||
|
||||
### 进一步工作
|
||||
|
||||
在将基本盗用算法推向上游之后,我正在考虑以下增强功能:
|
||||
|
||||
* 如果在末级缓存中进行窃取找不到候选者,在 LLC 和 NUMA 节点之间进行窃取。
|
||||
* 维护稀疏位图以标识 RT 调度类中的偷窃候选者。当前 `pull_rt_task()` 搜索所有运行队列。
|
||||
* 从 `idle_balance()` 中删除核心和套接字级别,因为窃取会处理这些级别。当支持跨 LLC 窃取时,完全删除 `idle_balance()`。
|
||||
* 维护位图以标识空闲核心和空闲 CPU,以实现推平衡。
|
||||
|
||||
这篇文章最初发布于 [Oracle Developers Blog][6]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/can-better-task-stealing-make-linux-faster
|
||||
|
||||
作者:[Oracle][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://www.linux.com/author/oracle/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://lcom.static.linuxfound.org/sites/lcom/files/linux-load-balancing.png (load balancing)
|
||||
[3]: https://cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/b7a700fe-edc3-4ea0-876a-c91e1850b59b/Image/00c074f4282bcbaf0c10dd153c5dfa76/steal_graph.png
|
||||
[4]: https://lkml.org/lkml/2018/12/6/1253
|
||||
[5]: https://lkml.org/lkml/2018/12/6/1250
|
||||
[6]: https://blogs.oracle.com/linux/can-better-task-stealing-make-linux-faster
|
@ -0,0 +1,122 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11608-1.html)
|
||||
[#]: subject: (What you need to know to be a sysadmin)
|
||||
[#]: via: (https://opensource.com/article/19/7/be-a-sysadmin)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
你需要知道什么才能成为系统管理员?
|
||||
======
|
||||
|
||||
> 通过获得这些起码的能力,开始你的系统管理员职业。
|
||||
|
||||

|
||||
|
||||
昔日的系统管理员整天都在调教用户和摆弄服务器,一天的时间都奔波在几百米长的电缆之间。随着云计算、容器和虚拟机的复杂性的增加,而今依然如此。
|
||||
|
||||
以外行人来看,很难准确确定系统管理员的确切职能,因为他们在许多地方都扮演着一个不起眼的角色。没人能在培训中知道自己工作中所需要的一切知识,但是每个人其实都需要一个坚实的基础。如果你想走上系统管理的道路,那么这是你个人自学或在正式培训中应重点关注的内容。
|
||||
|
||||
### Bash
|
||||
|
||||
当你学习 Bash Shell 时,你学习的不仅是 Bash Shell,你学习的也是 Linux、BSD、MacOS 甚至Windows(在适当条件下)的通用界面。你将了解语法的重要性,因此可以快速适应思科路由器的命令行或微软 PowerShell 等系统,最终你甚至可以学习更强大的语言,如 Python 或 Go。而且,你还会开始进行程序性思考,以便可以分析复杂的问题并将其分解为单个组件,这很关键,因为这就是系统(例如互联网、组织的内部网、Web 服务器、备份解决方案)是如何设计的。
|
||||
|
||||
不止于此,还有更多。
|
||||
|
||||
由于最近 DevOps 和[容器][2]的发展趋势,了解 Bash shell 变得尤为重要。你的系统管理员职业可能会将你带入一个视基础设施为代码的世界,这通常意味着你必须了解脚本编写的基础知识、[基于 YAML][3]配置的结构,以及如何与[容器][5](运行在[沙盒文件][6]内部的微型 Linux 系统)[交互][4]。你会知道 Bash 是高效管理激动人心的开源技术的门户,因此请进入 [Bash][7] 世界吧。
|
||||
|
||||
#### 资源
|
||||
|
||||
有很多方法可以在 Bash shell 中进行练习。
|
||||
|
||||
尝试一下[便携式 Linux 发行版][8]。你无需安装 Linux 即可使用 Linux,因此,请拿一块闲置的 U 盘,花个晚上或周末的空闲时光,来适应基于文本的界面。
|
||||
|
||||
这里有[几篇很棒的][10] [Bash 文章][9]。
|
||||
|
||||
要注意的是 Bash 练习的关键在于要练习,你必须有要做的练习才行。而且,在你知道如何使用 Bash 之前,你可能不知道该练习什么。如果是这样,请去 Over The Wire 玩一下 [Bandit][11] 游戏。这是一款针对绝对初学者的游戏,具有 34 个级别的交互式基本技巧,可让你熟悉 Linux shell。
|
||||
|
||||
### Web 服务器设置
|
||||
|
||||
一旦你习惯了 Bash,你应该尝试设置一个 Web 服务器。并不是所有的系统管理员都会四处设置 Web 服务器甚至维护 Web 服务器,但是你在安装和启动 HTTP 守护程序、配置 Apache 或 Nginx,设置[正确权限][12]和[配置防火墙][13]时所掌握的技能是你每天都需要使用的技能。经过一些努力,你可能会开始注意到自己的某些工作模式。在尝试管理可用于生产环境的软件和硬件之前,你可能认为某些概念是理所当然的,而你在成为新手的管理员角色时,将不再受到它们的影响。起初这可能会令人沮丧,因为每个人都喜欢在自己做好所做的事情,但这实际上是一件好事。让自己接触新技能,那就是你学习的方式。
|
||||
|
||||
此外,你在第一步中付出的努力越多,最终当你在默认的 index.html 上看到胜利的“it works!”就越甜蜜!
|
||||
|
||||
#### 资源
|
||||
|
||||
David Both 撰写了有关 [Apache Web 服务器][14]配置的出色文章。值得一提的是,请逐步阅读他的后续文章,其中介绍了如何在一台计算机上[托管多个站点][15]。
|
||||
|
||||
### DHCP
|
||||
|
||||
动态主机配置协议(DHCP)是为网络上的设备分配 IP 地址的系统。在家里,ISP(互联网服务提供商)支持的调制解调器或路由器可能内置了 DHCP 服务器,因此可能不在你的权限范围内。如果你曾经登录家用路由器来调整 IP 地址范围或为某些网络设备设置了静态地址,那么你至少对该概念有所了解。你可能会将其理解为对网络上的设备分配了一种 IP 地址形式的电话号码,并且你可能会意识到计算机之间通过广播发送到特定 IP 地址的消息彼此进行通信。消息标头由路径上的路由器读取,每个消息标头都将消息定向到路径上的第二个逻辑路由器,以达到其最终目标。
|
||||
|
||||
即使你了解了这些概念,要从对 DHCP 的基本了解再进一步是架设 DHCP 服务器。安装和配置自己的 DHCP 服务器可能会导致家庭网络中的 DHCP 冲突(如果可以的话,请尽量避免这样做,因为它肯定会干掉你的网络,直到解决为止),要控制地址的分配、创建子网,并监控连接和租赁时间。
|
||||
|
||||
更重要的是,设置 DHCP 并尝试不同的配置有助于你了解网络之间的关系。你会了解网络如何在数据传输中表示“分区”,以及必须采取哪些步骤才能将信息从一个网络传递到另一个。这对于系统管理员来说至关重要,因为网络肯定是工作中最重要的方面之一。
|
||||
|
||||
#### 资源
|
||||
|
||||
在运行自己的 DHCP 服务器之前,请确保家庭路由器(如果有)中的 DHCP 服务器处于非活动状态。一旦启动并运行了 DHCP 服务器,请阅读 Archit Modi 的[网络命令指南][16],以获取有关如何探索网络的提示。
|
||||
|
||||
### 网络电缆
|
||||
|
||||
这听起来很普通,但是熟悉网络电缆的工作方式不仅使你的周末变得非常有趣,而且还使你对数据是如何通过缆线的得到了全新的了解。最好的学习方法是去当地的业余爱好商店并购买五类线剥线钳和压线钳以及一些五类线水晶头。然后回家,拿一根备用的以太网电缆,切断水晶头,花一些时间重新制作网线接头,将电缆重新投入使用。
|
||||
|
||||
解决了这个难题后,请再做一次,这次创建一条有效的[交叉电缆][17]。
|
||||
|
||||
你现在应该还在沉迷于有关电缆管理。如果你有些强迫症,喜欢沿着地板线或桌子的边缘整齐地排列电缆,或者将电缆绑在一起以保持它们的整齐有序,那么就可以使自己免受永久混乱的电缆困扰。你一开始可能不会理解这样做的必要性,但是当你第一次走进服务器机房时,你会马上知道原因。
|
||||
|
||||
### Ansible
|
||||
|
||||
[Ansible][18] 是配置管理软件,它在系统管理员和 DevOps 之间架起了一座桥梁。系统管理员使用 Ansible 来配置全新安装的操作系统并在计算机上维护特定的状态。DevOps 使用 Ansible 减少了在工具上花费的时间和精力,从而在开发上可以花费更多的时间和精力。作为系统管理员培训的一部分,你应该学习 Ansible,并着眼于 DevOps 实践,因为 DevOps 现在开创的大多数功能将最终成为将来系统管理中工作流的一部分。
|
||||
|
||||
Ansible 的好处是你可以立即开始使用它。它是跨平台的,并且可以向上和向下缩放。对于单用户计算机, Ansible 可能是小题大做,但是话又说回来,Ansible 可能会改变你启动虚拟机的方式,或者可以帮助你同步家庭或[家庭实验室][19]中所有计算机的状态。
|
||||
|
||||
|
||||
#### 资源
|
||||
|
||||
阅读 Jay LaCroix 的[如何使用 Ansible 管理工作站配置][20]中的典型介绍,以轻松地在日常之中开始使用 Ansible。
|
||||
|
||||
### 破坏
|
||||
|
||||
由于用户的错误、软件的错误、管理员(就是你!)的错误以及许多其他因素,计算机上会出现问题。无法预测将要失败的原因,因此你的个人系统管理员培训制度的一部分应该是破坏你设置的系统,直到它们失败为止。你自己的实验室基础设施越是脆弱,发现弱点的可能性就越大。而且,你越是经常修复这些弱点,你对解决问题的能力就越有信心。
|
||||
|
||||
除了严格设置所有常见的软件和硬件之外,作为系统管理员的主要工作是查找解决方案。有时候,你可能会遇到职位描述之外的问题,甚至可能无法解决,但这完全取决于你的解决方法。
|
||||
|
||||
现在,你越多地折腾并努力加以解决,则以系统管理员的身份进行的准备就越充分。
|
||||
|
||||
你是系统管理员吗?你是否希望自己为更好的任务做好准备?在下面的评论中写下它们!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/be-a-sysadmin
|
||||
|
||||
作者:[Seth Kenlon][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/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices)
|
||||
[2]: https://opensource.com/article/19/6/kubernetes-dump-truck
|
||||
[3]: https://www.redhat.com/sysadmin/yaml-tips
|
||||
[4]: https://opensource.com/article/19/6/how-ssh-running-container
|
||||
[5]: https://opensource.com/resources/what-are-linux-containers
|
||||
[6]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[7]: https://opensource.com/article/18/7/admin-guide-bash
|
||||
[8]: https://opensource.com/article/19/6/linux-distros-to-try
|
||||
[9]: https://opensource.com/tags/bash
|
||||
[10]: https://www.redhat.com/sysadmin/managing-files-linux-terminal
|
||||
[11]: http://overthewire.org/wargames/bandit
|
||||
[12]: https://opensource.com/article/19/6/understanding-linux-permissions
|
||||
[13]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd
|
||||
[14]: https://opensource.com/article/18/2/how-configure-apache-web-server
|
||||
[15]: https://opensource.com/article/18/3/configuring-multiple-web-sites-apache
|
||||
[16]: https://opensource.com/article/18/7/sysadmin-guide-networking-commands
|
||||
[17]: https://en.wikipedia.org/wiki/Ethernet_crossover_cable
|
||||
[18]: https://opensource.com/sitewide-search?search_api_views_fulltext=ansible
|
||||
[19]: https://opensource.com/article/19/6/create-centos-homelab-hour
|
||||
[20]: https://opensource.com/article/18/3/manage-workstation-ansible
|
215
published/201911/20191007 7 Java tips for new developers.md
Normal file
215
published/201911/20191007 7 Java tips for new developers.md
Normal file
@ -0,0 +1,215 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11620-1.html)
|
||||
[#]: subject: (7 Java tips for new developers)
|
||||
[#]: via: (https://opensource.com/article/19/10/java-basics)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
给新手 Java 开发者的 7 点提示
|
||||
======
|
||||
|
||||
> 如果你才刚开始学习 Java 编程,这里有七个你需要知道的基础知识。
|
||||
|
||||

|
||||
|
||||
Java 是一个多功能的编程语言,在某种程度上,它用在几乎所有可能涉及计算机的行业了里。Java 的最大优势是,它运行在一个 Java 虚拟机(JVM)中,这是一个翻译 Java 代码为与操作系统兼容的字节码的层。只要有 JVM 存在于你的操作系统上 —— 不管这个操作系统是在一个服务器(或“[无服务器][2]”,也是同样的)、桌面电脑、笔记本电脑、移动设备,或嵌入式设备 —— 那么,Java 应用程序就可以运行在它上面。
|
||||
|
||||
这使得 Java 成为程序员和用户的一种流行语言。程序员知道,他们只需要写一个软件版本就能最终得到一个可以运行在任何平台上的应用程序;用户知道,应用程序可以运行在他们的计算机上,而不用管他们使用的是什么样的操作系统。
|
||||
|
||||
很多语言和框架是跨平台的,但是没有实现同样的抽象层。使用 Java,你针对的是 JVM,而不是操作系统。对于程序员,当面对一些编程难题时,这是阻力最小的线路,但是它仅在当你知道如何编程 Java 时有用。如果你刚开始学习 Java 编程,这里有你需要知道的七个基础的提示。
|
||||
|
||||
但是,首先,如果你不确定是否你安装了 Java ,你可以在一个终端(例如 [Bash][3] 或 [PowerShell][4])中找出来,通过运行:
|
||||
|
||||
```
|
||||
$ java --version
|
||||
openjdk 12.0.2 2019-07-16
|
||||
OpenJDK Runtime Environment 19.3 (build 12.0.2+9)
|
||||
OpenJDK 64-Bit Server VM 19.3 (build 12.0.2+9, mixed mode, sharing)
|
||||
```
|
||||
|
||||
如果你得到一个错误,或未返回任何东西,那么你应该安装 [Java 开发套件][5](JDK)来开始 Java 开发。或者,安装一个 Java 运行时环境(JRE),如果你只是需要来运行 Java 应用程序。
|
||||
|
||||
### 1、Java 软件包
|
||||
|
||||
在 Java 语言中,相关的类被分组到一个*软件包*中。当你下载 JDK 时所获得的 Java 基础库将被分组到以 `java` 或 `javax` 开头的软件包中。软件包提供一种类似于计算机上的文件夹的功能:它们为相关的元素提供结构和定义(以编程术语说,*命名空间*)。额外的软件包可以从独立开发者、开源项目和商业供应商获得,就像可以为任何编程语言获得库一样。
|
||||
|
||||
当你写一个 Java 程序时,你应该在你的代码是顶部声明一个软件包名称。如果你只是编写一个简单的应用程序来入门 Java,你的软件包名称可以简单地用你的项目名称。如果你正在使用一个 Java 集成开发环境,如 [Eclipse][6],当你启动一个新的项目时,它为你生成一个合乎情理的软件包名称。
|
||||
|
||||
```
|
||||
package helloworld;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* An application written in Java.
|
||||
*/
|
||||
```
|
||||
|
||||
除此之外,你可以通过查找它相对于你的项目整体的路径来确定你的软件包名称。例如,如果你正在写一组类来帮助游戏开发,并且该集合被称为 `jgamer`,那么你可能在其中有一些唯一的类。
|
||||
|
||||
```
|
||||
package jgamer.avatar;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* An imaginary game library.
|
||||
*/
|
||||
```
|
||||
|
||||
你的软件包的顶层是 `jgamer`,并且在其内部中每个软件包都是一个独立的派生物,例如 `jgamer.avatar` 和 `jgamer.score` 等等。在你的文件系统里,其目录结构反映了这一点,`jgamer` 是包含文件 `avatar.java` 和 `score.java` 的顶级目录。
|
||||
|
||||
### 2、Java 导入
|
||||
|
||||
作为一名通晓多种语言的程序员,最大的乐趣是找出是否用 `include`、`import`、`use`、`require`,或一些其它术语来引入你不管使用何种编程语言编写的库。在 Java 中,顺便说一句,当导入你的代码的需要的库时,使用 `import` 关键字。
|
||||
|
||||
```
|
||||
package helloworld;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* A GUI hello world.
|
||||
*/
|
||||
```
|
||||
|
||||
导入是基于该环境的 Java 路径。如果 Java 不知道 Java 库存储在系统上的何处,那么,就不能成功导入。只要一个库被存储在系统的 Java 路径中,那么导入能够成功,并且库能够被用于构建和运行一个 Java 应用程序。
|
||||
|
||||
如果一个库并不在 Java 路径中(因为,例如,你正在写你自己的库),那么该库可以与你的应用程序绑定在一起(协议许可),以便导入可以按预期地工作。
|
||||
|
||||
### 3、Java 类
|
||||
|
||||
Java 类使用关键字 `public class` 声明,以及一个唯一的对应于它的文件名的类名。例如,在项目 `helloworld` 中的一个文件 `Hello.java` 中:
|
||||
|
||||
```
|
||||
package helloworld;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* A GUI hello world.
|
||||
*/
|
||||
|
||||
public class Hello {
|
||||
// this is an empty class
|
||||
}
|
||||
```
|
||||
|
||||
你可以在一个类内部声明变量和函数。在 Java 中,在一个类中的变量被称为*字段*。
|
||||
|
||||
### 4、Java 方法
|
||||
|
||||
Java 的方法本质上是对象中的函数。基于预期返回的数据类型(例如 `void`、`int`、`float` 等等),它们被定义为 `public`(意味着它们可以被任何其它类访问)或 `private`(限制它们的使用)。
|
||||
|
||||
|
||||
```
|
||||
public void helloPrompt(ActionEvent event) {
|
||||
String salutation = "Hello %s";
|
||||
|
||||
string helloMessage = "World";
|
||||
message = String.format(salutation, helloMessage);
|
||||
JOptionPane.showMessageDialog(this, message);
|
||||
}
|
||||
|
||||
private int someNumber (x) {
|
||||
return x*2;
|
||||
}
|
||||
```
|
||||
|
||||
当直接调用一个方法时,以其类和方法名称来引用。例如,`Hello.someNumber` 指向在 `Hello` 类中的 `someNumber` 方法。
|
||||
|
||||
### 5、static
|
||||
|
||||
Java 中的 `static` 关键字使代码中的成员可以独立于包含其的对象而被访问。
|
||||
|
||||
在面向对象编程中,你编写的代码用作“对象”的模板,这些对象在应用程序运行时产生。例如,你不需要编写一个具体的窗口,而是编写基于 Java 中的窗口类的窗口实例(并由你的代码修改)。由于在应用程序生成它的实例之前,你编写的所有代码都不会“存在”,因此在创建它们所依赖的对象之前,大多数方法和变量(甚至是嵌套类)都无法使用。
|
||||
|
||||
然而,有时,在对象被通过应用程序创建前,你需要访问或使用其中的数据。(例如,除非事先知道球是红色时,应用程序无法生成一个红色的球)。对于这些情况,请使用 `static` 关键字。
|
||||
|
||||
### 6、try 和 catch
|
||||
|
||||
Java 擅长捕捉错误,但是,只有你告诉它遇到错误时该做什么,它才能优雅地恢复。在 Java 中,尝试执行一个动作的级联层次结构以 `try` 开头,出现错误时回落到 `catch`,并以 `finally` 结束。如果 `try` 子句失败,则将调用 `catch`,最后,不管结果如何,总是由 `finally` 来执行一些合理的动作。这里是一个示例:
|
||||
|
||||
```
|
||||
try {
|
||||
cmd = parser.parse(opt, args);
|
||||
|
||||
if(cmd.hasOption("help")) {
|
||||
HelpFormatter helper = new HelpFormatter();
|
||||
helper.printHelp("Hello <options>", opt);
|
||||
System.exit(0);
|
||||
}
|
||||
else {
|
||||
if(cmd.hasOption("shell") || cmd.hasOption("s")) {
|
||||
String target = cmd.getOptionValue("tgt");
|
||||
} // else
|
||||
} // fi
|
||||
} catch (ParseException err) {
|
||||
System.out.println(err);
|
||||
System.exit(1);
|
||||
} //catch
|
||||
finally {
|
||||
new Hello().helloWorld(opt);
|
||||
} //finally
|
||||
} //try
|
||||
```
|
||||
|
||||
这是一个健壮的系统,它试图避免无法挽回的错误,或者,至少,为你提供让用户提交有用的反馈的选项。经常使用它,你的用户将会感谢你!
|
||||
|
||||
### 7、运行 Java 应用程序
|
||||
|
||||
Java 文件,通常以 `.java` 结尾,理论上说,可以使用 `java` 命令运行。然而,如果一个应用程序很复杂,运行一个单个文件是否会产生有意义的结果是另外一个问题。
|
||||
|
||||
来直接运行一个 `.java` 文件:
|
||||
|
||||
```
|
||||
$ java ./Hello.java
|
||||
```
|
||||
|
||||
通常,Java 应用程序以 Java 存档(JAR)文件的形式分发,以 `.jar` 结尾。一个 JAR 文件包含一个清单文件(可以指定主类、项目结构的一些元数据),以及运行应用程序所需的所有代码部分。
|
||||
|
||||
要运行一个 JAR 文件,你可以双击它的图标(取决于你的操作系统设置),你也可以从终端中启动它:
|
||||
|
||||
```
|
||||
$ java -jar ./Hello.jar
|
||||
```
|
||||
|
||||
### 适合所有人的 Java
|
||||
|
||||
Java 是一种强大的语言,由于有了 [OpenJDK][12] 项目及其它的努力,它是一种开放式规范,允许像 [IcedTea][13]、[Dalvik][14] 和 [Kotlin][15] 项目的茁壮成长。学习 Java 是一种准备在各种行业中工作的好方法,而且,[使用 Java 的理由很多][16]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/java-basics
|
||||
|
||||
作者:[Seth Kenlon][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://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
|
||||
[2]: https://www.redhat.com/en/resources/building-microservices-eap-7-reference-architecture
|
||||
[3]: https://www.gnu.org/software/bash/
|
||||
[4]: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6
|
||||
[5]: http://openjdk.java.net/
|
||||
[6]: http://www.eclipse.org/
|
||||
[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionevent
|
||||
[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+joptionpane
|
||||
[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+parseexception
|
||||
[12]: https://openjdk.java.net/
|
||||
[13]: https://icedtea.classpath.org/wiki/Main_Page
|
||||
[14]: https://source.android.com/devices/tech/dalvik/
|
||||
[15]: https://kotlinlang.org/
|
||||
[16]: https://opensource.com/article/19/9/why-i-use-java
|
@ -0,0 +1,234 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wenwensnow)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11611-1.html)
|
||||
[#]: subject: (Fields, records, and variables in awk)
|
||||
[#]: via: (https://opensource.com/article/19/11/fields-records-variables-awk)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
awk 中的字段、记录和变量
|
||||
======
|
||||
|
||||
> 这个系列的第二篇,我们会学习字段,记录和一些非常有用的 Awk 变量。
|
||||
|
||||

|
||||
|
||||
Awk 有好几个变种:最早的 `awk`,是 1977 年 AT&T 贝尔实验室所创。它还有一些重构版本,例如 `mawk`、`nawk`。在大多数 Linux 发行版中能见到的,是 GNU awk,也叫 `gawk`。在大多数 Linux 发行版中,`awk` 和 `gawk` 都是指向 GNU awk 的软链接。输入 `awk`,调用的是同一个命令。[GNU awk 用户手册][2]中,能看到 `awk` 和 `gawk` 的全部历史。
|
||||
|
||||
这一系列的[第一篇文章][3] 介绍了 `awk` 命令的基本格式:
|
||||
|
||||
```
|
||||
$ awk [选项] '模式 {动作}' 输入文件
|
||||
```
|
||||
|
||||
`awk` 是一个命令,后面要接选项 (比如用 `-F` 来定义字段分隔符)。想让 `awk` 执行的部分需要写在两个单引号之间,至少在终端中需要这么做。在 `awk` 命令中,为了进一步强调你想要执行的部分,可以用 `-e` 选项来突出显示(但这不是必须的):
|
||||
|
||||
```
|
||||
$ awk -F, -e '{print $2;}' colours.txt
|
||||
yellow
|
||||
blue
|
||||
green
|
||||
[...]
|
||||
```
|
||||
|
||||
### 记录和字段
|
||||
|
||||
`awk` 将输入数据视为一系列*记录*,通常是按行分割的。换句话说,`awk` 将文本中的每一行视作一个记录。每一记录包含多个*字段*。一个字段由*字段分隔符*分隔开来,字段是记录的一部分。
|
||||
|
||||
默认情况下,`awk` 将各种空白符,如空格、制表符、换行符等视为分隔符。值得注意的是,在 `awk` 中,多个*空格*将被视为一个分隔符。所以下面这行文本有两个字段:
|
||||
|
||||
```
|
||||
raspberry red
|
||||
```
|
||||
|
||||
这行也是:
|
||||
|
||||
|
||||
```
|
||||
tuxedo black
|
||||
```
|
||||
|
||||
其他分隔符,在程序中不是这么处理的。假设字段分隔符是逗号,如下所示的记录,就有三个字段。其中一个字段可能会是 0 个字节(假设这一字段中不包含隐藏字符)
|
||||
|
||||
```
|
||||
a,,b
|
||||
```
|
||||
|
||||
### awk 程序
|
||||
|
||||
`awk` 命令的*程序部分*是由一系列规则组成的。通常来说,程序中每个规则占一行(尽管这不是必须的)。每个规则由一个模式,或一个或多个动作组成:
|
||||
|
||||
```
|
||||
模式 { 动作 }
|
||||
```
|
||||
|
||||
在一个规则中,你可以通过定义模式,来确定动作是否会在记录中执行。模式可以是简单的比较条件、正则表达式,甚至两者结合等等。
|
||||
|
||||
这个例子中,程序*只会*显示包含单词 “raspberry” 的记录:
|
||||
|
||||
```
|
||||
$ awk '/raspberry/ { print $0 }' colours.txt
|
||||
raspberry red 99
|
||||
```
|
||||
|
||||
如果没有文本符合模式,该动作将会应用到所有记录上。
|
||||
|
||||
并且,在一条规则只包含模式时,相当于对整个记录执行 `{ print }`,全部打印出来。
|
||||
|
||||
Awk 程序本质上是*数据驱动*的,命令执行结果取决于数据。所以,与其他编程语言中的程序相比,它还是有些区别的。
|
||||
|
||||
### NF 变量
|
||||
|
||||
每个字段都有指定变量,但针对字段和记录,也存在一些特殊变量。`NF` 变量,能存储 `awk` 在当前记录中找到的字段数量。其内容可在屏幕上显示,也可用于测试。下面例子中的数据,来自上篇文章[文本][3]:
|
||||
|
||||
```
|
||||
$ awk '{ print $0 " (" NF ")" }' colours.txt
|
||||
name color amount (3)
|
||||
apple red 4 (3)
|
||||
banana yellow 6 (3)
|
||||
[...]
|
||||
```
|
||||
|
||||
`awk` 的 `print` 函数会接受一系列参数(可以是变量或者字符串),并将它们拼接起来。这就是为什么在这个例子里,每行结尾处,`awk` 会以一个被括号括起来的整数表示字段数量。
|
||||
|
||||
### NR 变量
|
||||
|
||||
另外,除了统计每个记录中的字段数,`awk` 也统计输入记录数。记录数被存储在变量 `NR` 中,它的使用方法和其他变量没有任何区别。例如,为了在每一行开头显示行号:
|
||||
|
||||
```
|
||||
$ awk '{ print NR ": " $0 }' colours.txt
|
||||
1: name color amount
|
||||
2: apple red 4
|
||||
3: banana yellow 6
|
||||
4: raspberry red 3
|
||||
5: grape purple 10
|
||||
[...]
|
||||
```
|
||||
|
||||
注意,写这个命令时可以不在 `print` 后的多个参数间添加空格,尽管这样会降低可读性:
|
||||
|
||||
```
|
||||
$ awk '{print NR": "$0}' colours.txt
|
||||
```
|
||||
|
||||
### printf() 函数
|
||||
|
||||
为了让输出结果时格式更灵活,你可以使用 `awk` 的 `printf()` 函数。 它与 C、Lua、Bash 和其他语言中的 `printf` 相类似。它也接受以逗号分隔的*格式*参数。参数列表需要写在括号里。
|
||||
|
||||
```
|
||||
$ printf 格式, 项目1, 项目2, ...
|
||||
```
|
||||
|
||||
格式这一参数(也叫*格式符*)定义了其他参数如何显示。这一功能是用*格式修饰符*实现的。`%s` 输出字符,`%d` 输出十进制数字。下面的 `printf` 语句,会在括号内显示字段数量:
|
||||
|
||||
```
|
||||
$ awk 'printf "%s (%d)\n",$0,NF}' colours.txt
|
||||
name color amount (3)
|
||||
raspberry red 4 (3)
|
||||
banana yellow 6 (3)
|
||||
[...]
|
||||
```
|
||||
|
||||
在这个例子里,`%s (%d)` 确定了每一行的输出格式,`$0,NF` 定义了插入 `%s` 和 `%d` 位置的数据。注意,和 `print` 函数不同,在没有明确指令时,输出不会转到下一行。出现转义字符 `\n` 时才会换行。
|
||||
|
||||
### Awk 脚本编程
|
||||
|
||||
这篇文章中出现的所有 `awk` 代码,都在 Bash 终端中执行过。面对更复杂的程序,将命令放在文件(*脚本*)中会更容易。`-f FILE` 选项(不要和 `-F` 弄混了,那个选项用于字段分隔符),可用于指明包含可执行程序的文件。
|
||||
|
||||
举个例子,下面是一个简单的 awk 脚本。创建一个名为 `example1.awk` 的文件,包含以下内容:
|
||||
|
||||
```
|
||||
/^a/ {print "A: " $0}
|
||||
/^b/ {print "B: " $0}
|
||||
```
|
||||
|
||||
如果一个文件包含 `awk` 程序,那么在给文件命名时,最好写上 `.awk` 的扩展名。 这样命名不是强制的,但这么做,会给文件管理器、编辑器(和你)一个关于文件内容的很有用的提示。
|
||||
|
||||
执行这一脚本:
|
||||
|
||||
```
|
||||
$ awk -f example1.awk colours.txt
|
||||
A: raspberry red 4
|
||||
B: banana yellow 6
|
||||
A: apple green 8
|
||||
```
|
||||
|
||||
一个包含 `awk` 命令的文件,在最开头一行加上释伴 `#!`,就能变成可执行脚本。创建一个名为 `example2.awk` 的文件,包含以下内容:
|
||||
|
||||
```
|
||||
#!/usr/bin/awk -f
|
||||
#
|
||||
# 除了第一行,在其他行前显示行号
|
||||
#
|
||||
|
||||
NR > 1 {
|
||||
printf "%d: %s\n",NR,$0
|
||||
}
|
||||
```
|
||||
|
||||
可以说,脚本中只有一行,大多数情况下没什么用。但在某些情况下,执行一个脚本,比记住,然后打一条命令要容易的多。一个脚本文件,也提供了一个记录命令具体作用的好机会。以 `#` 号开头的行是注释,`awk` 会忽略它们。
|
||||
|
||||
给文件可执行权限:
|
||||
|
||||
```
|
||||
$ chmod u+x example2.awk
|
||||
```
|
||||
|
||||
执行脚本:
|
||||
|
||||
```
|
||||
$ ./example2.awk colours.txt
|
||||
2: apple red 4
|
||||
2: banana yellow 6
|
||||
4: raspberry red 3
|
||||
5: grape purple 10
|
||||
[...]
|
||||
```
|
||||
|
||||
将 `awk` 命令放在脚本文件中,有一个好处就是,修改和格式化输出会更容易。在终端中,如果能用一行执行多条 `awk` 命令,那么输入多行,才能达到同样效果,就显得有些多余了。
|
||||
|
||||
### 试一试
|
||||
|
||||
你现在已经足够了解,`awk` 是如何执行指令的了。现在你应该能编写复杂的 `awk` 程序了。试着编写一个 awk 脚本,它需要: 至少包括一个条件模式,以及多个规则。如果你想使用除 `print` 和 `printf` 以外的函数,可以参考在线 [gawk 手册][4]。
|
||||
|
||||
下面这个例子是个很好的切入点:
|
||||
|
||||
```
|
||||
#!/usr/bin/awk -f
|
||||
#
|
||||
# 显示所有记录 除了出现以下情况
|
||||
# 如果第一个记录 包含 “raspberry”
|
||||
# 将 “red” 替换成 “pi”
|
||||
|
||||
$1 == "raspberry" {
|
||||
gsub(/red/,"pi")
|
||||
}
|
||||
|
||||
{ print }
|
||||
```
|
||||
|
||||
试着执行这个脚本,看看输出是什么。接下来就看你自己的了。
|
||||
|
||||
这一系列的下一篇文章,将会介绍更多,能在更复杂(更有用!) 脚本中使用的函数。
|
||||
|
||||
这篇文章改编自 [Hacker Public Radio][5] 系列,一个技术社区博客。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/fields-records-variables-awk
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wenwensnow](https://github.com/wenwensnow)
|
||||
校对:[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/computer_laptop_code_programming_mountain_view.jpg?itok=yx5buqkr (Man at laptop on a mountain)
|
||||
[2]: https://www.gnu.org/software/gawk/manual/html_node/History.html#History
|
||||
[3]: https://linux.cn/article-11543-1.html
|
||||
[4]: https://www.gnu.org/software/gawk/manual/
|
||||
[5]: http://hackerpublicradio.org/eps.php?id=2129
|
234
published/201911/20191107 Demystifying Kubernetes.md
Normal file
234
published/201911/20191107 Demystifying Kubernetes.md
Normal file
@ -0,0 +1,234 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11628-1.html)
|
||||
[#]: subject: (Demystifying Kubernetes)
|
||||
[#]: via: (https://opensourceforu.com/2019/11/demystifying-kubernetes/)
|
||||
[#]: author: (Abhinav Nath Gupta https://opensourceforu.com/author/abhinav-gupta/)
|
||||
|
||||
揭开 Kubernetes 的神秘面纱
|
||||
======
|
||||
|
||||
![][2]
|
||||
|
||||
> Kubernetes 是一款生产级的开源系统,用于容器化应用程序的自动部署、扩展和管理。本文关于使用 Kubernetes 来管理容器。
|
||||
|
||||
“容器”已成为最新的流行语之一。但是,这个词到底意味着什么呢?说起“容器”,人们通常会把它和 Docker 联系起来,Docker 是一个被定义为软件的标准化单元容器。该容器将软件和运行软件所需的环境封装到一个易于交付的单元中。
|
||||
|
||||
容器是一个软件的标准单元,用它来打包代码及其所有依赖项,这样应用程序就可以从一个计算环境到另一个计算环境快速可靠地运行。容器通过创建类似于 ISO 镜像的方式来实现此目的。容器镜像是一个轻量级的、独立的、可执行的软件包,其中包含运行应用程序所需的所有信息,包括代码、运行时、系统工具、系统库和设置。
|
||||
|
||||
容器镜像在运行时变成容器,对于 Docker 容器,镜像在 Docker 引擎上运行时变成容器。容器将软件与环境隔离开来,确保不同环境下的实例,都可以正常运行。
|
||||
|
||||
###什么是容器管理?
|
||||
|
||||
容器管理是组织、添加或替换大量软件容器的过程。容器管理使用软件来自动化创建、部署和扩展容器。这一过程就需要容器编排,容器编排是一个自动对基于容器的应用程序进行部署、管理、扩展、联网和提供可用性的工具。
|
||||
|
||||
### Kubernetes
|
||||
|
||||
Kubernetes 是一个可移植的、可扩展的开源平台,用于管理容器化的工作负载和服务,它有助于配置和自动化。它最初由 Google 开发,拥有一个庞大且快速增长的生态系统。Kubernetes 的服务、技术支持和工具得到广泛应用。
|
||||
|
||||
Google 在 2014 年开源了 Kubernetes 项目。Kubernetes 建立在 Google 十五年大规模运行生产工作负载的经验基础上,并结合了社区中最好的想法和实践以及声明式句法的使用。
|
||||
|
||||
下面列出了与Kubernetes生态系统相关的一些常用术语。
|
||||
|
||||
**Pod**:Pod 是 Kubernetes 应用程序的基本执行单元,是你创建或部署的 Kubernetes 对象模型中的最小和最简单的单元。Pod 代表在 Kubernetes 集群上运行的进程。
|
||||
|
||||
Pod 将运行中的容器、存储、网络 IP(唯一)和控制容器应如何运行的命令封装起来。它代表 Kubernetes 生态系统内的单个部署单元,代表一个应用程序的单个实例,该程序可能包含一个或多个紧密耦合并共享资源的容器。
|
||||
|
||||
Kubernetes 集群中的 Pod 有两种主要的使用方式。第一种是运行单个容器。即“一个容器一个 Pod”,这种方式是最常见的。第二种是运行多个需要一起工作的容器。
|
||||
|
||||
Pod 可能封装一个由紧密关联且需要共享资源的多个同位容器组成的应用程序。
|
||||
|
||||
<ruby>副本集<rt>ReplicaSet</rt></ruby>:副本集的目的是维护在任何给定时间运行的一组稳定的副本容器集。 副本集包含有关一个特定 Pod 应该运行多少个副本的信息。为了创建多个 Pod 以匹配副本集条件,Kubernetes 使用 Pod 模板。副本集与其 Pod 的链接是通过后者的 `metas.ownerReferences` 字段实现,该字段指定哪个资源拥有当前对象。
|
||||
|
||||
<ruby>服务<rt>Services</rt></ruby>:服务是一种抽象,用来公开一组 Pod 功能。使用 Kubernetes,你无需修改应用程序即可使用陌生服务发现机制。Kubernetes 给 Pod 提供了其自己的 IP 地址和一组 Pod 的单个 DNS 名称,并且可以在它们之间负载平衡。
|
||||
|
||||
服务解决的一个主要问题是 Web 应用程序前端和后端的集成。由于 Kubernetes 将幕后的 IP 地址提供给 Pod,因此当 Pod 被杀死并复活时,IP 地址会更改。这给给定的后端 IP 地址连接到相应的前端 IP 地址带来一个大问题。服务通过在 Pod 上提供抽象来解决此问题,类似于负载均衡器。
|
||||
|
||||
<ruby>卷<rt>Volumes</rt></ruby>: Kubernetes 卷具有明确的生命周期,与围绕它的 Pod 相同。 因此,卷超过了 Pod 中运行的任何容器的寿命,并且在容器重新启动后保留了数据。当然,当 Pod 不存在时,该卷也将不再存在。也许比这更重要的是 Kubernetes 支持多种类型的卷,并且 Pod 可以同时使用任意数量的卷。
|
||||
|
||||
卷的核心只是一个目录,其中可能包含一些数据,Pod 中的容器可以访问该目录。该目录是如何产生的,它后端基于什么存储介质,其中的数据内容是什么,这些都由使用的特定卷类型来决定的。
|
||||
|
||||
### 为什么选择 Kubernetes?
|
||||
|
||||
容器是捆绑和运行应用程序的好方法。在生产环境中,你需要管理运行应用程序的容器,并确保没有停机时间。例如,如果一个容器发生故障,则需要启动另一个容器。如果由系统自动实现这一操作,岂不是更好? Kubernetes 就是来解决这个问题的!Kubernetes 提供了一个框架来弹性运行分布式系统。该框架负责扩展需求、故障转移、部署模式等。例如,Kubernetes 可以轻松管理系统的金丝雀部署。
|
||||
|
||||
Kubernetes 为用户提供了:
|
||||
|
||||
1. 服务发现和负载平衡
|
||||
2. 存储编排
|
||||
3. 自动退出和回退
|
||||
4. 自动打包
|
||||
5. 自我修复
|
||||
6. 秘密配置管理
|
||||
|
||||
### Kubernetes 可以做什么?
|
||||
|
||||
在本文中,我们将会看到一些从头构建 Web 应用程序时如何使用 Kubernetes 的代码示例。我们将在 Python 中使用 Flask 创建一个简单的后端服务器。
|
||||
|
||||
对于那些想从头开始构建 Web 应用程序的人,有一些前提条件,即:
|
||||
|
||||
1. 对 Docker、Docker 容器和 Docker 镜像的基本了解。可以访问[这里][8]快速了解。
|
||||
2. 系统中应该安装 Docker。
|
||||
3. 系统中应该安装 Kubernetes,有关如何在本地计算机上安装的说明,请访问[这里][9]。
|
||||
|
||||
现在,创建一个目录,如下代码片段所示:
|
||||
|
||||
```
|
||||
mkdir flask-kubernetes/app && cd flask-kubernetes/app
|
||||
```
|
||||
|
||||
接下来,在 `flask-kubernetes/app` 目录中,创建一个名为 `main.py` 的文件,如下面的代码片段所示:
|
||||
|
||||
```
|
||||
touch main.py
|
||||
```
|
||||
|
||||
在新创建的 `main.py` 文件中,粘贴下面代码:
|
||||
|
||||
```
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
return "Hello from Kubernetes!"
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='0.0.0.0')
|
||||
```
|
||||
|
||||
使用下面命令在本地安装 Flask:
|
||||
|
||||
```
|
||||
pip install Flask==0.10.1
|
||||
```
|
||||
|
||||
Flask 安装后,执行下面的命令:
|
||||
|
||||
```
|
||||
python app.py
|
||||
```
|
||||
|
||||
应该在本地 5000 端口运行 Flask 服务器,这是 Flask 应用程序的默认端口,并且你可以在 http://localhost:5000 上看到输出 “Hello from Kubernetes!”。服务器在本地运行之后,我们创建一个供 Kubernetes 使用的 Docker 镜像。创建一个名为 `Dockerfile` 的文件,并将以下代码片段粘贴到其中:
|
||||
|
||||
```
|
||||
FROM python:3.7
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
ADD . /app/
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
EXPOSE 5000
|
||||
CMD ["python", "/app/main.py"]
|
||||
```
|
||||
|
||||
`Dockerfile` 文件的说明如下:
|
||||
|
||||
1. Docker 将从 DockerHub 获取 Python 3.7 镜像。
|
||||
2. 将在镜像中创建一个应用程序目录。
|
||||
3. 它将一个 `/app` 目录设置为工作目录。
|
||||
4. 将内容从主机中的应用程序目录复制到镜像应用程序目录。
|
||||
5. 发布端口 5000。
|
||||
6. 最后,它运行命令,启动 Flask 服务器。
|
||||
|
||||
接下来,我们将使用以下命令创建 Docker 镜像:
|
||||
|
||||
```
|
||||
docker build -f Dockerfile -t flask-kubernetes:latest .
|
||||
```
|
||||
|
||||
创建 Docker 镜像后,我们可以使用以下命令在本地运行该镜像进行测试:
|
||||
|
||||
```
|
||||
docker run -p 5001:5000 flask-kubernetes
|
||||
```
|
||||
|
||||
通过运行容器在本地完成测试之后,我们需要在 Kubernetes 中部署它。我们将首先使用 `kubectl` 命令验证 Kubernetes 是否正在运行。如果没有报错,则说明它正在工作。如果有报错,请参考[该信息][9]。
|
||||
|
||||
接下来,我们创建一个部署文件。这是一个 Yaml 文件,其中包含有关 Kubernetes 的说明,该说明涉及如何以声明性的方式创建 Pod 和服务。因为我们有 Flask Web 应用程序,我们将创建一个 `deployment.yaml` 文件,并在其中包含 Pod 和服务声明。
|
||||
|
||||
创建一个名为 `deployment.yaml` 的文件并向其中添加以下内容,然后保存:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: flask-kubernetes -service
|
||||
spec:
|
||||
selector:
|
||||
app: flask-kubernetes
|
||||
ports:
|
||||
- protocol: "TCP"
|
||||
port: 6000
|
||||
targetPort: 5000
|
||||
type: LoadBalancer
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: flask-kubernetes
|
||||
spec:
|
||||
replicas: 4
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: flask-kubernetes
|
||||
spec:
|
||||
containers:
|
||||
- name: flask-kubernetes
|
||||
image: flask-kubernetes:latest
|
||||
imagePullPolicy: Never
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
```
|
||||
|
||||
使用以下命令将 yaml 文件发送到 Kubernetes:
|
||||
|
||||
```
|
||||
kubectl apply -f deployment.yaml
|
||||
```
|
||||
|
||||
如果执行以下命令,你会看到 Pod 正在运行:
|
||||
|
||||
```
|
||||
kubectl get pods
|
||||
```
|
||||
|
||||
现在,导航至 http://localhost:6000,你应该会看到 “Hello from Kubernetes!”消息。成功了! 该应用程序现在正在 Kubernetes 中运行!
|
||||
|
||||
### Kubernetes 做不了什么?
|
||||
|
||||
Kubernetes 不是一个传统的,包罗万象的 PaaS(平台即服务)系统。 由于 Kubernetes 运行在容器级别而非硬件级别,因此它提供了 PaaS 产品共有的一些普遍适用功能,如部署、扩展、负载平衡、日志记录和监控。Kubernetes 为开发人员平台提供了构建块,但在重要的地方保留了用户的选择和灵活性。
|
||||
|
||||
* Kubernetes 不限制所支持的应用程序的类型。如果应用程序可以在容器中运行,那么它应该可以在 Kubernetes 上更好地运行。
|
||||
* 它不部署和构建源代码。
|
||||
* 它不决定日志记录、监视或警报解决方案。
|
||||
* 它不提供或不要求配置语言/系统。它提供了一个声明式的 API 供所有人使用。
|
||||
* 它不提供或不采用任何全面的机器配置、维护、管理或自我修复系统。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensourceforu.com/2019/11/demystifying-kubernetes/
|
||||
|
||||
作者:[Abhinav Nath Gupta][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/Morisun029)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensourceforu.com/author/abhinav-gupta/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Gear-kubernetes.jpg?resize=696%2C457&ssl=1 (Gear kubernetes)
|
||||
[2]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Gear-kubernetes.jpg?fit=800%2C525&ssl=1
|
||||
[3]: https://secure.gravatar.com/avatar/f65917facf5f28936663731fedf545c4?s=100&r=g
|
||||
[4]: https://opensourceforu.com/author/abhinav-gupta/
|
||||
[5]: mailto:abhi.aec89@gmail.com
|
||||
[6]: http://opensourceforu.com/wp-content/uploads/2013/10/assoc.png
|
||||
[7]: https://feedburner.google.com/fb/a/mailverify?uri=LinuxForYou&loc=en_US
|
||||
[8]: https://www.docker.com/sites/default/files/Docker_CheatSheet_08.09.2016_0.pdf
|
||||
[9]: https://kubernetes.io/docs/setup/learning-environment/minikube/
|
@ -0,0 +1,151 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11627-1.html)
|
||||
[#]: subject: (How to Install VirtualBox 6.0 on CentOS 8 / RHEL 8)
|
||||
[#]: via: (https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
如何在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0
|
||||
======
|
||||
|
||||

|
||||
|
||||
VirtualBox 是一款自由开源的虚拟化工具,它允许技术人员同时运行多个不同风格的虚拟机(VM)。它通常用于运行桌面(Linux 和 Windows),当人们尝试探索新的 Linux 发行版的功能或希望在 VM 中安装 OpenStack、Ansible 和 Puppet 等软件时,它会非常方便,在这种情况下,我们可以使用 VirtualBox 启动 VM。
|
||||
|
||||
VirtualBox 被分类为 2 类虚拟机管理程序,这意味着它需要一个现有的操作系统,在上面安装 VirtualBox 软件。VirtualBox 提供功能来创建本机网络或 NAT 网络。在本文中,我们将演示如何在 CentOS 8 和 RHEL 8 系统上安装最新版本的 VirtualBox 6.0,并演示如何安装 VirtualBox 扩展。
|
||||
|
||||
### 在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0 的安装步骤
|
||||
|
||||
#### 步骤 1: 启用 VirtualBox 和 EPEL 仓库
|
||||
|
||||
登录到你的 CentOS 8 或 RHEL 8 系统并打开终端,执行以下命令并启用 VirtualBox 和 EPEL 包仓库:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
|
||||
```
|
||||
|
||||
使用以下 `rpm` 命令导入 Oracle VirtualBox 公钥:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# rpm --import https://www.virtualbox.org/download/oracle_vbox.asc
|
||||
```
|
||||
|
||||
使用以下 `dnf` 命令启用 EPEL 仓库:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
|
||||
```
|
||||
|
||||
#### 步骤 2: 安装 VirtualBox 构建工具和依赖项
|
||||
|
||||
运行以下命令来安装所有 VirtualBox 构建工具和依赖项:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y
|
||||
```
|
||||
|
||||
成功安装上面的依赖项和构建工具后,使用 `dnf` 命令继续安装 VirtualBox。
|
||||
|
||||
#### 步骤 3: 在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0
|
||||
|
||||
如果希望在安装之前列出 VirtualBox 的可用版本,请执行以下 dnf 命令:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf search virtualbox
|
||||
Last metadata expiration check: 0:14:36 ago on Sun 17 Nov 2019 04:13:16 AM GMT.
|
||||
=============== Summary & Name Matched: virtualbox =====================
|
||||
VirtualBox-5.2.x86_64 : Oracle VM VirtualBox
|
||||
VirtualBox-6.0.x86_64 : Oracle VM VirtualBox
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
让我们使用以下 `dnf` 命令安装最新版本的 VirtualBox 6.0:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install VirtualBox-6.0 -y
|
||||
```
|
||||
|
||||
如果有本地用户希望将 usb 设备连接到 VirtualBox VM,那么他/她应该是 `vboxusers` 组的一员,请使用下面的 `usermod` 命令将本地用户添加到 `vboxusers` 组。
|
||||
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# usermod -aG vboxusers pkumar
|
||||
```
|
||||
|
||||
#### 步骤 4: 访问 CentOS 8 / RHEL 8 上的 VirtualBox
|
||||
|
||||
有两种方法可以访问 VirtualBox,在命令行输入 `virtualbox` 然后回车:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# virtualbox
|
||||
```
|
||||
|
||||
在桌面环境中,在搜索框中搜索 “VirtualBox”。
|
||||
|
||||
![Access-VirtualBox-CentOS8][3]
|
||||
|
||||
单击 VirtualBox 图标:
|
||||
|
||||
![VirtualBox-CentOS8][4]
|
||||
|
||||
这确认 VirtualBox 6.0 已成功安装,让我们安装它的扩展包。
|
||||
|
||||
#### 步骤 5: 安装 VirtualBox 6.0 扩展包
|
||||
|
||||
顾名思义,VirtualBox 扩展包用于扩展 VirtualBox 的功能。它添加了以下功能:
|
||||
|
||||
* USB 2.0 和 USB 3.0 支持
|
||||
* 虚拟 RDP(VRDP)
|
||||
* 磁盘镜像加密
|
||||
* Intel PXE 启动
|
||||
* 主机网络摄像头
|
||||
|
||||
使用下面的 `wget` 命令下载 Virtualbox 扩展包到下载文件夹中:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ cd Downloads/
|
||||
[root@linuxtechi Downloads]$ wget https://download.virtualbox.org/virtualbox/6.0.14/Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
|
||||
```
|
||||
|
||||
下载后,打开 VirtualBox 并依次点击 “File -> Preferences -> Extension”,然后点击 “+” 号图标添加下载的扩展包:
|
||||
|
||||
![Install-VirtualBox-Extension-Pack-CentOS8][5]
|
||||
|
||||
单击 “Install” 开始安装扩展包:
|
||||
|
||||
![Accept-VirtualBox-Extension-Pack-License-CentOS8][6]
|
||||
|
||||
单击 “I Agree” 接受 VirtualBox 扩展包许可证。
|
||||
|
||||
成功安装 VirtualBox 扩展包后,我们将看到下面的页面,单击 “OK” 并开始使用 VirtualBox。
|
||||
|
||||
![VirtualBox-Extension-Pack-Install-Message-CentOS8][7]
|
||||
|
||||
本文就是这些了,我希望这些步骤可以帮助你在 CentOS 8 和 RHEL 8 系统上安装 VirtualBox 6.0。请分享你的宝贵的反馈和意见。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/
|
||||
|
||||
作者:[Pradeep Kumar][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.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linuxtechi.com/dnf-command-examples-rpm-management-fedora-linux/
|
||||
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Access-VirtualBox-CentOS8.jpg
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/11/VirtualBox-CentOS8.jpg
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Install-VirtualBox-Extension-Pack-CentOS8.jpg
|
||||
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Accept-VirtualBox-Extension-Pack-License-CentOS8.jpg
|
||||
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/11/VirtualBox-Extension-Pack-Install-Message-CentOS8.jpg
|
||||
[9]: http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&t=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
|
||||
[10]: http://twitter.com/share?text=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208&url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&via=Linuxtechi
|
||||
[11]: http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&title=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
|
||||
[12]: http://www.reddit.com/submit?url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&title=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
|
204
published/201911/20191119 How to use pkgsrc on Linux.md
Normal file
204
published/201911/20191119 How to use pkgsrc on Linux.md
Normal file
@ -0,0 +1,204 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11613-1.html)
|
||||
[#]: subject: (How to use pkgsrc on Linux)
|
||||
[#]: via: (https://opensource.com/article/19/11/pkgsrc-netbsd-linux)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
如何在 Linux 上使用 pkgsrc
|
||||
======
|
||||
|
||||
> NetBSD 的软件包管理器通用、灵活又容易。下面是如何使用它。
|
||||
|
||||

|
||||
|
||||
NetBSD 以能在几乎所有平台上运行而闻名,但你知道它*第二*有名的 [pkgsrc][2] 包管理器吗?像 NetBSD 一样,pkgsrc 基本上可以在任何系统上运行,或者至少在任意 Unix 和类 Unix 的系统上上运行。你可以在 BSD、Linux、Illumos、Solaris 和 Mac 上安装 pkgsrc。它总共支持 20 多种操作系统。
|
||||
|
||||
### 为什么使用 pkgsrc?
|
||||
|
||||
除了 MacOS 之外,所有 Unix 操作系统均自带包管理器。你不一定*需要* pkgsrc,但这可能是你想尝试的三个重要原因:
|
||||
|
||||
* **打包**。如果你对打包感到好奇,但尚未尝试自己创建一个软件包,那么 pkgsrc 是一个相对简单的系统,尤其是如果你已经熟悉 Makefile 和类似 [GNU Autotools][3] 之类的构建系统时。
|
||||
* **通用**。如果你使用多个操作系统或发行版,那么可能会遇到每个系统的包管理器。你可以在不同的系统上使用 pkgsrc,以便你为一个系统打包了程序,就为所有系统打包了。
|
||||
* **灵活**。在许多打包系统中,如何选择二进制包或源码包并不总是很明显。使用 pkgsrc,区别很明显,两种安装方法都一样容易,并且都可以为你解决依赖关系。
|
||||
|
||||
### 如何安装 pkgsrc
|
||||
|
||||
无论你使用的是 BSD、Linux、Illumos、Solaris 还是 MacOS,安装过程都基本相同:
|
||||
|
||||
1. 使用 CVS 检出 pkgsrc 树
|
||||
2. 引导 pkgsrc 系统
|
||||
3. 安装软件包
|
||||
|
||||
#### 使用 CVS 检出 pkgsrc 树
|
||||
|
||||
在 Git 和 Subversion 之前,就有了 [CVS][4]。要检出代码你无需了解 CVS 太多,如果你习惯 Git,那么可以将<ruby>检出<rt>checkout</rt></ruby>称为<ruby>克隆<rt>clone</rt></ruby>。当你用 CVS 检出 pkgsrc 时,你就下载了详细说明如何构建每个软件包的“<ruby>配方<rt>recipes</rt></ruby>”。它有很多文件,但是它们都很小,因为你实际上并没有拉取每个包的源码,而只有按需构建时需要的构建基础架构和 Makefile。使用 CVS,你可以轻松地在新版本发布时更新 pkgsrc 检出。
|
||||
|
||||
pkgsrc 文档建议将其源码树放在 `/usr` 目录下,因此你必须使用 `sudo`(或成为 root)运行此命令:
|
||||
|
||||
```
|
||||
$ cd /usr
|
||||
$ sudo cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2019Q3 -P pkgsrc
|
||||
```
|
||||
|
||||
在我撰写本文时,最新版本是 2019Q3。请检查 [pkgsrc.org][6] 主页的新闻部分或 [NetBSD文档][7],以确定最新版本。
|
||||
|
||||
#### 引导 pkgsrc
|
||||
|
||||
pkgsrc 树复制到你的计算机后,你会看到一个充满构建脚本的 `/usr/pkgsrc` 目录。在使用之前,你必须引导 pkgsrc,以便你可以轻松地访问构建和安装软件所需的相关命令。
|
||||
|
||||
引导 pkgsrc 的方式取决于你所使用操作系统。
|
||||
|
||||
对于 NetBSD,你只需使用捆绑的引导器:
|
||||
|
||||
```
|
||||
# cd pkgsrc/bootstrap
|
||||
# ./bootstrap
|
||||
```
|
||||
|
||||
在其他系统上,还有更好的方法,包括一些自定义功能,它是由 Joyent 提供的。要了解运行的确切命令,请访问 [pkgsrc.joyent.com][8]。比如,在 Linux(Fedora、Debian、Slackware 等)上:
|
||||
|
||||
```
|
||||
$ curl -O https://pkgsrc.joyent.com/packages/Linux/el7/bootstrap/bootstrap-trunk-x86_64-20170127.tar.gz
|
||||
$ BOOTSTRAP_SHA="eb0d6911489579ca893f67f8a528ecd02137d43a"
|
||||
```
|
||||
|
||||
尽管路径暗示文件适用于 RHEL 7,但二进制文件往往与所有(最前沿的 Linux 发行版)兼容。如果你发现二进制文件与你的发行版不兼容,你可以选择从源码构建。
|
||||
|
||||
验证 SHA1 校验和:
|
||||
|
||||
```
|
||||
$ echo "${BOOTSTRAP_SHA}" bootstrap-trunk*gz > check-shasum
|
||||
sha1sum -c check-shasum
|
||||
```
|
||||
|
||||
你还可以验证 PGP 签名:
|
||||
|
||||
```
|
||||
$ curl -O https://pkgsrc.joyent.com/packages/Linux/el7/bootstrap/bootstrap-trunk-x86_64-20170127.tar.gz.asc
|
||||
$ curl -sS https://pkgsrc.joyent.com/pgp/56AAACAF.asc | gpg --import
|
||||
$ gpg --verify ${BOOTSTRAP_TAR}{.asc,}
|
||||
```
|
||||
|
||||
当你确认你已有正确的引导套件,将其安装到 `/usr/pkg`:
|
||||
|
||||
```
|
||||
sudo tar -zxpf ${BOOTSTRAP_TAR} -C /
|
||||
```
|
||||
|
||||
它为你提供了通常的 pkgsrc 命令。将这些位置添加到[你的 PATH 环境变量中][9]:
|
||||
|
||||
```
|
||||
$ echo "PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATH" >> ~/.bashrc
|
||||
$ echo "MANPATH=/usr/pkg/man:$MANPATH" >> ~/.bashrc
|
||||
```
|
||||
|
||||
如果你宁愿使用 pkgsrc 而不依赖于 Joyent 的构建,那么只需运行 pkgsrc 源码树的引导脚本即可。在运行特定于系统的脚本之前,请先阅读 `bootstrap` 目录中相关 `README` 文件。
|
||||
|
||||
![Bootstrapping pkgsrc on NetBSD][10]
|
||||
|
||||
### 如何使用 pkgsrc 安装软件
|
||||
|
||||
使用 pkgsrc 安装预编译的二进制文件(就像使用 DNF 或 Apt 一样)是很容易的。二进制安装的命令是 `pgkin`,它有自己的专门网站 [pkgin.net][11]。对于任何用过 Linux 的人来说,这个过程应该感觉相当熟悉。
|
||||
|
||||
要搜索 `tmux` 包:
|
||||
|
||||
```
|
||||
$ pkgin search tmux
|
||||
```
|
||||
|
||||
要安装 tmux 包:
|
||||
|
||||
```
|
||||
$ sudo pkgin install tmux
|
||||
```
|
||||
|
||||
`pkgin` 命令的目的是模仿典型的 Linux 包管理器的行为,因此有选项可以列出可用的包、查找包提供的特定可执行文件,等等。
|
||||
|
||||
### 如何使用 pkgsrc 从源码构建
|
||||
|
||||
然而,pkgsrc 真正强大的地方是方便地从源码构建包。你在第一步中检出了所有 20000 多个构建脚本,你可以直接进入 pkgsrc 源码树来访问这些脚本。
|
||||
|
||||
例如,要从源码构建 `tcsh`,首先找到构建脚本:
|
||||
|
||||
```
|
||||
$ find /usr/pkgsrc -type d -name "tcsh"
|
||||
/usr/pkgsrc/shells/tcsh
|
||||
```
|
||||
|
||||
接下来,进入源码目录:
|
||||
|
||||
```
|
||||
$ cd /usr/pgksrc/shells/tcsh
|
||||
```
|
||||
|
||||
构建脚本目录包含许多文件来帮助在你的系统上构建应用,但值得注意的是,这里面有包含了软件说明的 `DESCR` 文件,以及触发构建的 `Makefile`。
|
||||
|
||||
```
|
||||
$ ls
|
||||
CVS DESCR Makefile
|
||||
PLIST distinfo patches
|
||||
$ cat DESCR
|
||||
TCSH is an extended C-shell with many useful features like
|
||||
filename completion, history editing, etc.
|
||||
$
|
||||
```
|
||||
|
||||
准备就绪后,构建并安装:
|
||||
|
||||
```
|
||||
$ sudo bmake install
|
||||
```
|
||||
|
||||
pkgsrc 系统使用 `bmake` 命令(在第一步检出 pkgsrc 后提供),因此请务必使用 `bmake`(而不是出于习惯使用 `make`)。
|
||||
|
||||
如果要为多个系统构建,那么你可以创建一个包,而不是立即安装:
|
||||
|
||||
```
|
||||
$ cd /usr/pgksrc/shells/tcsh
|
||||
$ sudo bmake package
|
||||
[...]
|
||||
=> Creating binary package in /usr/pkgsrc/packages/All/tcsh-X.Y.Z.tgz
|
||||
```
|
||||
|
||||
pkgsrc 创建的包是标准的 tarball,但它可以方便地通过 `pkg_add` 安装:
|
||||
|
||||
```
|
||||
$ sudo pkg_add /usr/pkgsrc/packages/All/tcsh-X.Y.Z.tgz
|
||||
tcsh-X.Y.Z: adding /usr/pkg/bin/tcsh to /etc/shells
|
||||
$ tcsh
|
||||
localhost%
|
||||
```
|
||||
|
||||
pkgsrc 的 pkgtools 集合提供 `pkg_add`、`pkg_info`、`pkg_admin`、`pkg_create` 和 `pkg_delete` 命令,来帮助管理你在系统上构建和维护软件包。
|
||||
|
||||
### pkgsrc,易于管理
|
||||
|
||||
pkgsrc 系统提供了直接,容易上手的软件包管理方法。如果你正在寻找一个不妨碍你并且可以定制的包管理器,请在任何运行 Unix 或类 Unix 的系统上试试 pkgsrc。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/pkgsrc-netbsd-linux
|
||||
|
||||
作者:[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/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming)
|
||||
[2]: http://pkgsrc.org
|
||||
[3]: https://opensource.com/article/19/7/introduction-gnu-autotools
|
||||
[4]: http://www.netbsd.org/developers/cvs-repos/cvs_intro.html#intro
|
||||
[5]: mailto:anoncvs@anoncvs.NetBSD.org
|
||||
[6]: http://pkgsrc.org/
|
||||
[7]: http://www.netbsd.org/docs/pkgsrc/getting.html
|
||||
[8]: http://pkgsrc.joyent.com/
|
||||
[9]: https://opensource.com/article/17/6/set-path-linux
|
||||
[10]: https://opensource.com/sites/default/files/uploads/pkgsrc-bootstrap.jpg (Bootstrapping pkgsrc on NetBSD)
|
||||
[11]: http://pkgin.net
|
@ -0,0 +1,155 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11619-1.html)
|
||||
[#]: subject: (How to Use TimeShift to Backup and Restore Ubuntu Linux)
|
||||
[#]: via: (https://www.linuxtechi.com/timeshift-backup-restore-ubuntu-linux/)
|
||||
[#]: author: (James Kiarie https://www.linuxtechi.com/author/james/)
|
||||
|
||||
如何使用 TimeShift 备份和还原 Ubuntu Linux
|
||||
======
|
||||
|
||||
你是否曾经想过如何备份和还原 Ubuntu 或 Debian 系统?Timeshift 是一款自由开源工具,可让你创建文件系统的增量快照。你可以使用 RSYNC 或 BTRFS 两种方式创建快照。
|
||||
|
||||

|
||||
|
||||
让我们深入研究并安装 Timeshift。在本教程,我们将安装在 Ubuntu 18.04 LTS 系统上。
|
||||
|
||||
### 在 Ubuntu / Debian Linux 上安装 TimeShift
|
||||
|
||||
TimeShift 尚未正式托管在 Ubuntu 和 Debian 仓库中。考虑到这一点,我们将运行以下命令来添加 PPA:
|
||||
|
||||
```
|
||||
# add-apt-repository -y ppa:teejee2008/ppa
|
||||
```
|
||||
|
||||
![Add timeshift repository][3]
|
||||
|
||||
接下来,使用以下命令更新系统软件包:
|
||||
|
||||
```
|
||||
# apt update
|
||||
```
|
||||
|
||||
成功更新系统后,使用以下 `apt` 命令安装 Timeshift:
|
||||
|
||||
```
|
||||
# apt install timeshift
|
||||
```
|
||||
|
||||
![apt install timeshift][4]
|
||||
|
||||
### 准备备份存储设备
|
||||
|
||||
最佳实践要求我们将系统快照保存在系统硬盘之外的单独的存储卷上。对于本指南,我们将使用 16GB 闪存作为第二个驱动器,并在该驱动器上保存快照。
|
||||
|
||||
```
|
||||
# lsblk | grep sdb
|
||||
```
|
||||
|
||||
![lsblk sdb ubuntu][5]
|
||||
|
||||
为了将闪存用作快照的备份位置,我们需要在设备上创建一个分区表。运行以下命令:
|
||||
|
||||
```
|
||||
# parted /dev/sdb mklabel gpt
|
||||
# parted /dev/sdb mkpart primary 0% 100%
|
||||
# mkfs.ext4 /dev/sdb1
|
||||
```
|
||||
|
||||
![create partition table on drive ubuntu][6]
|
||||
|
||||
在 USB 闪存上创建分区表后,我们可以开始创建文件系统的快照!
|
||||
|
||||
### 使用 Timeshift 创建快照
|
||||
|
||||
要启动 Timeshift,使用应用程序菜单搜索 “Timeshift”。
|
||||
|
||||
![Access timeshift][7]
|
||||
|
||||
单击 Timeshift 图标,系统将提示你输入管理员密码。提供密码,然后单击验证。
|
||||
|
||||
![Authentication required][8]
|
||||
|
||||
接下来,选择你喜欢的快照类型。
|
||||
|
||||
![Select rsync option][9]
|
||||
|
||||
点击 “Next”。选择快照的目标驱动器。在这里,我的位置是标记为 `/dev/sdb` 的外部 USB 驱动器。
|
||||
|
||||
![Select snapshot location][10]
|
||||
|
||||
接下来,定义快照级别。级别是指创建快照的时间间隔。你可以选择每月、每周、每天或每小时的快照级别。
|
||||
|
||||
![Select snapshot levels][11]
|
||||
|
||||
点击 “Finish”。
|
||||
|
||||
在下一个窗口中,单击 “Create” 按钮开始创建快照。此后,系统将开始创建快照。
|
||||
|
||||
![Create snapshot][12]
|
||||
|
||||
最后,你的快照将显示如下:
|
||||
|
||||
![Snapshot created][13]
|
||||
|
||||
### 从快照还原 Ubuntu / Debian
|
||||
|
||||
创建系统快照后,现在让我们看看如何从同一快照还原系统。在同一个 Timeshift 中,单击快照,然后单击 “Restore” 按钮,如图所示。
|
||||
|
||||
![Restore snapshot][14]
|
||||
|
||||
接下来,将提示你选择目标设备。保留默认选择,然后点击 “Next”。
|
||||
|
||||
![Select target device][15]
|
||||
|
||||
恢复过程开始之前,Timeshift 将会试运行。
|
||||
|
||||
![Comparing files dry run][16]
|
||||
|
||||
在下一个窗口中,点击 “Next” 按钮确认显示的操作。
|
||||
|
||||
![Confirm actions][17]
|
||||
|
||||
如图所示,你会看到警告和免责声明。点击 “Next” 初始化恢复过程。
|
||||
|
||||
此后,将开始还原过程,最后,系统之后将重新启动到快照定义的早期版本。
|
||||
|
||||
![Restoring snapshot][18]
|
||||
|
||||
### 总结
|
||||
|
||||
如你所见,使用 TimeShift 从快照还原系统非常容易。在备份系统文件时,它非常方便,并允许你在系统故障时进行恢复。因此,不要害怕修改系统或弄乱系统。TimeShift 使你能够返回到一切运行平稳的时间点。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/timeshift-backup-restore-ubuntu-linux/
|
||||
|
||||
作者:[James Kiarie][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.linuxtechi.com/author/james/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/11/TimeShift-Backup-Restore-Tool-Ubuntu.png
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Add-timeshift-repository.png
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/11/apt-install-timeshift.png
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/11/lsblk-sdb-ubuntu.png
|
||||
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/11/create-partition-table-on-drive-ubuntu.jpg
|
||||
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Access-Timeshift-Ubuntu.jpg
|
||||
[8]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Authentication-required-ubuntu.jpg
|
||||
[9]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Select-Rsync-option-timeshift.jpg
|
||||
[10]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Select-snapshot-location.png
|
||||
[11]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Select-snapshot-levels-Timeshift.jpg
|
||||
[12]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Create-snapshot-timeshift.jpg
|
||||
[13]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Snapshot-created-TimeShift.jpg
|
||||
[14]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Restore-snapshot-timeshift.jpg
|
||||
[15]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Select-target-device-timeshift.jpg
|
||||
[16]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Comparing-files-Dry-Run-timeshift.jpg
|
||||
[17]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Confirm-actions-timeshift.jpg
|
||||
[18]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Restoring-snapshot-timeshift.png
|
215
published/201911/20191120 How to install Java on Linux.md
Normal file
215
published/201911/20191120 How to install Java on Linux.md
Normal file
@ -0,0 +1,215 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11614-1.html)
|
||||
[#]: subject: (How to install Java on Linux)
|
||||
[#]: via: (https://opensource.com/article/19/11/install-java-linux)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
如何在 Linux 上安装 Java
|
||||
======
|
||||
|
||||
> 在桌面上拥抱 Java 应用程序,然后在所有桌面上运行它们。
|
||||
|
||||

|
||||
|
||||
无论你运行的是哪种操作系统,通常都有几种安装应用程序的方法。有时你可能会在应用程序商店中找到一个应用程序,或者使用 Fedora 上的 DNF 或 Mac 上的 Brew 这样的软件包管理器进行安装,而有时你可能会从网站上下载可执行文件或安装程序。因为 Java 是这么多流行的应用程序的后端,所以最好了解安装它的不同方法。好消息是你有很多选择,本文涵盖了所有这些内容。
|
||||
|
||||
坏消息是 Java *太大*,我说的不仅仅是文件大小。Java 是一种开放源代码语言和规范,这意味着从理论上讲,任何人都可以创建它的实现版本。这意味着,在安装任何东西之前,必须确定要安装的 Java 发行版。
|
||||
|
||||
### 我需要 JVM 还是 JRE 或者 JDK?
|
||||
|
||||
Java 大致分为两个下载类别。<ruby>Java 虚拟机<rt>Java Virtual Machine</rt></ruby>(JVM)是运行时组件;它是使 Java 应用程序能够在计算机上启动和运行的“引擎”。它包含在 <ruby>Java 运行时环境<rt>Java Runtime Environment</rt></ruby>(JRE)中。
|
||||
|
||||
<ruby>Java 开发工具包<rt>Java Development Kit</rt></ruby>(JDK)是一个开发工具包:你可以将其视为一个车库,修理工可以坐在那里进行调整、修理和改进。JDK 包含 Java 运行时环境(JRE)。
|
||||
|
||||
以下载来说,这意味着:
|
||||
|
||||
* 如果你是希望运行 Java 应用程序的用户,则只需 JRE(包括了 JVM)。
|
||||
* 如果你是希望使用 Java 进行编程的开发人员,则需要 JDK(包括 JRE 库,而 JRE 库又包括 JVM)。
|
||||
|
||||
### OpenJDK、IcedTea 和 OracleJDK 有什么不同?
|
||||
|
||||
当<ruby>太阳微系统<rt>Sun Microsystems</rt></ruby>被 Oracle 收购时,Java 是该交易的主要部分。幸运的是,Java 是一种开源技术,因此,如果你对 Oracle 维护该项目的方式不满意,则可以选择其他方法。Oracle 将专有组件与 Java 下载捆绑在一起,而 OpenJDK 项目是完全开源的。
|
||||
|
||||
IcedTea 项目本质上是 OpenJDK,但其目标是使用户在使用完全自由开源的工具时更容易构建和部署 OpenJDK。
|
||||
|
||||
(LCTT 译注:阿里巴巴也有一个它自己维护的 Open JDK 发行版“<ruby>龙井<rt>Dragonwell</rt></ruby>”。以下引自其官网:“Alibaba Dragonwell 是一款免费的,生产就绪型 Open JDK 发行版,提供长期支持,包括性能增强和安全修复。……Alibaba Dragonwell 作为 Java 应用的基石,支撑了阿里经济体内所有的 Java 业务。Alibaba Dragonwell 完全兼容 Java SE 标准,……”)
|
||||
|
||||
### 我应该安装哪个 Java?
|
||||
|
||||
如果你对这些选择感到不知所措,那么简单的答案就是你应该安装的 Java 实现应该是最容易安装的那个。当应用程序告诉你需要 Java 12,但你的存储库中只有 Java 8 时,可以安装可以从可靠来源中找到的 Java 12 的任何实现。在 Linux 上,你可以一次安装几个不同版本的 Java,它们不会互相干扰。
|
||||
|
||||
如果你是需要选择使用哪个版本的开发人员,则应考虑所需的组件。如果选择 Oracle 的版本,请注意,软件包中包含专有的插件和字体,可能会[影响你分发你的应用程序][2]。在 IcedTea 或 OpenJDK 上进行开发是最安全的。
|
||||
|
||||
### 从存储库安装 OpenJDK?
|
||||
|
||||
现在,你已经知道要选择什么了,你可以使用软件包管理器搜索 OpenJDK 或 IcedTea,然后安装所需的版本。有些发行版使用关键字 `latest` 来指示最新版本,这通常是你要运行的应用程序所需要的。根据你使用的软件包管理器,你甚至可以考虑使用 `grep` 过滤搜索结果以仅包括最新版本。例如,在 Fedora 上:
|
||||
|
||||
```
|
||||
$ sudo dnf search openjdk | grep latest | cut -f1 -d':'
|
||||
|
||||
java-latest-openjdk-demo.x86_64
|
||||
java-openjdk.i686
|
||||
java-openjdk.x86_64
|
||||
java-latest-openjdk-jmods.x86_64
|
||||
java-latest-openjdk-src.x86_64
|
||||
java-latest-openjdk.x86_64
|
||||
[...]
|
||||
```
|
||||
|
||||
只有当你尝试运行的应用程序坚持要求你使用 Java 的旧版本时,你才应该看看 `latest` 之前的版本。
|
||||
|
||||
在 Fedora 或类似系统上安装 Java:
|
||||
|
||||
```
|
||||
$ sudo dnf install java-latest-openjdk
|
||||
```
|
||||
|
||||
如果你的发行版不使用 `latest` 标签,则可以使用其他关键字,例如 `default`。以下是在 Debian 上搜索 OpenJDK 的信息:
|
||||
|
||||
```
|
||||
$ sudo apt search openjdk | less
|
||||
default-jdk
|
||||
Standard Java development kit
|
||||
|
||||
default-jre
|
||||
Standard Java runtime
|
||||
|
||||
openjdk-11-jdk
|
||||
OpenJDK development kit (JDK)
|
||||
|
||||
[...]
|
||||
```
|
||||
|
||||
在这种情况下,`default-jre` 软件包适合用户,而 `default-jdk` 则适合开发人员。
|
||||
|
||||
例如,要在 Debian 上安装 JRE:
|
||||
|
||||
```
|
||||
$ sudo apt install default-jre
|
||||
```
|
||||
|
||||
现在已安装好 Java。
|
||||
|
||||
你的存储库中可能有*许多*与 Java 相关的软件包。要搜索 OpenJDK,如果你是用户,则查找最新的 JRE 或 JVM,如果你是开发人员,则查找最新的 JDK。
|
||||
|
||||
### 从互联网上安装 Java
|
||||
|
||||
如果在存储库中找不到 JRE 或 JDK,或者找不到满足你需求的 JRE 或 JDK,则可以从互联网上下载开源的 Java 软件包。你可以在 [openjdk.java.net][3] 中找到需要手动安装的 tar 形式的 OpenJDK 下载文件,或者可以从 Azul 下载 tar 形式的 [Zulu 社区版][4]或其可安装的 RPM 或 DEB 软件包。
|
||||
|
||||
#### 从 TAR 文件安装 Java
|
||||
|
||||
如果从 Java.net 或 Azul 下载 TAR 文件,则必须手动安装。这通常称为“本地”安装,因为你没有将 Java 安装到“全局”位置。你可以在 `PATH` 中选择一个合适的位置。
|
||||
|
||||
如果你不知道 `PATH` 中包含什么,请查看一下以找出:
|
||||
|
||||
```
|
||||
$ echo $PATH
|
||||
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/seth/bin
|
||||
```
|
||||
|
||||
在此示例 `PATH` 中,位置 `/usr/local/bin` 和 `/home/seth/bin` 是不错的选择。如果你是计算机上的唯一用户,那么你自己的家目录就很有意义。如果你的计算机上有很多用户,则最好选择一个通用位置,例如 `/usr/local` 或 `/opt`。
|
||||
|
||||
如果你无权访问需要 `sudo` 权限的 `/usr/local` 之类的系统级目录,则可以在你自己的家目录中创建一个本地 `bin`(意思是 “<ruby>二进制<rt>binary</rt></ruby>”,而不是“<ruby>垃圾箱<rt>waste bin</rt></ruby>”)或 `Applications` 文件夹:
|
||||
|
||||
```
|
||||
$ mkdir ~/bin
|
||||
```
|
||||
|
||||
如果它不在你的 `PATH` 中,请将其添加到其中:
|
||||
|
||||
```
|
||||
$ echo PATH=$PATH:$HOME/bin >> ~/.bashrc
|
||||
$ source ~/.bashrc
|
||||
```
|
||||
|
||||
最后,将压缩包解压缩到你选择的目录中。
|
||||
|
||||
```
|
||||
$ tar --extract --file openjdk*linux-x64_bin.tar.gz --directory=$HOME/bin
|
||||
```
|
||||
|
||||
Java 现在安装好了。
|
||||
|
||||
#### 从 RPM 或 DEB 安装 Java
|
||||
|
||||
如果从 Azul.com 下载 RPM 或 DEB 文件,则可以使用软件包管理器进行安装。
|
||||
|
||||
对于 Fedora、CentOS、RHEL 等,请下载 RPM 并使用 DNF 进行安装:
|
||||
|
||||
```
|
||||
$ sudo dnf install zulu*linux.x86_64.rpm
|
||||
```
|
||||
|
||||
对于 Debian、Ubuntu、Pop_OS 和类似发行版,请下载 DEB 软件包并使用 Apt 安装它:
|
||||
|
||||
```
|
||||
$ sudo dpkg -i zulu*linux_amd64.deb
|
||||
```
|
||||
|
||||
Java 现在安装好了。
|
||||
|
||||
#### 用 alternatives 安装你的 Java 版本
|
||||
|
||||
一些应用程序是为特定版本的 Java 开发的,不能与其他任何版本一起使用。这种情况很少见,但确实会发生,在 Linux 上,你可以使用本地安装方法(请参阅上面“从 TAR 文件安装 Java”一节)或使用 `alternatives` 应用程序来解决此冲突。
|
||||
|
||||
`alternatives` 命令会查找 Linux 系统上安装的应用程序,并让你选择要使用的版本。有些发行版,例如 Slackware,不提供 `alternatives` 命令,因此你必须使用本地安装方法。在 Fedora、CentOS 和类似的发行版上,该命令是 `alternatives`。在 Debian、Ubuntu 和类似的系统上,该命令是 `update-alternatives`。
|
||||
|
||||
要获取当前已安装在 Fedora 系统上的应用程序的可用版本列表:
|
||||
|
||||
```
|
||||
$ alternatives --list
|
||||
```
|
||||
|
||||
在 Debian 上,你必须指定可供替代的应用程序:
|
||||
|
||||
```
|
||||
$ update-alternatives --list java
|
||||
```
|
||||
|
||||
在 Fedora 上选择要使系统将哪个版本作为默认版本:
|
||||
|
||||
```
|
||||
$ sudo alternatives --config java
|
||||
```
|
||||
|
||||
在 Debian 上:
|
||||
|
||||
```
|
||||
$ sudo updates-alternatives --config java
|
||||
```
|
||||
|
||||
你可以根据需要运行的应用程序,根据需要更改默认的 Java 版本。
|
||||
|
||||
### 运行 Java 应用
|
||||
|
||||
Java 应用程序通常以 JAR 文件的形式分发。根据你安装 Java 的方式,你的系统可能已经为运行 Java 应用程序配置好了,这使你只需双击应用程序图标(或从应用程序菜单中选择它)即可运行。如果必须执行未与系统其余部分集成的本地 Java 安装,则可以直接从终端启动 Java 应用程序:
|
||||
|
||||
```
|
||||
$ java -jar ~/bin/example.jar &
|
||||
```
|
||||
|
||||
### Java 是个好东西
|
||||
|
||||
Java 是少数将跨平台开发放在首位的编程环境之一。没有什么比问一个应用程序是否能在你的平台上运行然后发现该应用程序是用 Java 编写要让人感到松一口气的了。它是如此简单,无论你是开发人员还是用户,你都可以摆脱任何平台上的焦虑。在桌面上拥抱 Java 应用程序,然后在*所有*桌面上运行它们吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/install-java-linux
|
||||
|
||||
作者:[Seth Kenlon][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/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-beans.jpg?itok=3hkjX5We (Coffee beans)
|
||||
[2]: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html
|
||||
[3]: http://openjdk.java.net
|
||||
[4]: https://www.azul.com/downloads/zulu-community
|
||||
[5]: tmp.wuzOCnXHry#installing-java-from-a-tar-file
|
@ -0,0 +1,175 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11624-1.html)
|
||||
[#]: subject: (How to document Python code with Sphinx)
|
||||
[#]: via: (https://opensource.com/article/19/11/document-python-sphinx)
|
||||
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
|
||||
|
||||
如何使用 Sphinx 给 Python 代码写文档
|
||||
======
|
||||
|
||||
> 最好将文档作为开发过程的一部分。Sphinx 加上 Tox,让文档可以轻松书写,并且外观漂亮。
|
||||
|
||||
![Python in a coffee cup.][1]
|
||||
|
||||
Python 代码可以在源码中包含文档。这种方式默认依靠 **docstring**,它以三引号格式定义。虽然文档的价值是很大的,但是没有充足的文档的代码还是很常见。让我们演练一个场景,了解出色的文档的强大功能。
|
||||
|
||||
经历了太多在白板技术面试上要求你实现斐波那契数列,你已经受够了。你回家用 Python 写了一个可重用的斐波那契计算器,使用浮点技巧来实现 `O(1)` 复杂度。
|
||||
|
||||
代码很简单:
|
||||
|
||||
```
|
||||
# fib.py
|
||||
import math
|
||||
|
||||
_SQRT_5 = math.sqrt(5)
|
||||
_PHI = (1 + _SQRT_5) / 2
|
||||
|
||||
def approx_fib(n):
|
||||
return round(_PHI**(n+1) / _SQRT_5)
|
||||
```
|
||||
|
||||
(该斐波那契数列是四舍五入到最接近的整数的几何序列,这是我最喜欢的鲜为人知的数学事实之一。)
|
||||
|
||||
作为一个好人,你可以将代码开源,并将它放在 [PyPI][2] 上。`setup.py` 文件很简单:
|
||||
|
||||
```
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
name='fib',
|
||||
version='2019.1.0',
|
||||
description='Fibonacci',
|
||||
py_modules=["fib"],
|
||||
)
|
||||
```
|
||||
|
||||
但是,没有文档的代码是没有用的。因此,你可以向函数添加 docstring。我最喜欢的 docstring 样式之一是 [“Google” 样式][3]。标记很轻量,当它放在源代码中时很好。
|
||||
|
||||
|
||||
```
|
||||
def approx_fib(n):
|
||||
"""
|
||||
Approximate Fibonacci sequence
|
||||
|
||||
Args:
|
||||
n (int): The place in Fibonacci sequence to approximate
|
||||
|
||||
Returns:
|
||||
float: The approximate value in Fibonacci sequence
|
||||
"""
|
||||
# ...
|
||||
```
|
||||
|
||||
但是函数的文档只是成功的一半。普通文档对于情境化代码用法很重要。在这种情况下,情景是恼人的技术面试。
|
||||
|
||||
有一种添加更多文档的方式,专业 Python 人的方式通常是在 `docs/` 添加 rst 文件( [reStructuredText][4] 的缩写)。因此 `docs/index.rst` 文件最终看起来像这样:
|
||||
|
||||
```
|
||||
Fibonacci
|
||||
=========
|
||||
|
||||
Are you annoyed at tech interviewers asking you to implement
|
||||
the Fibonacci sequence?
|
||||
Do you want to have some fun with them?
|
||||
A simple
|
||||
:code:`pip install fib`
|
||||
is all it takes to tell them to,
|
||||
um,
|
||||
fib off.
|
||||
|
||||
.. automodule:: fib
|
||||
:members:
|
||||
```
|
||||
|
||||
我们完成了,对吧?我们已经将文本放在了文件中。人们应该会看的。
|
||||
|
||||
### 使 Python 文档更漂亮
|
||||
|
||||
为了使你的文档看起来更漂亮,你可以利用 [Sphinx][5],它旨在制作漂亮的 Python 文档。这三个 Sphinx 扩展特别有用:
|
||||
|
||||
* `sphinx.ext.autodoc`:从模块内部获取文档
|
||||
* `sphinx.ext.napoleon`:支持 Google 样式的 docstring
|
||||
* `sphinx.ext.viewcode`:将 ReStructured Text 源码与生成的文档打包在一起
|
||||
|
||||
为了告诉 Sphinx 该生成什么以及如何生成,我们在 `docs/conf.py` 中配置一个辅助文件:
|
||||
|
||||
```
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.napoleon',
|
||||
'sphinx.ext.viewcode',
|
||||
]
|
||||
# 该入口点的名称,没有 .rst 扩展名。
|
||||
# 惯例该名称是 index
|
||||
master_doc = "index"
|
||||
# 这些值全部用在生成的文档当中。
|
||||
# 通常,发布(release)与版本(version)是一样的,
|
||||
# 但是有时候我们会有带有 rc 标签的发布。
|
||||
project = "Fib"
|
||||
copyright = "2019, Moshe Zadka"
|
||||
author = "Moshe Zadka"
|
||||
version = release = "2019.1.0"
|
||||
```
|
||||
|
||||
此文件使我们可以使用所需的所有元数据来发布代码,并注意扩展名(上面的注释说明了方式)。最后,要确保生成我们想要的文档,请使用 [Tox][6] 管理虚拟环境以确保我们顺利生成文档:
|
||||
|
||||
```
|
||||
[tox]
|
||||
# 默认情况下,`.tox` 是该目录。
|
||||
# 将其放在非点文件中可以从
|
||||
# 文件管理器或浏览器的
|
||||
# 打开对话框中打开生成的文档,
|
||||
# 这些对话框有时会隐藏点文件。
|
||||
toxworkdir = {toxinidir}/build/tox
|
||||
|
||||
[testenv:docs]
|
||||
# 从 `docs` 目录内运行 `sphinx`,
|
||||
# 以确保它不会拾取任何可能进入顶层目录下的
|
||||
# 虚拟环境或 `build/` 目录下的其他工件的杂散文件。
|
||||
changedir = docs
|
||||
# 唯一的依赖关系是 `sphinx`。
|
||||
# 如果我们使用的是单独打包的扩展程序,
|
||||
# 我们将在此处指定它们。
|
||||
# 更好的做法是指定特定版本的 sphinx。
|
||||
deps =
|
||||
sphinx
|
||||
# 这是用于生成 HTML 的 `sphinx` 命令。
|
||||
# 在其他情况下,我们可能想生成 PDF 或电子书。
|
||||
commands =
|
||||
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
|
||||
# 我们使用 Python 3.7。
|
||||
# Tox 有时会根据 testenv 的名称尝试自动检测它,
|
||||
# 但是 `docs` 没有给出有用的线索,因此我们必须明确它。
|
||||
basepython = python3.7
|
||||
```
|
||||
|
||||
现在,无论何时运行 Tox,它都会为你的 Python 代码生成漂亮的文档。
|
||||
|
||||
### 在 Python 中写文档很好
|
||||
|
||||
作为 Python 开发人员,我们可以使用的工具链很棒。我们可以从 **docstring** 开始,添加 .rst 文件,然后添加 Sphinx 和 Tox 来为用户美化结果。
|
||||
|
||||
你对好的文档有何评价?你还有其他喜欢的方式么?请在评论中分享它们!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/document-python-sphinx
|
||||
|
||||
作者:[Moshe Zadka][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/moshez
|
||||
[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://pypi.org/
|
||||
[3]: http://google.github.io/styleguide/pyguide.html#381-docstrings
|
||||
[4]: http://docutils.sourceforge.net/rst.html
|
||||
[5]: http://www.sphinx-doc.org/en/master/
|
||||
[6]: https://tox.readthedocs.io/en/latest/
|
@ -0,0 +1,141 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11617-1.html)
|
||||
[#]: subject: (Bauh – Manage Snaps, Flatpaks and AppImages from One Interface)
|
||||
[#]: via: (https://itsfoss.com/bauh-package-manager/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
bauh:在一个界面中管理 Snap、Flatpak 和 AppImage
|
||||
======
|
||||
|
||||

|
||||
|
||||
[Snap][1]、[Flatpak][2] 和 [AppImage][3] 等通用软件包的最大问题之一就是管理它们。大多数内置的软件包管理器都不能全部支持这些新格式。
|
||||
|
||||
幸运的是,我偶然发现了一个支持这几种通用包格式的应用程序。
|
||||
|
||||
### bauh:多包装需求的管理器
|
||||
|
||||
[bauh][4](LCTT:我给该软件建议一个中文名:“包豪”)最初名为 fpakman,旨在处理 Flatpak、Snap、[AppImage][5] 和 [AUR][6] 软件包。创建者 [vinifmor][7] 在 2019 年 6 月启动了该项目,[意图][8]“为 Manjaro 用户提供管理 Flatpak 的图形界面”。此后,他扩展了该应用程序,以添加对基于 Debian 的系统的支持。
|
||||
|
||||
![Bauh About][9]
|
||||
|
||||
首次打开 bauh 时,它将扫描已安装的应用程序并检查更新。如果有任何需要更新的内容,它们将列在前面并居中。更新所有软件包后,你将看到已安装的软件包列表。你可以取消选择不需要更新的软件包,以防止其被更新。你也可以选择安装该应用程序的早期版本。
|
||||
|
||||
![With Bauh you can manage various types of packages from one application][10]
|
||||
|
||||
你也可以搜索应用程序。bauh 提供了有关已安装和已搜索软件包的详细信息。如果你对一种(或多种)软件包类型不感兴趣,则可以在设置中取消选择它们。
|
||||
|
||||
![Bauh Search][22]
|
||||
|
||||
![Bauh Package Info][13]
|
||||
|
||||
![Bauh Updating][19]
|
||||
|
||||
### 在你的 Linux 发行版上安装 bauh
|
||||
|
||||
让我们看看如何安装 bauh。
|
||||
|
||||
#### 基于 Arch 的发行版
|
||||
|
||||
如果你安装的是最近的 [Manjaro][11],则应该一切已经就绪。bauh 默认情况下已安装。如果你安装的是较早版本的 Manjaro(如我一样)或其他基于 Arch 的发行版,则可以在终端中输入以下内容从 [AUR][12] 中进行安装:
|
||||
|
||||
```
|
||||
sudo pacman -S bauh
|
||||
```
|
||||
|
||||
#### 基于 Debian/Ubuntu 的发行版
|
||||
|
||||
如果你拥有基于 Debian 或 Ubuntu 的 Linux 发行版,则可以使用 `pip` 安装 bauh。首先,请确保[在 Ubuntu 上安装了 pip][14]。
|
||||
|
||||
```
|
||||
sudo apt install python3-pip
|
||||
```
|
||||
|
||||
然后使用它来安装 bauh:
|
||||
|
||||
```
|
||||
pip3 install bauh
|
||||
```
|
||||
|
||||
但是,该软件的创建者建议[手动][15]安装它,以避免弄乱系统的库。
|
||||
|
||||
要手动安装 bauh,你必须先下载其[最新版本][16]。下载后,可以[使用图形工具][17]或 [unzip 命令][18]解压缩。接下来,在终端中打开该文件夹。你将需要使用以下步骤来完成安装。
|
||||
|
||||
首先,在名为 `env` 的文件夹中创建一个虚拟环境:
|
||||
|
||||
```
|
||||
python3 -m venv env
|
||||
```
|
||||
|
||||
现在在该环境中安装该应用程序的代码:
|
||||
|
||||
```
|
||||
env/bin/pip install .
|
||||
```
|
||||
|
||||
启动该应用程序:
|
||||
|
||||
```
|
||||
env/bin/bauh
|
||||
```
|
||||
|
||||
一旦完成了 bauh 的安装,就可以通过更改环境设置和参数来对其进行[微调][20]。
|
||||
|
||||
### bauh 的未来之路
|
||||
|
||||
bauh 在短短的几个月中增长了很多。它有计划继续增长。当前的[路线图][21]包括:
|
||||
|
||||
* 支持其他打包技术
|
||||
* 每种打包技术一个单独模块
|
||||
* 内存和性能改进
|
||||
* 改善用户体验
|
||||
|
||||
### 结语
|
||||
|
||||
当我尝试 bauh 时,遇到了两个问题。当我第一次打开它时,它告诉我尚未安装 Snap,如果要使用 Snap 软件包,则必须安装它。我知道我已经安装了 Snap,因为我在终端中运行了 `snap list`,并且可以正常工作。我重新启动系统,Snap 才工作正常。
|
||||
|
||||
我遇到的另一个问题是我的一个 AUR 软件包无法更新。我可以用 `yay` 更新软件包,而没有任何问题。可能是我的 Manjaro 有问题,我已经使用了它 3 到 4 年。
|
||||
|
||||
总体而言,bauh 可以工作。它做到了宣称的功能。我不能要求更多。
|
||||
|
||||
你有没有用过 hauh?如果有的话,你最喜欢的用于管理不同打包格式的工具是什么?在下面的评论中让我们知道。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/bauh-package-manager/
|
||||
|
||||
作者:[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://snapcraft.io/
|
||||
[2]: https://flatpak.org/
|
||||
[3]: https://appimage.org/
|
||||
[4]: https://github.com/vinifmor/bauh
|
||||
[5]: https://itsfoss.com/use-appimage-linux/
|
||||
[6]: https://itsfoss.com/best-aur-helpers/
|
||||
[7]: https://github.com/vinifmor
|
||||
[8]: https://forum.manjaro.org/t/bauh-formerly-known-as-fpakman-a-gui-for-flatpak-and-snap-management/96180
|
||||
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/bauh-about.jpg?ssl=1
|
||||
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/bauh.jpg?ssl=1
|
||||
[11]: https://manjaro.org/
|
||||
[12]: https://aur.archlinux.org/packages/bauh
|
||||
[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/bauh-package-info.jpg?ssl=1
|
||||
[14]: https://itsfoss.com/install-pip-ubuntu/
|
||||
[15]: https://github.com/vinifmor/bauh#manual-installation
|
||||
[16]: https://github.com/vinifmor/bauh/releases
|
||||
[17]: https://itsfoss.com/unzip-linux/
|
||||
[18]: https://linuxhandbook.com/unzip-command/
|
||||
[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/bauh-updating.jpg?ssl=1
|
||||
[20]: https://github.com/vinifmor/bauh#general-settings
|
||||
[21]: https://github.com/vinifmor/bauh#roadmap
|
||||
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/bauh-search.png?resize=800%2C319&ssl=1
|
||||
[23]: https://reddit.com/r/linuxusersgroup
|
@ -0,0 +1,82 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11616-1.html)
|
||||
[#]: subject: (Google to Add Mainline Linux Kernel Support to Android)
|
||||
[#]: via: (https://itsfoss.com/mainline-linux-kernel-android/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
谷歌为安卓添加主线 Linux 内核支持
|
||||
======
|
||||
|
||||
当前的安卓生态系统被数百种不同版本的安卓所污染,每种版本都运行着 Linux 内核的不同变体。每个版本均针对不同的手机和不同的配置而设计。谷歌试图通过将主线 Linux 内核添加到安卓来解决该问题。
|
||||
|
||||
### 当前在安卓中是如何处理 Linux 内核的
|
||||
|
||||
在到达你的手机之前,你手机上的 Linux 内核经历了[三个主要步骤][1]。
|
||||
|
||||
首先,谷歌采用了 Linux 内核的 LTS(长期支持)版本,并添加了所有的安卓专用代码。这将成为“安卓通用内核”。
|
||||
|
||||
然后,谷歌将此代码发送给创建可运行在手机的片上系统(SoC)的公司。这通常是高通公司。
|
||||
|
||||
SoC 制造商添加了支持 CPU 和其他芯片的代码后,便会将该内核传递给实际的设备制造商,例如三星和摩托罗拉。然后,设备制造商添加代码以支持手机的其余部分,例如显示屏和摄像头。
|
||||
|
||||
每个步骤都需要一段时间才能完成,并且会导致该内核无法与其他任何设备一起使用。这也意味着内核会非常旧,通常是大约两年前的内核。例如,上个月交付的谷歌 Pixel 4 带有来自 2017 年 11 月的内核,而且它将永远不会得到更新。
|
||||
|
||||
谷歌承诺会为较旧的设备创建安全补丁,这意味着他们会一直盯着大量的旧代码。
|
||||
|
||||
### 将来
|
||||
|
||||
![][2]
|
||||
|
||||
去年,谷歌宣布[计划][3]解决此问题。今年,他们在 2019 Linux Plumbers Conference 上展示了他们取得的进展。
|
||||
|
||||
> “我们知道运行安卓需要什么,但不一定是在任何给定的硬件上。因此,我们的目标是从根本上找出所有这些,然后将其交给上游,并尝试尽可能接近主线。”
|
||||
>
|
||||
> Sandeep Patil,[安卓内核团队负责人][1]
|
||||
|
||||
他们确实炫耀了运行带有合适的 Linux 内核的小米 Poco F1。但是,有些东西[似乎没有工作][4],例如电池电量百分比一直留在 0%。
|
||||
|
||||
那么,谷歌计划如何使其工作呢?从他们的 [Treble 项目][5]计划中摘录。在 Treble 项目之前,与设备和安卓本身交互的底层代码是一大堆代码。Treble 项目将两者分开,并使它们模块化,以便可以更快地交付安卓更新,并且在更新时,这些低级代码可以保持不变。
|
||||
|
||||
谷歌希望为内核带来同样的模块化。他们的[计划][1]“涉及稳定 Linux 的内核 ABI,并为 Linux 内核和硬件供应商提供稳定的接口来进行写入。谷歌希望将 Linux 内核与其硬件支持脱钩。”
|
||||
|
||||
因此,这意味着谷歌将交付一个内核,而硬件驱动程序将作为内核模块加载。目前,这只是一个草案。仍然有很多技术问题有待解决。因此,这不会很快有结果。
|
||||
|
||||
### 来自开源的反对意见
|
||||
|
||||
开源社区不会对将专有代码放入内核的想法感到满意。[Linux 内核准则][6]指出,驱动程序必须具有 GPL 许可证才能包含在内核中。他们还指出,如果驱动程序的更改导致错误,应由导致该错误的人来解决。从长远来看,这意味着设备制造商的工作量将减少。
|
||||
|
||||
### 关于将主线内核包含到安卓中的最终想法
|
||||
|
||||
到目前为止,这只是一个草案。谷歌有很大的可能会开始进行该项目,除非他们意识到这将需要多少工作后才会放弃。看看谷歌[已经放弃][7]了多少个项目!
|
||||
|
||||
[Android Police][4] 指出谷歌正在开发其 [Fuchsia 操作系统][8],这似乎是为了有一天取代安卓。
|
||||
|
||||
那么,问题是谷歌会尝试完成那些艰巨的任务,使安卓以主线 Linux 内核运行,还是完成他们统一的安卓替代产品的工作?只有时间可以回答。
|
||||
|
||||
你对此话题有何看法?请在下面的评论中告诉我们。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/mainline-linux-kernel-android/
|
||||
|
||||
作者:[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://arstechnica.com/gadgets/2019/11/google-outlines-plans-for-mainline-linux-kernel-support-in-android/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/mainline_linux_kernel_android.png?ssl=1
|
||||
[3]: https://lwn.net/Articles/771974/
|
||||
[4]: https://www.androidpolice.com/2019/11/19/google-wants-android-to-use-regular-linux-kernel-potentially-improving-updates-and-security/
|
||||
[5]: https://www.computerworld.com/article/3306443/what-is-project-treble-android-upgrade-fix-explained.html
|
||||
[6]: https://www.kernel.org/doc/Documentation/process/stable-api-nonsense.rst
|
||||
[7]: https://killedbygoogle.com/
|
||||
[8]: https://itsfoss.com/fuchsia-os-what-you-need-to-know/
|
||||
[9]: https://reddit.com/r/linuxusersgroup
|
168
published/201911/20191127 Displaying dates and times your way.md
Normal file
168
published/201911/20191127 Displaying dates and times your way.md
Normal file
@ -0,0 +1,168 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11623-1.html)
|
||||
[#]: subject: (Displaying dates and times your way)
|
||||
[#]: via: (https://www.networkworld.com/article/3481602/displaying-dates-and-times-your-way-with-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
在终端里按你的方式显示日期和时间
|
||||
======
|
||||
|
||||
> Linux 的 date 命令提供了很多显示日期和时间的选项,要比你想的还要多。这是一些有用的选择。
|
||||
|
||||

|
||||
|
||||
在 Linux 系统上,`date` 命令非常简单。你键入 `date`,日期和时间将以一种有用的方式显示。它包括星期几、日期、时间和时区:
|
||||
|
||||
```
|
||||
$ date
|
||||
Tue 26 Nov 2019 11:45:11 AM EST
|
||||
```
|
||||
|
||||
只要你的系统配置正确,你就会看到日期和当前时间以及时区。
|
||||
|
||||
但是,该命令还提供了许多选项来以不同方式显示日期和时间信息。例如,如果要显示日期以便进行排序,则可能需要使用如下命令:
|
||||
|
||||
```
|
||||
$ date "+%Y-%m-%d"
|
||||
2019-11-26
|
||||
```
|
||||
|
||||
在这种情况下,年、月和日按该顺序排列。请注意,我们使用大写字母 `Y` 来获得四位数的年份。如果我们使用小写的 `y`,则只会看到两位数字的年份(例如 19)。不要让这种做法使你错误地联想到如果 `%m` 给你一个数字月份,`%M` 可能会给你月份的名称。不,`%M` 将给你分钟数。要以缩写名称格式获得月份,你要使用 `%b`,而对于完全拼写的月份,则要使用 `%B`。
|
||||
|
||||
```
|
||||
$ date "+%b %B"
|
||||
Nov November
|
||||
```
|
||||
|
||||
或者,你可能希望以这种常用格式显示日期:
|
||||
|
||||
```
|
||||
$ date "+%D"
|
||||
11/26/19
|
||||
```
|
||||
|
||||
如果你需要四位数的年份,则可以执行以下操作:
|
||||
|
||||
```
|
||||
$ date "+%x"
|
||||
11/26/2019
|
||||
```
|
||||
|
||||
下面是一个可能有用的示例。假设你需要创建一个每日报告并在文件名中包含日期,则可以使用以下命令来创建文件(可能用在脚本中):
|
||||
|
||||
```
|
||||
$ touch Report-`date "+%Y-%m-%d"`
|
||||
```
|
||||
|
||||
当你列出你的报告时,它们将按日期顺序或反向日期顺序(如果你添加 `-r`)列出。
|
||||
|
||||
```
|
||||
$ ls -r Report*
|
||||
Report-2019-11-26
|
||||
Report-2019-11-25
|
||||
Report-2019-11-22
|
||||
Report-2019-11-21
|
||||
Report-2019-11-20
|
||||
```
|
||||
|
||||
你还可以在日期字符串中添加其他详细信息。可用的各种选项多得令人惊讶。你可以使用 `date "+%q"` 来显示你所在的一年中的哪个季度,或使用类似以下命令来显示两个月前的日期:
|
||||
|
||||
```
|
||||
$ date --date="2 months ago"
|
||||
Thu 26 Sep 2019 09:02:43 AM EDT
|
||||
```
|
||||
|
||||
是否想知道下周四的日期?你可以使用类似 `date --date="next thu"` 的命令,但是要理解,对于Linux,下个周四意味着今天之后的周四。如果今天是星期三,那就是明天,而不是下周的星期四。但是,你可以像下面的第二个命令一样指定下周的星期四。
|
||||
|
||||
```
|
||||
$ date --date="next thu"
|
||||
Thu 28 Nov 2019 12:00:00 AM EST
|
||||
$ date --date="next week thu"
|
||||
Thu 05 Dec 2019 12:00:00 AM EST
|
||||
```
|
||||
|
||||
`date` 命令的手册页列出了其所有选项。该列表多得令人难以置信,但是你可能会发现一些日期/时间显示选项非常适合你。以下是一些你可能会发现有趣的东西。
|
||||
|
||||
世界标准时间(UTC):
|
||||
|
||||
```
|
||||
$ date -u
|
||||
Tue 26 Nov 2019 01:13:59 PM UTC
|
||||
```
|
||||
|
||||
自 1970 年 1 月 1 日以来的秒数(与 Linux 系统上日期的存储方式有关):
|
||||
|
||||
```
|
||||
$ date +%s
|
||||
1574774137
|
||||
```
|
||||
|
||||
以下是 `date` 命令选项的完整列表。正如我所说,它比我们大多数人想象的要广泛得多。
|
||||
|
||||
- `%%` 显示字母 %
|
||||
- `%a` 本地语言环境的缩写星期名称(例如,日 / Sun)
|
||||
- `%A` 本地语言环境的完整星期名称(例如,星期日 / Sunday)
|
||||
- `%b` 本地语言环境的缩写月份名称(例如 一 / Jan)
|
||||
- `%B` 本地语言环境的完整月份名称(例如,一月 / January)
|
||||
- `%c` 本地语言环境的日期和时间(例如 2005年3月3日 星期四 23:05:25 / Thu Mar 3 23:05:25 2005)
|
||||
- `%C` 世纪;类似于 `%Y`,但省略了后两位数字(例如,20)
|
||||
- `%d` 月份的天(例如,01)
|
||||
- `%D` 日期;与 `%m/%d/%y` 相同
|
||||
- `%e` 月份的天,填充前缀空格;与 `%_d` 相同
|
||||
- `%F` 完整日期;与 `%Y-%m-%d` 相同
|
||||
- `%g` ISO 周号的年份的后两位数字(请参见 `%G`)
|
||||
- `%G` ISO 周号的年份(请参阅 `%V`);通常仅配合 `%V` 使用
|
||||
- `%h` 与 `%b` 相同
|
||||
- `%H` 24 小时制的小时(00..23)
|
||||
- `%I` 12 小时制的小时(01..12)
|
||||
- `%j` 一年的天(001..366)
|
||||
- `%k` 24 小时制的小时,填充前缀空格( 0..23);与 `%_H` 相同
|
||||
- `%l` 12 小时制的小时,填充前缀空格( 1..12);与 `%_I` 相同
|
||||
- `%m` 月份(01..12)
|
||||
- `%M` 分钟(00..59)
|
||||
- `%n` 换行符
|
||||
- `%N` 纳秒(000000000..999999999)
|
||||
- `%p` 本地语言环境中等同于 AM 或 PM 的字符串;如果未知,则为空白
|
||||
- `%P` 像 `%p`,但使用小写
|
||||
- `%q` 季度(1..4)
|
||||
- `%r` 本地语言环境的 12 小时制时间(例如,晚上 11:11:04 / 11:11:04 PM)
|
||||
- `%R` 24 小时制的小时和分钟;与 `%H:%M` 相同
|
||||
- `%s` 自 1970-01-01 00:00:00 UTC 以来的秒数
|
||||
- `%S` 秒(00..60)
|
||||
- `%t` 制表符
|
||||
- `%T` 时间;与 `%H:%M:%S` 相同
|
||||
- `%u` 星期(1..7);1 是星期一
|
||||
- `%U` 年的周号,以星期日为一周的第一天,从 00 开始(00..53)
|
||||
- `%V` ISO 周号,以星期一为一周的第一天,从 01 开始(01..53)
|
||||
- `%w` 星期(0..6);0 是星期日
|
||||
- `%W` 年的周号,星期一为一周的第一天,从 00 开始(00..53)
|
||||
- `%x` 本地语言环境的日期表示形式(例如,1999年12月31日 / 12/31/99)
|
||||
- `%X` 本地语言环境的时间表示形式(例如,23:13:48)
|
||||
- `%y` 年的最后两位数字(00..99)
|
||||
- `%Y` 年份
|
||||
- `%z` +hhmm 格式的数字时区(例如,-0400)
|
||||
- `%:z` +hh:mm 格式的数字时区(例如,-04:00)
|
||||
- `%::z` +hh:mm:ss 格式的数字时区(例如,-04:00:00)
|
||||
- `%:::z` 数字时区,`:` 指明精度(例如,-04, +05:30)
|
||||
- `%Z` 字母时区缩写(例如,EDT)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3481602/displaying-dates-and-times-your-way-with-linux.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][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://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/newsletters/signup.html
|
||||
[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
85
published/20191113 Edit images on Fedora easily with GIMP.md
Normal file
85
published/20191113 Edit images on Fedora easily with GIMP.md
Normal file
@ -0,0 +1,85 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11632-1.html)
|
||||
[#]: subject: (Edit images on Fedora easily with GIMP)
|
||||
[#]: via: (https://fedoramagazine.org/edit-images-on-fedora-easily-with-gimp/)
|
||||
[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/)
|
||||
|
||||
在 Fedora 上使用 GIMP 轻松编辑图像
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
GIMP(GNU Image Manipulation Program 的缩写)是自由开源的图像处理软件。它有很多的功能,从简单的图像编辑,到复杂的滤镜、脚本,甚至是动画,它是流行的商业同类软件的一款很好的替代品。
|
||||
|
||||
继续阅读来学习如何在 Fedora 上安装和使用 GIMP。这篇文章涉及基本的日常图像编辑工作。
|
||||
|
||||
### 安装 GIMP
|
||||
|
||||
GIMP 在官方 Fedora 存储库中可获得。为安装它,运行:
|
||||
|
||||
```
|
||||
sudo dnf install gimp
|
||||
```
|
||||
|
||||
### 单窗口模式
|
||||
|
||||
在你打开应用程序后,它显示带有工具箱和主编辑区的暗色主题窗口。注意,它有两种窗口模式,你可以通过选择“<ruby>窗口<rt>Windows</rt></ruby> -> <ruby>单窗口模式<rt>Single Window Mode</rt></ruby>”在其中切换。通过选中这个选项,用户界面的所有组件将显示在单个窗口中。否则,它们将是分离的。
|
||||
|
||||
### 加载图像
|
||||
|
||||
![][2]
|
||||
|
||||
为加载图像,转到“<ruby>文件<rt>File</rt></ruby> -> <ruby>打开<rt>Open</rt></ruby>”,然后选择你的文件并选择你的图像文件。
|
||||
|
||||
### 重新调整一个图像的大小
|
||||
|
||||
为重新调整图像大小,你可以基于一对参数重新调整大小,包括像素和百分比 —— 在编辑图像时,这两个参数很方便。
|
||||
|
||||
让我们假使我们需要缩小 Fedora 30 背景图像到它当前大小的 75%。为此,选择“<ruby>图像<rt> Image</rt></ruby> -> <ruby>比例<rt>Scale</rt></ruby>”,然后在比例对话框上,在单位下拉列表中选择“<ruby>百分比<rt>percentage</rt></ruby>”。接下来,输入 “75” 作为宽度或高度,然后按 Tab 键。默认情况下,其它尺寸将自动地调整大小,以相应地与更改的尺寸保持纵横比。现在,保存其它选项不变,并按比例。
|
||||
|
||||
![][3]
|
||||
|
||||
该图像缩小到其原始尺寸的 75%。
|
||||
|
||||
### 旋转图像
|
||||
|
||||
旋转是一种变换操作,因此,你可以从主菜单下的“<ruby>图像<rt>Image</rt></ruby> -> <ruby>变换<rt>Transform</rt></ruby>”下找到它,其中有图像旋转 90° 或 180° 的选项。在上述选项下也有垂直或水平翻转图像的选项。
|
||||
|
||||
让我们假使我们需要旋转图像 90°。在应用一次 90° 顺时针旋转和水平翻转后,我们的图像将看起来像这样:
|
||||
|
||||
![Transforming an image with GIMP][4]
|
||||
|
||||
### 添加文本
|
||||
|
||||
添加文本非常简单。只需要从工具箱中选择 “A” 图标,然后,在你的图像上,单击你想要添加文本的位置。如果工具箱不可见,从“<ruby>窗口<rt>Windows</rt></ruby> -> <ruby>新建工具箱<rt>New Toolbox</rt></ruby>”打开它。
|
||||
|
||||
当你编辑文本时,你可能注意到,文本对话框有字体自定义选项,包括字体系列、字体大小等等。
|
||||
|
||||
![Adding text to image in GIMP][5]
|
||||
|
||||
### 保存和导出
|
||||
|
||||
你可以从“<ruby>文件<rt>File</rt></ruby> -> <ruby>保存<rt>Save</rt></ruby>”或通过按 `Ctrl+S` 来将你的编辑保存为一个带有 `.xcf` 扩展名的 GIMP 工程。或者,你可以导出你的图像,例如,以 PNG 或 JPEG 格式。为导出图像,转到“<ruby>文件<rt>File</rt></ruby> -> <ruby>导出为<rt>Export As</rt></ruby>”或按 `Ctrl+Shift+E`,接下来,在你面前将产生一个你可以选择输出图像和名称的对话框。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/edit-images-on-fedora-easily-with-gimp/
|
||||
|
||||
作者:[Mehdi Haghgoo][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/powergame/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/10/gimp-magazine-816x346.jpg
|
||||
[2]: https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-00-44-300x165.png
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-17-33-300x262.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-41-28-300x243.png
|
||||
[5]: https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-47-54-300x237.png
|
||||
|
@ -0,0 +1,105 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11629-1.html)
|
||||
[#]: subject: (Switching from Python 2 to Python 3: What you need to know)
|
||||
[#]: via: (https://opensource.com/article/19/11/end-of-life-python-2)
|
||||
[#]: author: (Katie McLaughlin https://opensource.com/users/glasnt)
|
||||
|
||||
从 Python 2 切换到 Python 3 你所需要了解的
|
||||
======
|
||||
|
||||
> Python 2 将在几周内走到生命终点,这篇文章是你迁移到 Python 3 之前应该知道的。
|
||||
|
||||

|
||||
|
||||
从 2020 年 1 月 1 日开始,Python 2.7 将不再得到正式支持。在此日期之后,将会发布一个[最终错误修复][2]计划,但是仅此而已。
|
||||
|
||||
Python 2 的生命终点(EOL)对你意味着什么?如果正在运行着 Python 2,你需要迁移。
|
||||
|
||||
### 是谁决定 Python 2 的生命终点?
|
||||
|
||||
在 [2012][3] 年,维护 Python 编程语言的团队审查了其选项。有两个越来越不同的代码库,Python 2 和 Python 3。这两者都很流行,但是较新的版本并未得到广泛采用。
|
||||
|
||||
除了 Python 3 中完全重写的 Unicode 支持改变了处理数据的底层方式造成的断层,这个主要版本的变化还一次性出现了一些非向后兼容的更改。这种断层的决定成文于 [2006 年][4]。为了减轻该断层的影响,Python 2 继续保持了维护,并向后移植了一些 Python 3 的功能。为了进一步帮助社区过渡,EOL 日期[从 2015 年延长至 2020 年][5],又延长了五年。
|
||||
|
||||
该团队知道,维护不同的代码库是必须解决的麻烦。最终,他们[宣布了][6]一项决定:
|
||||
|
||||
>“我们是制作和照料 Python 编程语言的志愿者。我们已决定 2020 年 1 月 1 日将是我们停止使用 Python 2 的日子。这意味着在这一天之后,即使有人发现其中存在安全问题,我们也将不再对其进行改进。你应尽快升级到 Python 3。”
|
||||
|
||||
[Nick Coghlan][7] 是 CPython 的核心开发人员,也是 Python 指导委员会的现任成员,[在他的博客中添加了更多信息][8]。由 [Barry Warsaw][10](也是 Python 指导委员会的成员)撰写的 [PEP 404][9] 详细说明了 Python 2.8 永远不会面世的原因。
|
||||
|
||||
### 有人还在支持 Python 2 吗?
|
||||
|
||||
提供者和供应商对 Python 2 的支持会有所不同。[Google Cloud 宣布了][11]它计划未来如何支持 Python 2。红帽还[宣布了红帽企业 Linux(RHEL)的计划][12],而 AWS 宣布了 AWS 命令行界面和 [SDK][14] 的[次要版本更新要求][13]。
|
||||
|
||||
你还可以阅读 [Vicki Boykis][16] 在 Stack Overflow 撰写的博客文章“[为什么迁移到 Python 3 需要这么长时间?][15]”,其中她指出了采用 Python 3 缓慢的三个原因。
|
||||
|
||||
### 使用 Python 3 的原因
|
||||
|
||||
不管是否有持续的支持,尽快迁移到 Python 3 是一个好主意。Python 3 将继续受到支持,它具有 Python 2 所没有的一些非常优雅的东西。
|
||||
|
||||
最近发布的 [Python 3.8][17] 包含 [海象运算符][19]、[位置参数][20]和[自描述的格式化字符串][21]等[功能][18]。Python 3 的早期版本引入的[功能][22],例如 [异步 IO][23]、[格式化字符串][24]、[类型提示][25] 和 [pathlib][26],这里只提及了一点点。
|
||||
|
||||
下载最多的前 360 个软件包[已迁移到 Python 3][27]。你可以使用 [caniusepython3][28] 软件包检查你的 `requirements.txt` 文件,以查看你依赖的任何软件包是否尚未迁移。
|
||||
|
||||
### 将 Python 2 移植到 Python 3 的参考资源
|
||||
|
||||
有许多参考资源可简化你向 Python 3 的迁移。例如,“[将 Python 2 移植到 Python 3 指南][29]”列出了许多工具和技巧,可帮助你实现与 Python 2/3 单一源代码的兼容性。在 [Python3statement.org][30] 上也有一些有用的技巧。
|
||||
|
||||
[Dustin Ingram][31] 和 [Chris Wilcox][32] 在 [Cloud Next '19][33]上作了一个演讲,详细介绍了向 Python 3 过渡的一些动机和迁移模式。[Trey Hunner][34] 在 [PyCon 2018 演讲][35]上介绍了 Python 3 最有用的功能,鼓励你进行迁移,以便你可以利用它们。
|
||||
|
||||
### 加入我们!
|
||||
|
||||
距 2020 年 1 月 1 日仅有几周了。如果你需要每天提醒一下它即将到来的时间(并且你使用 Twitter 的话),请关注 [Python 2 日落倒计时][36] Twitter 机器人。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/end-of-life-python-2
|
||||
|
||||
作者:[Katie McLaughlin][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/glasnt
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/govt_a%20new%20dawn.png?itok=b4zU-VAY (A sunrise)
|
||||
[2]: https://www.python.org/dev/peps/pep-0373/#maintenance-releases
|
||||
[3]: https://github.com/python/peps/commit/a733bc927acbca16bfa3de486fb2c7d3f767a748
|
||||
[4]: https://www.python.org/dev/peps/pep-3000/#compatibility-and-transition
|
||||
[5]: https://github.com/python/peps/commit/f82462002b86feff36215b4230be28967039b0cc
|
||||
[6]: https://www.python.org/doc/sunset-python-2/
|
||||
[7]: https://twitter.com/ncoghlan_dev
|
||||
[8]: http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html
|
||||
[9]: https://www.python.org/dev/peps/pep-0404/
|
||||
[10]: https://twitter.com/pumpichank
|
||||
[11]: https://cloud.google.com/python/docs/python2-sunset/?utm_source=osdc&utm_medium=blog&utm_campaign=pysunset
|
||||
[12]: https://access.redhat.com/solutions/4455511
|
||||
[13]: https://aws.amazon.com/blogs/developer/deprecation-of-python-2-6-and-python-3-3-in-botocore-boto3-and-the-aws-cli/
|
||||
[14]: https://aws.amazon.com/sdk-for-python/
|
||||
[15]: https://stackoverflow.blog/2019/11/14/why-is-the-migration-to-python-3-taking-so-long/
|
||||
[16]: https://twitter.com/vboykis
|
||||
[17]: https://www.python.org/downloads/
|
||||
[18]: https://docs.python.org/3.8/whatsnew/3.8.html
|
||||
[19]: https://docs.python.org/3.8/whatsnew/3.8.html#assignment-expressions
|
||||
[20]: https://docs.python.org/3.8/whatsnew/3.8.html#positional-only-parameters
|
||||
[21]: https://docs.python.org/3.8/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging
|
||||
[22]: https://docs.python.org/3.8/whatsnew/index.html
|
||||
[23]: https://docs.python.org/3.8/library/asyncio.html#module-asyncio
|
||||
[24]: https://docs.python.org/3.7/whatsnew/3.6.html#pep-498-formatted-string-literals
|
||||
[25]: https://docs.python.org/3.7/whatsnew/3.5.html#pep-484-type-hints
|
||||
[26]: https://docs.python.org/3.8/library/pathlib.html#module-pathlib
|
||||
[27]: http://py3readiness.org/
|
||||
[28]: https://pypi.org/project/caniusepython3/
|
||||
[29]: https://docs.python.org/3/howto/pyporting.html
|
||||
[30]: https://python3statement.org/practicalities/
|
||||
[31]: https://twitter.com/di_codes
|
||||
[32]: https://twitter.com/chriswilcox47
|
||||
[33]: https://www.youtube.com/watch?v=Bye7Rms0Vgw&utm_source=osdc&utm_medium=blog&utm_campaign=pysunset
|
||||
[34]: https://twitter.com/treyhunner
|
||||
[35]: https://www.youtube.com/watch?v=klaGx9Q_SOA
|
||||
[36]: https://twitter.com/python2sunset
|
@ -0,0 +1,200 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11633-1.html)
|
||||
[#]: subject: (How to Install Ansible (Automation Tool) on CentOS 8/RHEL 8)
|
||||
[#]: via: (https://www.linuxtechi.com/install-ansible-centos-8-rhel-8/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
如何在 CentOS 8/RHEL 8 上安装 Ansible(自动化工具)
|
||||
======
|
||||
|
||||
Ansible 是给 Linux 系统管理员使用的出色自动化工具。它是一种开源配置工具,能让系统管理员可以从一个中心节点(即 Ansible 服务器)管理数百台服务器。将 Ansible 与 Puppet、Chef 和 Salt 等类似工具进行比较时,它是首选的配置工具,因为它不需要任何代理,并且可以工作在 SSH 和 python 上。
|
||||
|
||||

|
||||
|
||||
在本教程中,我们将学习如何在 CentOS 8 和 RHEL 8 系统上安装和使用 Ansble。
|
||||
|
||||
Ansible 实验环境信息:
|
||||
|
||||
* 最小化安装的 CentOS 8 / RHEL 8 服务器(192.168.1.10),且有互联网连接
|
||||
* 两个 Ansible 节点 - Ubuntu 18.04 LTS (192.168.1.20) 和 CentOS 7 (192.168.1.30)
|
||||
|
||||
### CentOS 8 上的 Ansible 安装步骤
|
||||
|
||||
Ansible 包不在 CentOS 8 默认的软件包仓库中。因此,我们需要执行以下命令启用 [EPEL 仓库][3]:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
|
||||
```
|
||||
|
||||
启用 epel 仓库后,执行以下 `dnf` 命令安装 Ansible:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo dnf install ansible
|
||||
```
|
||||
|
||||
上面命令的输出:
|
||||
|
||||
![dnf-install-ansible-centos8][4]
|
||||
|
||||
成功安装 Ansible 后,运行以下命令验证它的版本:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo ansible --version
|
||||
```
|
||||
|
||||
![Ansible-version-CentOS8][5]
|
||||
|
||||
上面的输出确认在 CentOS 8 上安装完成。
|
||||
|
||||
让我们看下 RHEL 8 系统。
|
||||
|
||||
### RHEL 8 上的 Ansible 安装步骤
|
||||
|
||||
如果你有有效的 RHEL 8 订阅,请使用以下订阅管理器命令启用 Ansble 仓库:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo subscription-manager repos --enable ansible-2.8-for-rhel-8-x86_64-rpms
|
||||
```
|
||||
|
||||
启用仓库后,执行以下 `dnf` 命令安装 Ansible:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo dnf install ansible -y
|
||||
```
|
||||
|
||||
安装 Ansible 及其依赖包后,执行以下命令来验证它的版本:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo ansible --version
|
||||
```
|
||||
|
||||
### 在 CentOS 8 / RHEL 8 上通过 pip3 安装 Ansible 的可选方法
|
||||
|
||||
如果你希望使用 `pip`(Python 的包管理器)安装 Ansible,请首先使用以下命令安装 pyhton3 和 python3-pip 包:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo dnf install python3 python3-pip -y
|
||||
```
|
||||
|
||||
安装 python3 后,运行以下命令来验证它的版本:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ python3 -V
|
||||
Python 3.6.8
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
用下面的 `pip3` 命令安装 Ansible:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ pip3 install ansible --user
|
||||
```
|
||||
|
||||
输出:
|
||||
|
||||
![Ansible-Install-pip3-centos8][6]
|
||||
|
||||
上面的输出确认 Ansible 已成功使用 `pip3` 安装。让我们看下如何使用 Ansible。
|
||||
|
||||
### 如何使用 Ansible 自动化工具?
|
||||
|
||||
当我们使用 `yum` 或 `dnf` 命令安装 Ansible 时,它的配置文件、清单文件和角色目录会自动在 `/etc/ansible` 文件夹下创建。
|
||||
|
||||
让我们添加一个名称为 `labservers` 的组,并在 `/etc/ansible/hosts` 文件中给该组添加上述的 Ubuntu 18.04 和 CentOS 7 系统的 IP 地址:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ sudo vi /etc/ansible/hosts
|
||||
…
|
||||
[labservers]
|
||||
192.168.1.20
|
||||
192.168.1.30
|
||||
…
|
||||
```
|
||||
|
||||
保存并退出文件。
|
||||
|
||||
更新清单文件(`/etc/ansible/hosts`)后,将用户的 ssh 公钥放到属于 `labservers` 组的远程系统。
|
||||
|
||||
让我们首先使用 `ssh-keygen` 命令生成本地用户的公钥和私钥:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ssh-keygen
|
||||
```
|
||||
|
||||
现在使用以下命令在 Ansible 服务器及其客户端之间交换公钥:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ssh-copy-id root@linuxtechi
|
||||
[root@linuxtechi ~]$ ssh-copy-id root@linuxtechi
|
||||
```
|
||||
|
||||
现在,让我们尝试几个 Ansible 命令,首先使用 `ping` 模块验证 Ansible 服务器与客户端的连接:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ansible -m ping "labservers"
|
||||
```
|
||||
|
||||
注意: 如果我们没有在上面的命令中指定清单文件,那么它将引用默认主机文件(即 `/etc/ansible/hosts`)。
|
||||
|
||||
输出:
|
||||
|
||||
![ansible-ping-module-centos8][7]
|
||||
|
||||
让我们使用 Ansible shell 命令检查每个客户端的内核版本:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ansible -m command -a "uname -r" "labservers"
|
||||
192.168.1.30 | CHANGED | rc=0 >>
|
||||
4.15.0-20-generic
|
||||
192.168.1.20 | CHANGED | rc=0 >>
|
||||
3.10.0-327.el7.x86_64
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
使用以下命令列出清单文件中的所有主机:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]$ ansible all -i /etc/ansible/hosts --list-hosts
|
||||
hosts (4):
|
||||
192.168.100.1
|
||||
192.168.100.10
|
||||
192.168.1.20
|
||||
192.168.1.30
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
使用以下 Ansible 命令仅列出 `labservers` 组中的主机:
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ ansible labservers -i /etc/ansible/hosts --list-hosts
|
||||
hosts (2):
|
||||
192.168.1.20
|
||||
192.168.1.30
|
||||
[root@linuxtechi ~]$
|
||||
```
|
||||
|
||||
本文就是这些了,我们成功演示了如何在 CentOS 8 和 RHEL 8 系统中安装和使用 Ansible。请分享你的反馈和意见。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/install-ansible-centos-8-rhel-8/
|
||||
|
||||
作者:[Pradeep Kumar][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.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[2]: http://www.linuxtechi.com/wp-content/uploads/2019/11/Install-Ansible-CentOS8-RHEL8.png
|
||||
[3]: http://www.linuxtechi.com/enable-epel-repo-centos8-rhel8-server/
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/11/dnf-install-ansible-centos8-1536x652.png
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Ansible-version-CentOS8.png
|
||||
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Ansible-Install-pip3-centos8-1536x545.png
|
||||
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/11/ansible-ping-module-centos8.png
|
@ -1,64 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Kubernetes communication, SRE struggles, and more industry trends)
|
||||
[#]: via: (https://opensource.com/article/19/10/kubernetes-sre-more-industry-trends)
|
||||
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
|
||||
|
||||
Kubernetes communication, SRE struggles, 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.
|
||||
|
||||
## [Review of pod-to-pod communications in Kubernetes][2]
|
||||
|
||||
> In this article, we dive into pod-to-pod communications by showing you ways in which pods within a Kubernetes network can communicate with one another.
|
||||
>
|
||||
> While Kubernetes is opinionated in how containers are deployed and operated, it is very non-prescriptive of how the network should be designed in which pods are to be run. Kubernetes imposes the following fundamental requirements on any networking implementation (barring any intentional network segmentation policies)
|
||||
|
||||
**The impact**: Networking is one of the most complicated parts of making computers work together to solve our problems. Kubernetes turns that complexity up to 11, and this article dials it back down to 10.75.
|
||||
|
||||
## [One SRE's struggle and success to improve Infrastructure as Code][3]
|
||||
|
||||
> Convergence is our goal because we expect our infrastructure to reach a desired state over time expressed in the code. Software idempotence means software can run as many times as it wants and unintended changes don’t happen. As a result, we built an in-house service that runs as specified to apply configurations in source control. Traditionally, we’ve aimed for a masterless configuration design so our configuration agent looks for information on the host.
|
||||
|
||||
**The impact**: I've heard it said that the [human element][4] is the most important element of any digital transformation. While I don't know that the author would use that term to describe the outcome he was after, he does a great job of showing that it is not automation for automation's sake we want but rather automation that makes a meaningful impact on the lives of the people it supports.
|
||||
|
||||
## [Why GitHub is the gold standard for developer-focused companies][5]
|
||||
|
||||
> Now, with last year’s purchase by Microsoft supporting them, it is clear that GitHub has a real opportunity to continue building out a robust ecosystem, with billion dollar companies built upon what could turn into a powerful platform. Is GitHub the next ecosystem success story? In a word, yes. At my company, we bet on GitHub as a successful platform to build upon from the very start. We felt it was the place to build our solution if we wanted to streamline project management and keep software teams close to the code.
|
||||
|
||||
**The impact**: It is one of the great ironies of open source that the most popular tool for open source development is not itself open source. The only way this works is if that tool is so good that open source developers are willing to overlook that inconsistency.
|
||||
|
||||
## [KubeVirt joins Cloud Native Computing Foundation][6]
|
||||
|
||||
> This month the Cloud Native Computing Foundation (CNCF) formally adopted [KubeVirt][7] into the CNCF Sandbox. KubeVirt allows you to provision, manage and run virtual machines from and within Kubernetes. In joining the CNCF Sandbox, KubeVirt now has a more substantial platform to grow as well as educate the CNCF community on the use cases for placing virtual machines within Kubernetes. The CNCF onboards projects into the CNCF Sandbox when they warrant experimentation on neutral ground to promote and foster collaborative development.
|
||||
|
||||
**The impact**: The convergence of containers and virtual machines is clearly a direction vendors think is valuable. Moving this project to the CNCF gives a way to see whether this idea is going to be as popular with users and customers as vendors hope it will be.
|
||||
|
||||
_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/kubernetes-sre-more-industry-trends
|
||||
|
||||
作者:[Tim Hildred][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/thildred
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
|
||||
[2]: https://superuser.openstack.org/articles/review-of-pod-to-pod-communications-in-kubernetes/
|
||||
[3]: https://thenewstack.io/one-sres-struggle-and-success-to-improve-infrastructure-as-code/
|
||||
[4]: https://devops.com/the-secret-to-digital-transformation-is-human-connection/
|
||||
[5]: https://thenextweb.com/podium/2019/10/02/why-github-is-the-gold-standard-for-developer-focused-companies/
|
||||
[6]: https://blog.openshift.com/kubevirt-joins-cloud-native-computing-foundation/
|
||||
[7]: https://kubevirt.io/
|
@ -1,103 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (System76 will ship Coreboot-powered firmware, a new OS for the apocalypse, and more open source news)
|
||||
[#]: via: (https://opensource.com/article/19/10/news-october-13)
|
||||
[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo)
|
||||
|
||||
System76 will ship Coreboot-powered firmware, a new OS for the apocalypse, and more open source news
|
||||
======
|
||||
Catch up on the biggest open source headlines from the past two weeks.
|
||||
![Weekly news roundup with TV][1]
|
||||
|
||||
In this edition of our open source news roundup, we cover System76 shipping Coreboot-powered firmware, a new OS for the apocalypse, and more open source news!
|
||||
|
||||
### System76 will ship 2 Linux laptops with Coreboot-powered open source firmware
|
||||
|
||||
The Denver-based Linux PC manufacturer announced plans to start shipping two laptop models with its Coreboot-powered open source firmware later this month. Jason Evangelho, Senior Contributor at _Forbes_, cited this move as a march towards offering open source software and hardware from the ground up.
|
||||
|
||||
System76, which also develops [Pop OS][2], is now taking pre-orders for its Galago Pro and Darter Pro laptops. It claims that Coreboot will let users boot from power off to the desktop 29% faster.
|
||||
|
||||
Coreboot is a lightweight firmware designed to simplify the boot cycle of systems using it. It requires the minimum number of tasks needed to load and run a modern 32-bit or 64-bit operating system. Coreboot can offer a replacement for proprietary firmware, though it omits features like execution environments. Our own [Don Watkins][3] asked if Coreboot will ship on other System76 machines. Their response, [as reported by _Forbes_][4]:
|
||||
|
||||
> _"Yes. Long term, System76 is working to open source all aspects of the computer. Thelio Io, the controller board in the Thelio desktop, is both open hardware and open firmware. This is a long journey but we're picking up speed. It's been less than a year since the our open hardware Thelio desktop was released and we're now producing two laptops with System76 Open Firmware."_
|
||||
|
||||
### Collapse OS is an operating system for the post-apocalypse
|
||||
|
||||
Virgil Dupras, a software developer based in Quebec, is convinced the world's global supply chain will collapse before 2030. And he's worried that most [electronics will get caught in the crosshairs][5] due to "a very complex supply chain that we won't be able to achieve again for decades (ever?)."
|
||||
|
||||
To prepare for the worst, Dupras built Collapse OS. It's [designed to run][6] on "minimal or improvised machines" and perform simple tasks that are helpful in a post-apocalyptic society. These include editing text files, collecting sources files for MCUs and CPUs, and reading/writing from several storage devices.
|
||||
|
||||
Dupras says it's intended for worst-case scenarios, and that a "weak collapse" might not be enough to justify its use. If you err on the side of caution, the Collapse OS project is accepting new contributors [on GitHub][7].
|
||||
|
||||
Per the project website, Dupras says his goal is for Collapse OS to be as self-contained as possible with the ability for users to install the OS without Internet access or other resources. Ideally, the goal is for Collapse OS to not be used at all.
|
||||
|
||||
### ExpressionEngine will stay open source post-acquisition
|
||||
|
||||
The team behind open source CMS ExpressEngine was acquired by Packet Tide - EEHarbor's parent company - in early October. [This announcement ][8]comes one year after Digital Locations acquired EllisLab, which develops EE core.
|
||||
|
||||
[In an announcement][9] on ExpressionEngine's website, EllisLab founder Rick Ellis said Digital Locations wasn't a good fit for ExpressionEngine. Citing Digital Location's goals to build an AI business, Ellis realized several months ago that ExpressionEngine needed a new home:
|
||||
|
||||
> _"We decided that what was best for ExpressionEngine was to seek a new owner, one that could devote all the resources necessary for ExpressionEngine to flourish. Our top candidate was Packet Tide due to their development capability, extensive catalog of add-ons, and deep roots in the ExpressionEngine community._
|
||||
>
|
||||
> _We are thrilled that they immediately expressed enthusiastic interest in becoming the caretakers of ExpressionEngine."_
|
||||
|
||||
Ellis says Packet Tide's first goal is to finish building ExpressionEngine 6.0, which will have a new control panel with a dark theme (who doesn't love dark mode?). ExpressionEngine adopted the Apache License Version 2.0 in November 2018, after 16 years as a proprietary tool.
|
||||
|
||||
The tool is still marketed as an open source CMS, and EE Harbor developer Tom Jaeger said [in the EE Slack][10] that their plan is to keep ExpressionEngine open source now. But he also left the door open to possible changes.
|
||||
|
||||
### McAfee and IBM Security to lead the Open Source Cybersecurity Alliance
|
||||
|
||||
The two tech giants will contribute the initiative's first open source code and content, under guidance from the OASIS consortium. The Alliance aims to share best practices, tech stacks, and security solutions in an open source platform.
|
||||
|
||||
Carol Geyer, chief development officer of OASIS, said the lack of standard language makes it hard for businesses to share data between tools and products. Despite efforts to collaborate, the lack of a standardized format yields more integration costs that are expensive and time-consuming.
|
||||
|
||||
In lieu of building connections and integrations, [the Alliance wants members][11] to "develop protocols and standards which enable tools to work together and share information across vendors."
|
||||
|
||||
According to _Tech Republic_, IBM Security will contribute [STIX-Shifter][12], an open source library that offer a universal security system. Meanwhile, McAfee added its [OpenDXL Standard Ontology][13], a cybersecurity messaging format. Other members of the Alliance include CrowdStrike, CyberArk, and SafeBreach.
|
||||
|
||||
#### In other news
|
||||
|
||||
* [Paris uses open source to get closer to the citizen][14]
|
||||
* [SD Times open source project of the week: ABAP SDK for IBM Watson][15]
|
||||
* [Google's keeping Knative development under its thumb 'for the foreseeable future'][16]
|
||||
* [Devs engage in soul-searching on future of open source][17]
|
||||
* [Why leading Formula 1 teams back 'copycat' open source design idea][18]
|
||||
|
||||
|
||||
|
||||
_Thanks, as always, to Opensource.com staff members and moderators for their help this week._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/news-october-13
|
||||
|
||||
作者:[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/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV)
|
||||
[2]: https://system76.com/pop
|
||||
[3]: https://opensource.com/users/don-watkins
|
||||
[4]: https://www.forbes.com/sites/jasonevangelho/2019/10/10/system76-will-begin-shipping-2-linux-laptops-with-coreboot-based-open-source-firmware/#15a4da174e64
|
||||
[5]: https://collapseos.org/why.html
|
||||
[6]: https://www.digitaltrends.com/cool-tech/collapse-os-after-societys-collapse/
|
||||
[7]: https://github.com/hsoft/collapseos
|
||||
[8]: https://wptavern.com/expressionengine-under-new-ownership-will-remain-open-source-for-now
|
||||
[9]: https://expressionengine.com/blog/expressionengine-has-a-new-owner
|
||||
[10]: https://eecms.slack.com/?redir=%2Farchives%2FC04CUNNR9%2Fp1570576465005500
|
||||
[11]: https://www.techrepublic.com/article/mcafee-ibm-join-forces-for-global-open-source-cybersecurity-initiative/
|
||||
[12]: https://github.com/opencybersecurityalliance/stix-shifter
|
||||
[13]: https://www.opendxl.com/
|
||||
[14]: https://www.smartcitiesworld.net/special-reports/special-reports/paris-uses-open-source-to-get-closer-to-the-citizen
|
||||
[15]: https://sdtimes.com/os/sd-times-open-source-project-of-the-week-abap-sdk-for-ibm-watson/
|
||||
[16]: https://www.datacenterknowledge.com/google-alphabet/googles-keeping-knative-development-under-its-thumb-foreseeable-future
|
||||
[17]: https://www.linuxinsider.com/story/86282.html
|
||||
[18]: https://www.autosport.com/f1/news/146407/why-leading-f1-teams-back-copycat-design-proposal
|
@ -1,68 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Cisco issues critical security warning for IOS XE REST API container)
|
||||
[#]: via: (https://www.networkworld.com/article/3447558/cisco-issues-critical-security-warning-for-ios-xe-rest-api-container.html)
|
||||
[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/)
|
||||
|
||||
Cisco issues critical security warning for IOS XE REST API container
|
||||
======
|
||||
This Cisco IOS XE REST API vulnerability could lead to attackers obtaining the token-id of an authenticated user.
|
||||
D3Damon / Getty Images
|
||||
|
||||
Cisco this week said it issued a software update to address a vulnerability in its [Cisco REST API virtual service container for Cisco IOS XE][1] software that scored a critical 10 out of 10 on the Common Vulnerability Scoring System (CVSS) system.
|
||||
|
||||
With the vulnerability an attacker could submit malicious HTTP requests to the targeted device and if successful, obtain the _token-id_ of an authenticated user. This _token-id_ could be used to bypass authentication and execute privileged actions through the interface of the REST API virtual service container on the affected Cisco IOS XE device, the company said.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][2]
|
||||
|
||||
According to Cisco the REST API is an application that runs in a virtual services container. A virtual services container is a virtualized environment on a device and is delivered as an open virtual application (OVA). The OVA package has to be installed and enabled on a device through the device virtualization manager (VMAN) CLI.
|
||||
|
||||
**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][3] ]**
|
||||
|
||||
The Cisco REST API provides a set of RESTful APIs as an alternative method to the Cisco IOS XE CLI to provision selected functions on Cisco devices.
|
||||
|
||||
Cisco said the vulnerability can be exploited under the following conditions:
|
||||
|
||||
* The device runs an affected Cisco IOS XE Software release.
|
||||
* The device has installed and enabled an affected version of the Cisco REST API virtual service container.
|
||||
* An authorized user with administrator credentials (level 15) is authenticated to the REST API interface.
|
||||
|
||||
|
||||
|
||||
The REST API interface is not enabled by default. To be vulnerable, the virtual services container must be installed and activated. Deleting the OVA package from the device storage memory removes the attack vector. If the Cisco REST API virtual service container is not enabled, this operation will not impact the device's normal operating conditions, Cisco stated.
|
||||
|
||||
This vulnerability affects Cisco devices that are configured to use a vulnerable version of Cisco REST API virtual service container. This vulnerability affected the following products:
|
||||
|
||||
* Cisco 4000 Series Integrated Services Routers
|
||||
* Cisco ASR 1000 Series Aggregation Services Routers
|
||||
* Cisco Cloud Services Router 1000V Series
|
||||
* Cisco Integrated Services Virtual Router
|
||||
|
||||
|
||||
|
||||
Cisco said it has [released a fixed version of the REST API][4] virtual service container and a hardened IOS XE release that prevents installation or activation of a vulnerable container on a device. If the device was already configured with an active vulnerable container, the IOS XE software upgrade will deactivate the container, making the device not vulnerable. In that case, to restore the REST API functionality, customers should upgrade the Cisco REST API virtual service container to a fixed software release, the company said.
|
||||
|
||||
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3447558/cisco-issues-critical-security-warning-for-ios-xe-rest-api-container.html
|
||||
|
||||
作者:[Michael Cooney][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/Michael-Cooney/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190828-iosxe-rest-auth-bypass
|
||||
[2]: https://www.networkworld.com/newsletters/signup.html
|
||||
[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr
|
||||
[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html
|
||||
[5]: https://www.facebook.com/NetworkWorld/
|
||||
[6]: https://www.linkedin.com/company/network-world
|
@ -1,78 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Netflix builds a Jupyter Lab alternative, a bug bounty to fight election hacking, Raspberry Pi goes microscopic, and more open source news)
|
||||
[#]: via: (https://opensource.com/article/19/10/news-october-26)
|
||||
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
|
||||
|
||||
Netflix builds a Jupyter Lab alternative, a bug bounty to fight election hacking, Raspberry Pi goes microscopic, and more open source news
|
||||
======
|
||||
Catch up on the biggest open source headlines from the past two weeks.
|
||||
![Weekly news roundup with TV][1]
|
||||
|
||||
In this edition of our open source news roundup, we take a look at a machine learning tool from Netflix, Microsoft's election software bug bounty, a cost-effective microscope built with Raspberry Pi, and more!
|
||||
|
||||
### Netflix release Polynote machine learning tool
|
||||
|
||||
While there have been numerous advances in machine learning over the last decade, it's still a difficult, laborious, and sometimes frustrating task. To help make that task easier, Netflix has [released a machine learning notebook environment][2] called Polynote as open source.
|
||||
|
||||
Polynote enables "data scientists and AI researchers to integrate Netflix’s JVM-based machine learning framework with Python machine learning and visualization libraries". What make Polynote unique is its reproducibility feature, which "takes cells’ positions in the notebook into account before executing them, helping prevent bad practices that make notebooks difficult to rerun from the top." It's also quite flexible—Polynote works with Apache Spark and supports languages like Python, Scala, and SQL.
|
||||
|
||||
You can grab Polynote [off GitHub][3] or learn more about it at the Polynote website.
|
||||
|
||||
### Microsoft announces bug bounty program for its election software
|
||||
|
||||
Hoping that more eyeballs on its code will make bugs shallow, Microsoft announced a [a bug bounty][4] for its open source ElectionGuard software development kit for voting machines. The goal of the program is to "uncover vulnerabilities and help bolster election security."
|
||||
|
||||
The bounty is open to "security professionals, part-time hobbyists, and students." Successful submissions, which must include proofs of concept demonstrating how bugs could compromise the security of voters, are worth up to $15,000 (USD).
|
||||
|
||||
If you're interested in participating, you can find ElectionGuard's code on [GitHub][5], and read more about the [bug bounty][6].
|
||||
|
||||
### microscoPI: a microscope built on Raspberry Pi
|
||||
|
||||
It's not a stretch to say that the Raspberry Pi is one of the most flexible platforms for hardware and software hackers. Micropalaeontologist Martin Tetard saw the potential of the tiny computers in his field of study and [create the microscoPI][7].
|
||||
|
||||
The microscoPI is a Raspberry Pi-assisted microscope that can "capture, process, and store images and image analysis results." Using an old adjustable microscope with a movable stage as a base, Tetard added a Raspberry Pi B, a Raspberry Pi camera module, and a small touchscreen to the device. The result is a compact rig that's "completely portable and measuring less than 30 cm (12 inches) in height." The entire setup cost him €159 (about $177 USD).
|
||||
|
||||
Tetard has set up [a website][8] for the microscoPI, where you can learn more about it.
|
||||
|
||||
#### In other news
|
||||
|
||||
* [Happy 15th birthday, Ubuntu][9]
|
||||
* [Open-Source Arm Puts Robotics Within Reach][10]
|
||||
* [Apache Rya matures open source triple store database][11]
|
||||
* [UNICEF Launches Cryptocurrency Fund to Back Open Source Technology][12]
|
||||
* [Open-source Delta Lake project moves to the Linux Foundation][13]
|
||||
|
||||
|
||||
|
||||
_Thanks, as always, to Opensource.com staff members and moderators for their help this week._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/news-october-26
|
||||
|
||||
作者:[Scott Nesbitt][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/scottnesbitt
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV)
|
||||
[2]: https://venturebeat.com/2019/10/23/netflix-open-sources-polynote-to-simplify-data-science-and-machine-learning-workflows/
|
||||
[3]: https://github.com/polynote/polynote
|
||||
[4]: https://thenextweb.com/security/2019/10/21/microsofts-open-source-election-software-now-has-a-bug-bounty-program/
|
||||
[5]: https://github.com/microsoft/ElectionGuard-SDK
|
||||
[6]: https://www.microsoft.com/en-us/msrc/bounty
|
||||
[7]: https://www.geeky-gadgets.com/raspberry-pi-microscope-07-10-2019/
|
||||
[8]: https://microscopiproject.wordpress.com/
|
||||
[9]: https://www.omgubuntu.co.uk/2019/10/happy-birthday-ubuntu-2019
|
||||
[10]: https://hackaday.com/2019/10/17/open-source-arm-puts-robotics-within-reach/
|
||||
[11]: https://searchdatamanagement.techtarget.com/news/252472464/Apache-Rya-matures-open-source-triple-store-database
|
||||
[12]: https://www.coindesk.com/unicef-launches-cryptocurrency-fund-to-back-open-source-technology
|
||||
[13]: https://siliconangle.com/2019/10/16/open-source-delta-lake-project-moves-linux-foundation/
|
@ -1,70 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Hypervisor comeback, Linus says no and reads email, and more industry trends)
|
||||
[#]: via: (https://opensource.com/article/19/11/hypervisor-stable-kernel-and-more-industry-trends)
|
||||
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
|
||||
|
||||
Hypervisor comeback, Linus says no and reads email, 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.
|
||||
|
||||
## [Containers in 2019: They're calling it a [hypervisor] comeback][2]
|
||||
|
||||
> So what does all this mean as we continue with rapid adoption and hyper-ecosystem growth around Kubernetes and containers? Let’s try and break that down into a few key areas and see what all the excitement is about.
|
||||
|
||||
**The impact**: I'm pretty sure that the title of the article is an LL Cool J reference, which I wholeheartedly approve of. Even more important though is a robust unpacking of developments in the hypervisor space over the last year and how they square up against the trend towards cloud-native and container-based development.
|
||||
|
||||
## [Linux kernel is getting more reliable, says Linus Torvalds. Plus: What do you need to do to be him?][3]
|
||||
|
||||
> "In the end my job is to say no. Somebody has to be able to say no, because other developers know that if they do something bad I will say no. They hopefully in turn are more careful. But in order to be able to say no, I have to know the background, because otherwise I can't do my job. I spend all my time basically reading email about what people are working on.
|
||||
|
||||
**The impact**: The rehabilitation of Linus as a much chiller guy continues; this one has some good advice for people leading distributed teams.
|
||||
|
||||
## [Automated infrastructure in the on-premise datacenter—OpenShift 4.2 on OpenStack 15 (Stein)][4]
|
||||
|
||||
> Up until now IPI (Installer Provision Infrastructure) has only supported public clouds: AWS, Azure, and Google. Now with OpenShift 4.2 it is supporting OpenStack. For the first time we can bring IPI into the on-premise datacenter where it is IMHO most needed. This single feature has the potential to revolutionize on-premise environments and bring them into the cloud-age with a single click and that promise is truly something to get excited about!
|
||||
|
||||
**The impact**: So much tech press has started with the assumption that every company should run their infrastructure like a hyperscaler. The technology is catching up to make the user experience of that feasible.
|
||||
|
||||
## [Kubernetes autoscaling 101: Cluster autoscaler, horizontal autoscaler, and vertical pod autoscaler][5]
|
||||
|
||||
> I’m providing in this post a high-level overview of different scalability mechanisms inside Kubernetes and best ways to make them serve your needs. Remember, to truly master Kubernetes, you need to master different ways to manage the scale of cluster resources, that’s [the core of promise of Kubernetes][6].
|
||||
>
|
||||
> _Configuring Kubernetes clusters to balance resources and performance can be challenging, and requires expert knowledge of the inner workings of Kubernetes. Just because your app or services’ workload isn’t constant, it rather fluctuates throughout the day if not the hour. Think of it as a journey and ongoing process._
|
||||
|
||||
**The impact**: You can tell whether someone knows what they're talking about if they can represent it in a simple diagram. Thanks to the excellent diagrams in this post, I know more day 2 concerns of Kubernetes operators than I ever wanted to.
|
||||
|
||||
## [GitHub: All open source developers anywhere are welcome][7]
|
||||
|
||||
> Eighty percent of all open-source contributions today, come from outside of the US. The top two markets for open source development outside of the US are China and India. These markets, although we have millions of developers in them, are continuing to grow faster than any others at about 30% year-over-year average.
|
||||
|
||||
**The impact**: One of my open source friends likes to muse on the changing culture within the open source community. He posits that the old guard gatekeepers are already becoming irrelevant. I don't know if I completely agree, but I think you can look at the exponentially increasing contributions from places that haven't been on the open source map before and safely speculate that the open source culture of tomorrow will be radically different than that of today.
|
||||
|
||||
_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/hypervisor-stable-kernel-and-more-industry-trends
|
||||
|
||||
作者:[Tim Hildred][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/thildred
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
|
||||
[2]: https://www.infoq.com/articles/containers-hypervisors-2019/
|
||||
[3]: https://www.theregister.co.uk/2019/10/30/linux_kernel_is_getting_more_reliable_says_linus_torvalds/
|
||||
[4]: https://keithtenzer.com/2019/10/29/automated-infrastructure-in-the-on-premise-datacenter-openshift-4-2-on-openstack-15-stein/
|
||||
[5]: https://www.cncf.io/blog/2019/10/29/kubernetes-autoscaling-101-cluster-autoscaler-horizontal-autoscaler-and-vertical-pod-autoscaler/
|
||||
[6]: https://speakerdeck.com/thockin/everything-you-ever-wanted-to-know-about-resource-scheduling-dot-dot-dot-almost
|
||||
[7]: https://www.zdnet.com/article/github-all-open-source-developers-anywhere-are-welcome/#ftag=RSSbaffb68
|
@ -1,92 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Red Hat announces RHEL 8.1 with predictable release cadence)
|
||||
[#]: via: (https://www.networkworld.com/article/3451367/red-hat-announces-rhel-8-1-with-predictable-release-cadence.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Red Hat announces RHEL 8.1 with predictable release cadence
|
||||
======
|
||||
|
||||
[Clkr / Pixabay][1] [(CC0)][2]
|
||||
|
||||
[Red Hat][3] has just today announced the availability of Red Hat Enterprise Linux (RHEL) 8.1, promising improvements in manageability, security and performance.
|
||||
|
||||
RHEL 8.1 will enhance the company’s open [hybrid-cloud][4] portfolio and continue to provide a consistent user experience between on-premises and public-cloud deployments.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][5]
|
||||
|
||||
RHEL 8.1 is also the first release that will follow what Red Hat is calling its "predictable release cadence". Announced at Red Hat Summit 2019, this means that minor releases will be available every six months. The expectation is that this rhythmic release cycle will make it easier both for customer organizations and other software providers to plan their upgrades.
|
||||
|
||||
[][6]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][6]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
Red Hat Enterprise Linux 8.1 provides product enhancements in many areas.
|
||||
|
||||
### Enhanced automation
|
||||
|
||||
All supported RHEL subscriptions now include access to Red Hat's proactive analytics, **Red Hat Insights**. With more than 1,000 rules for operating RHEL systems whether on-premises or cloud deployments, Red Hat Insights help IT administrators flag potential configuration, security, performance, availability and stability issues before they impact production.
|
||||
|
||||
### New system roles
|
||||
|
||||
RHEL 8.1 streamlines the process for setting up subsystems to handle specific functions such as storage, networking, time synchronization, kdump and SELinux. This expands on the variety of Ansible system roles.
|
||||
|
||||
### Live kernel patching
|
||||
|
||||
RHEL 8.1 adds full support for live kernel patching. This critically important feature allows IT operations teams to deal with ongoing threats without incurring excessive system downtime. Kernel updates can be applied to remediate common vulnerabilities and exposures (CVE) while reducing the need for a system reboot. Additional security enhancements include enhanced CVE remediation, kernel-level memory protection and application whitelisting.
|
||||
|
||||
### Container-centric SELinux profiles
|
||||
|
||||
These profiles allow the creation of more tailored security policies to control how containerized services access host-system resources, making it easier to harden systems against security threats.
|
||||
|
||||
### Enhanced hybrid-cloud application development
|
||||
|
||||
A reliably consistent set of supported development tools is included, among them the latest stable versions of popular open-source tools and languages like golang and .NET Core as well as the ability to power modern data-processing workloads such as Microsoft SQL Server and SAP solutions.
|
||||
|
||||
Red Hat Linux 8.1 is available now for RHEL subscribers via the [Red Hat Customer Portal][7]. Red Hat Developer program members may obtain the latest releases at no cost at the [Red Hat Developer][8] site.
|
||||
|
||||
#### Additional resources
|
||||
|
||||
Here are some links to additional information:
|
||||
|
||||
* More about [Red Hat Enterprise Linux][9]
|
||||
* Get a [RHEL developer subscription][10]
|
||||
* More about the latest features at [Red Hat Insights][11]
|
||||
|
||||
|
||||
|
||||
Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3451367/red-hat-announces-rhel-8-1-with-predictable-release-cadence.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://pixabay.com/vectors/red-hat-fedora-fashion-style-26734/
|
||||
[2]: https://creativecommons.org/publicdomain/zero/1.0/
|
||||
[3]: https://www.networkworld.com/article/3316960/ibm-closes-34b-red-hat-deal-vaults-into-multi-cloud.html
|
||||
[4]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html
|
||||
[5]: https://www.networkworld.com/newsletters/signup.html
|
||||
[6]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[7]: https://access.redhat.com/
|
||||
[8]: https://developer.redhat.com
|
||||
[9]: https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
|
||||
[10]: https://developers.redhat.com/
|
||||
[11]: https://www.redhat.com/en/blog/whats-new-red-hat-insights-november-2019
|
||||
[12]: https://www.facebook.com/NetworkWorld/
|
||||
[13]: https://www.linkedin.com/company/network-world
|
@ -1,57 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (System76 introduces laptops with open source BIOS coreboot)
|
||||
[#]: via: (https://opensource.com/article/19/11/coreboot-system76-laptops)
|
||||
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
|
||||
|
||||
System76 introduces laptops with open source BIOS coreboot
|
||||
======
|
||||
The company answers open hardware fans by revealing two laptops powered
|
||||
with open source firmware coreboot.
|
||||
![Guy on a laptop on a building][1]
|
||||
|
||||
In mid-October, [System76][2] made an exciting announcement for open source hardware fans: It would soon begin shipping two of its laptop models, [Galago Pro][3] and [Darter Pro][4], with the open source BIOS [coreboot][5].
|
||||
|
||||
The coreboot project [says][6] its open source firmware "is a replacement for your BIOS / UEFI with a strong focus on boot speed, security, and flexibility. It is designed to boot your operating system as fast as possible without any compromise to security, with no back doors, and without any cruft from the '80s." Coreboot was previously known as LinuxBIOS, and the engineers who work on coreboot have also contributed to the Linux kernel.
|
||||
|
||||
Most firmware on computers sold today is proprietary, which means even if you are running an open source operating system, you have no access to your machine's BIOS. This is not so with coreboot. Its developers share the improvements they make, rather than keeping them secret from other vendors. Coreboot's source code can be inspected, learned from, and modified, just like any other open source code.
|
||||
|
||||
[Joshua Woolery][7], marketing director at System76, says coreboot differs from a proprietary BIOS in several important ways. "Traditional firmware is closed source and impossible to review and inspect. It's bloated with unnecessary features and unnecessarily complex [ACPI][8] implementations that lead to PCs operating in unpredictable ways. System76 Open Firmware, on the other hand, is lightweight, fast, and cleanly written." This means your computer boots faster and is more secure, he says.
|
||||
|
||||
I asked Joshua about the impact of coreboot on open hardware overall. "The combination of open hardware and open firmware empowers users beyond what's possible when one or the other is proprietary," he says. "Imagine an open hardware controller like [System76's] [Thelio Io][9] without open source firmware. One could read the schematic and write software to control it, but why? With open firmware, the user starts from functioning hardware and software and can expand from there. Open hardware and firmware enable the community to learn from, adapt, and expand on our work, thus moving technology forward as a whole rather than requiring individuals to constantly re-implement what's already been accomplished."
|
||||
|
||||
Joshua says System76 is working to open source all aspects of the computer, and we will see coreboot on other System76 machines. The hardware and firmware in Thelio Io, the controller board in the company's Thelio desktops, are both open. Less than a year after System76 introduced Thelio, the company is now marketing two laptops with open firmware.
|
||||
|
||||
If you would like to see System76's firmware contributions to the coreboot project, visit the code repository on [GitHub][10]. You can also see the schematics for any supported System76 model by sending an [email][11] with the subject line: _Schematics for <MODEL>_. (Bear in mind that the only currently supported models are darp6 and galp4.) Using the coreboot firmware on other devices is not supported and may render them inoperable,
|
||||
|
||||
Coreboot is licensed under the GNU Public License. You can view the [documentation][12] on the project's website and find out how to [contribute][13] to the project on GitHub.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/coreboot-system76-laptops
|
||||
|
||||
作者:[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/computer_code_programming_laptop.jpg?itok=ormv35tV (Guy on a laptop on a building)
|
||||
[2]: https://opensource.com/article/19/5/system76-secret-sauce
|
||||
[3]: https://system76.com/laptops/galago
|
||||
[4]: https://system76.com/laptops/darter
|
||||
[5]: https://www.coreboot.org/
|
||||
[6]: https://www.coreboot.org/users.html
|
||||
[7]: https://www.linkedin.com/in/joshuawoolery
|
||||
[8]: https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface
|
||||
[9]: https://opensource.com/article/18/11/system76-thelio-desktop-computer
|
||||
[10]: https://github.com/system76/firmware-open
|
||||
[11]: mailto:productdev@system76.com
|
||||
[12]: https://doc.coreboot.org/index.html
|
||||
[13]: https://github.com/coreboot/coreboot
|
@ -1,74 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (GitHub report surprises, serverless hotness, and more industry trends)
|
||||
[#]: via: (https://opensource.com/article/19/11/github-report-serverless-hotness-more-industry-trends)
|
||||
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
|
||||
|
||||
GitHub report surprises, serverless hotness, 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.
|
||||
|
||||
## [GitHub tops 40 million developers as Python, data science, machine learning popularity surges][2]
|
||||
|
||||
> In its annual Octoverse report, GitHub, owned by Microsoft, said it had more than 10 million new users, 44 million repositories created and 87 million pull requests in the last 12 months. The report is a good view of open source software and where the community is headed.
|
||||
|
||||
**The impact:** The finding that hit home hardest for me is that "nearly 80% of GitHub users are outside of the US." While an important part of open source history comes from the east and west coasts of America, there is a good chance that the future of the movement will happen elsewhere.
|
||||
|
||||
## [Serverless: Is it the Kubernetes killer?][3]
|
||||
|
||||
> Serverless isn't here to destroy Kubernetes. The cloud infrastructure space race isn't a zero-sum game. Kubernetes is an obvious evolution following OpenStack and can be run successfully inside of it. There will be OpenStack users for a long time to come, and there are also reasons many companies have moved on from there. Serverless is another tool in the belt of forward-thinking development teams. And increasingly, it can be [run on top of Kubernetes][4] (see Knative), enabling you to get the benefits of the simplicity of serverless and the complexity of Kubernetes where it makes sense for both in your stack.
|
||||
|
||||
**The impact:** The moral of the story is that legacy doesn't really go away, it just gets built in and around.
|
||||
|
||||
## [When Quarkus meets Knative serverless workloads][5]
|
||||
|
||||
> Now, let's discuss how developers can use Quarkus to bring Java into serverless, a place where previously, it was unable to go. Quarkus introduces a comprehensive and seamless approach to generating an operating system specific (aka native) executable from your Java code, as you do with languages like Go and C/C++. Environments such as event-driven and serverless, where you need to start a service to react to an event, require a low time-to-first-response, and traditional Java stacks simply cannot provide this. Knative enables developers to run cloud-native applications as serverless containers in seconds and the containers will go down to zero on demand.
|
||||
>
|
||||
> In addition to compiling Java to Knative, Quarkus aims to improve developer productivity. Quarkus works out of the box with popular Java standards, frameworks and libraries like Eclipse MicroProfile, Apache Kafka, RESTEasy, Hibernate, Spring, and many more. Developers familiar with these will feel at home with Quarkus, which should streamline code for the majority of common use cases while providing the flexibility to cover others that come up.
|
||||
|
||||
**The impact:** It's good to start getting specific with how and where the new hotness can be used. The answer, in this case, is "with the other new hotness."
|
||||
|
||||
## [Why you should join the CNCF Meetup Program][6]
|
||||
|
||||
> With the recent changes to Meetup’s [policies][7], we wanted to share a reminder of the benefits of joining the [CNCF Meetup Program][8] and encourage Meetups in the CNCF ecosystem to apply.
|
||||
>
|
||||
> As part of our Meetup Pro membership, CNCF is able to organize a network with an unlimited number of groups on a single account.
|
||||
|
||||
**The impact:** The long term response to this unfortunate fallout from the WeWork debacle is to build a distributed open source Meetup alternative. Thankfully in the meantime, the CNCF has a more pragmatic response.
|
||||
|
||||
## [Introducing your friends to automation (and overcoming their fear)][9]
|
||||
|
||||
> My team and I were in a meeting a little while back with a third party vendor when they asked us what our stance was on automation. My reply was, "We want to automate everything." On top of my reply, my teammates added, "Well, we don’t want to automate ourselves out of a job."
|
||||
|
||||
**The impact:** I've always thought it was a bit cavalier when someone would say, "I think it's my job to automate myself out of a job." There is plenty of circumstances where that is the last measure of success someone would want to be measured by. I'm happy to see this addressed head-on.
|
||||
|
||||
_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/github-report-serverless-hotness-more-industry-trends
|
||||
|
||||
作者:[Tim Hildred][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/thildred
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
|
||||
[2]: https://www.zdnet.com/article/github-tops-40-million-developers-as-python-data-science-machine-learning-popularity-surges/#ftag=RSSbaffb68
|
||||
[3]: https://www.forbes.com/sites/forbestechcouncil/2019/11/04/serverless-is-it-the-kubernetes-killer/#7e6740711f77
|
||||
[4]: https://github.com/knative
|
||||
[5]: https://vmblog.com/archive/2019/10/29/when-quarkus-meets-knative-serverless-workloads.aspx#.XbiN1JNKiuN
|
||||
[6]: https://www.cncf.io/blog/2019/11/01/why-you-should-join-the-cncf-meetup-program/
|
||||
[7]: https://www.meetup.com/lp/paymentchanges?mpId=9038
|
||||
[8]: https://www.meetup.com/pro/cncf
|
||||
[9]: https://www.redhat.com/sysadmin/introducing-automation
|
@ -1,79 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (The Cross-Platform Source Explorer Sourcetrail is Now Open Source)
|
||||
[#]: via: (https://itsfoss.com/sourcetrail/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
The Cross-Platform Source Explorer Sourcetrail is Now Open Source
|
||||
======
|
||||
|
||||
[Sourcetrail][1] is a cross-platform source explorer that lets you visualize the unfamiliar source code by using graph visualization.
|
||||
|
||||
![][2]
|
||||
|
||||
In other words, it makes it easy to understand the structure of source code and how it works (technically) by visually representing them using a graph.
|
||||
|
||||
This is particularly helpful when you join a project and you have to work on existing code written in the past by several developers.
|
||||
|
||||
You can use it with your favorite IDE like Eclipse, IntelliJ IDEA, PyCharm or code editors like Atom, Visual Studio Code, Sublime Text etc. It supports C, C++, Java and Python.
|
||||
|
||||
This old video gives you the introduction to Sourcetrail:
|
||||
|
||||
Even though it was free for non-commercial use, they charged for a commercial license. However, they recently decided to make the whole thing free and open source.
|
||||
|
||||
So, yes, you can find their source code listed on [GitHub][3] now.
|
||||
|
||||
### What Has Changed for Sourcetrail?
|
||||
|
||||
The reason they switched as an open-source solution is that they wanted their tool to be accessible to more developers.
|
||||
|
||||
Their commercial licensing plan was supposed to help them make money – however, it limited the reach of their project.
|
||||
|
||||
In their [announcement post][4], they mentioned their idea of this decision as follows:
|
||||
|
||||
> We have been going back and forth, discussing and testing potential solutions to many of those issues for a long time now. Many of our thoughts revolved around how to make more money and use it to solve those issues. Looking at other companies in the field, it seemed that to make more money, our only option was making our licenses more and more expensive, which in turn would limit our audience to fewer developers. We always dismissed the idea because **we started to make Sourcetrail to benefit as many developers as possible** and not to be a premium product for a few people in a handful of companies.
|
||||
|
||||
Also, they found it tough to provide cross-platform support while trying to reproduce the issues and apply a fix to them, especially for Linux distros. So, making their project open source was an ideal choice.
|
||||
|
||||
To further clarify the situation they also explained why their commercial licensing plan wasn’t working out:
|
||||
|
||||
> Initially we received a couple of public grants that allowed us to launch Sourcetrail publicly. We decided to go down the traditional road of selling software licenses to sustain further development. Of course that meant to keep the code private if we wanted to protect our business…In retrospect, this decision really narrowed down our user base, making it hard for developers to start using Sourcetrail for multiple reasons
|
||||
|
||||
You can find all the details for what they plan for the future in their [announcement post][4].
|
||||
|
||||
### How to get Sourcetrail on Linux?
|
||||
|
||||
You can find and download the latest release of Sourcetrail on its release page on GitHub:
|
||||
|
||||
[Download Sourcetrail][5]
|
||||
|
||||
Extract the downloaded file and you’ll see a Sourcetrail.sh shell script. Run this script with sudo to install Sourcerail.
|
||||
|
||||
You should [read the documentation][6] for the project setup. They also have some [useful tutorial videos on their YouTube channel][7].
|
||||
|
||||
Sourcetrail was free before but now it’s free in the true sense. It’s good to see that the developers have made it open source and now more programmers can use this tool to understand large, shared code base. You may also checkout a slightly similar open source tool [Sourcegraph][8].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/sourcetrail/
|
||||
|
||||
作者:[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.sourcetrail.com/
|
||||
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/sourcetrail-ui.png?ssl=1
|
||||
[3]: https://github.com/CoatiSoftware/Sourcetrail
|
||||
[4]: https://www.sourcetrail.com/blog/open_source/
|
||||
[5]: https://github.com/CoatiSoftware/Sourcetrail/releases
|
||||
[6]: https://www.sourcetrail.com/documentation/#PROJECTSETUP
|
||||
[7]: https://www.youtube.com/channel/UCuKthdG-V4n2RZ1HDJhGVpQ/videos
|
||||
[8]: https://itsfoss.com/sourcegraph/
|
@ -0,0 +1,70 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Nvidia quietly unveils faster, lower power Tesla GPU accelerator)
|
||||
[#]: via: (https://www.networkworld.com/article/3482097/nvidia-quietly-unveils-faster-lower-power-tesla-gpu-accelerator.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Nvidia quietly unveils faster, lower power Tesla GPU accelerator
|
||||
======
|
||||
Nvidia has upgraded its Volta line of Tesla GPU-accelerator cards to work faster using the same power as its old model.
|
||||
client
|
||||
|
||||
Nvidia was all over Supercomputing 19 last week, not surprisingly, and made a lot of news which we will get into later. But overlooked was perhaps the most interesting news of all: a new generation graphics-acceleration card that is faster and way more power efficient.
|
||||
|
||||
Multiple attendees and news sites spotted it at the show, and Nvidia confirmed to me that this is indeed a new card. Nvidia’s “Volta” generation of Tesla GPU-accelerator cards has been out since 2017, so an upgrade was well overdue.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
|
||||
|
||||
The V100S comes only in PCI Express 3 form factor for now but is expected to eventually support Nvidia’s SXM2 interface. SXM is a dual-slot card design by Nvidia that requires no connection to the power supply, unlike the PCIe cards. SXM2 allows the GPU to communicate either with each other or to the CPU through Nvidia’s NVLink, a high-bandwidth, energy-efficient interconnect that can transfer data up to ten times faster than PCIe.
|
||||
|
||||
[][2]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][2]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
With this card, Nvidia is claiming 16.4 single-precision TFLOPS, 8.2 double-precision TFLOPS, and Tensor Core performance of up to 130 TFLOPS. That is only a 4-to-5 percent improvement over the V100 SXM2 design, but 16-to-17 percent faster than the PCIe V100 variant.
|
||||
|
||||
Memory capacity remains at 32GB but Nvidia added High Bandwidth Memory 2 (HBM2) to increase memory performance to 1,134GB/s, a 26 percent improvement over both PCIe and SXM2.
|
||||
|
||||
Now normally a performance boost would see a concurrent increase in power demand, but in this case, the power envelope for the PCIe card is 250 watts, same as the prior generation PCIe card. So this card delivers 16-to-17 percent more compute performance and 26 percent more memory bandwidth at the same power draw.
|
||||
|
||||
**Other News**
|
||||
|
||||
Nvidia made some other news at the conference:
|
||||
|
||||
* A new reference design and ecosystem support for its GPU-accelerated Arm-based reference servers for high-performance computing. The company says it has support from HPE/Cray, Marvell, Fujitsu, and Ampere, the startup led by former Intel executive Renee James looking to build Arm-based server processors.
|
||||
* These companies will use Nvidia's reference design, which consists of hardware and software components, to build their own GPU-accelerated servers for everything from hyperscale cloud providers to high-performance storage and exascale supercomputing. The design also comes with CUDA-X, a special version of Nvidia’s CUDA GPU development language for Arm processors.
|
||||
* Launch of Nvidia Magnum IO suite of software designed to help data scientists and AI and high-performance-computing researchers process massive amounts of data in minutes rather than hours. It is optimized to eliminate storage and I/O bottlenecks to deliver up to 20x faster data processing for multi-server, multi-GPU computing nodes.
|
||||
* Nvidia and DDN, developer of AI and multicloud data management, announced a bundling of DDN’s A3ITM data management system with Nvidia’s DGX SuperPOD systems with so customers can deploy HPC infrastructure with minimal complexity and reduced timelines. The SuperPODs would also come with the new NVIDIA Magnum IO software stack.
|
||||
* DDN said that SuperPOD was able to be deployed within hours and a single appliance could scale all to 80 nodes. Benchmarks over a variety of different deep-learning models showed that the DDN system could keep a DGXSuperPOD system fully saturated with data.
|
||||
|
||||
|
||||
|
||||
**Now see** [**10 of the world's fastest supercomputers**][3]
|
||||
|
||||
Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3482097/nvidia-quietly-unveils-faster-lower-power-tesla-gpu-accelerator.html
|
||||
|
||||
作者:[Andy Patrizio][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/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/newsletters/signup.html
|
||||
[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[3]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html
|
||||
[4]: https://www.facebook.com/NetworkWorld/
|
||||
[5]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,105 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Zorin OS Responds to the Privacy Concerns)
|
||||
[#]: via: (https://itsfoss.com/zorin-os-privacy-concerns/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Zorin OS Responds to the Privacy Concerns
|
||||
======
|
||||
|
||||
_**There were some privacy concerns around ‘data collection’ in Zorin OS. It’s FOSS spoke to Zorin OS CEO and here is his response to the controversy.**_
|
||||
|
||||
After a few days of [Zorin OS 15 Lite][1] release, a Reddit thread surfaced which flagged a privacy concern regarding the Linux distribution.
|
||||
|
||||
The [Reddit thread][2] focuses on the [privacy policy][3] of Zorin OS and warns users that Zorin OS is sending anonymous pings every 60 minutes without users’ consent, which is potentially a privacy issue.
|
||||
|
||||
![][4]
|
||||
|
||||
The policy in question can be quoted here as:
|
||||
|
||||
> _**Anonymous pings**: When using Zorin OS, your computer may occasionally send us a ping which includes an anonymous unique identifier for your computer. We use this information to count the number of active users of Zorin OS. The unique identifier does not identify you unless you (or someone acting on your behalf) discloses it separately. You may choose to disable these pings by uninstalling the “Zorin-os-census” package from your computer_
|
||||
|
||||
Now, there’s a lot of [discussions][5] surrounding the concern. There’s also a [YouTube video][6] talking about it.
|
||||
|
||||
In a nutshell, it’s a mess. Some insist that they collect our IP addresses and some users complain that they should ask about it while installing Zorin OS.
|
||||
|
||||
While I agree that they could add an opt-out option in the installation process – so I reached out to **Artyom Zorin** (_CEO, Zorin Group_) to clarify the situation.
|
||||
|
||||
### Zorin’s Clarification On What They Collect With Every Anonymous Ping
|
||||
|
||||
When I asked for an elaborate explanation of what the “**anonymous unique identifier**” includes, Artyom mentioned – “_It appears that there are some inaccuracies and misconceptions about the census in the comments sections_“.
|
||||
|
||||
To continue the explanation about the unique identifier, he assured that **their servers do not log IP addresses** when a ping arrives.
|
||||
|
||||
The zorin-os-census script **simply counts the number of unique computers using Zorin OS** and no personal data is being collected along with it.
|
||||
|
||||
Artyom explained in detail:
|
||||
|
||||
> The anonymous identifier is a series of letters and numbers which is randomly generated (not based on any external data) and only used for the Zorin OS Census. Its single purpose is to make sure that the computer isn’t double-counted when a ping is sent from a computer to the server. On a fully-installed Zorin OS system, the anonymous identifier can be found in /var/lib/zorin-os-census/uuid and should look like this:_68f2d95b-f51f-4a5d-9b48-a99c28691b89_
|
||||
> *
|
||||
> *We would like to clarify that no personal or personally-identifiable data is being collected by us and the server does not log IP addresses when pings arrive. The zorin-os-census script is only used to count the number of computers and users running Zorin OS after installation. Even I wouldn’t be able to tell which computer is my own from looking at the server-side database. I have attached a screenshot of a snippet of the database table displaying the information we store.
|
||||
|
||||
He also stressed his ‘commitment on privacy’:
|
||||
|
||||
> Privacy is an essential human right. It’s a core tenet of our mission to give you back control of your technology, and not the other way around. We make privacy a priority with every decision we make, and we’re committed to protecting it in every level of the software we build.
|
||||
|
||||
As you can observe in the response above, he shared a screenshot of how their database of unique identifiers looks like:
|
||||
|
||||
![][7]
|
||||
|
||||
If you’re still curious, you can also check out the [source code][8] for the zorin-os-census script.
|
||||
|
||||
### Can We Opt-Out Of It?
|
||||
|
||||
While the data collected may be ‘harmless’, it is important to give the option to the user whether or not they want Zorin OS to collect the data, right?
|
||||
|
||||
So, when I inquired about the same, he mentioned that i**t was already something planned for Zorin OS 15 Lite release**.
|
||||
|
||||
However, they did not want to rush to add it before properly testing it. Hence, they decided to keep it for the upcoming release (**Zorin OS 15.1**) which is planned to arrive in **early-to-mid December this year.**
|
||||
|
||||
> We have in fact been working on implementing an opt-out option for this into the Zorin OS installer (Ubiquity). To ensure the stability and accessibility of this new functionality we’re adding to Ubiquity, we have scheduled a period of time to translate the text strings and rigorously test the software (in order to avoid regressions), as the installer is a critical component of the operating system. Unfortunately, the testing period for the opt-out option didn’t complete before our planned release of Zorin OS 15 Lite, and we, therefore, decided not to risk adding it before we could guarantee its stability. However, we are on track to include the opt-out option in the upcoming Zorin OS 15.1 release, which we plan to release in early-to-mid December.
|
||||
|
||||
### Will It Be Something Similar To What Ubuntu Does?
|
||||
|
||||
Ubuntu does let you opt-out from collecting information about your computer.
|
||||
|
||||
So, when I asked if Zorin OS will add something similar to that, he responded with some details about how Ubuntu collects data and how Zorin OS is different from that.
|
||||
|
||||
He mentioned the fact that Ubuntu comes pre-installed with a **popularity-contest** package that **occasionally sends data of what packages the user has installed** to the Ubuntu Developers.
|
||||
|
||||
And, further clarified that **Zorin OS does not include that**.
|
||||
|
||||
> While Ubuntu’s telemetry tool gives users the option to not send extensive information about the computers to the Ubuntu developers, selecting the “No” option still sends a ping to Ubuntu’s servers .
|
||||
>
|
||||
> From our research, it is not clear whether Ubuntu’s servers store logs of users’ IP addresses when they receive telemetry data. In addition, Zorin OS does not include the “popularity-contest” package that is pre-installed in Ubuntu. This package is designed to occasionally send a list of all packages a user has installed on their computer to the Ubuntu developers.
|
||||
|
||||
**In the end…**
|
||||
|
||||
While the concern regarding the anonymous pings may not seem to a privacy threat, an opt-out option should be presented to the user while installing Zorin OS. Let’s wait and watch if it should arrive in the upcoming Zorin OS 15.1 release.
|
||||
|
||||
What do you think about the privacy concern mentioned above? Let us know your thoughts in the comments down below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/zorin-os-privacy-concerns/
|
||||
|
||||
作者:[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/zorin-os-lite/
|
||||
[2]: https://www.reddit.com/r/FreeAsInFreedom/comments/e0yhw4/beware_zorin_os_sends_anonymous_pings_every_60/
|
||||
[3]: https://zorinos.com/legal/privacy/
|
||||
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/zorin-os-privacy-reddit.jpg?ssl=1
|
||||
[5]: https://www.reddit.com/r/linux/comments/e0zd5n/beware_zorin_os_sends_anonymous_pings_every_60/
|
||||
[6]: https://www.youtube.com/watch?v=bcgk9LvC36Y&feature=youtu.be&t=860
|
||||
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/zorin-census-database.png?ssl=1
|
||||
[8]: https://launchpad.net/~zorinos/+archive/ubuntu/stable/+sourcepub/10183568/+listing-archive-extra
|
@ -0,0 +1,89 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Open Source Music Notations Software MuseScore 3.3 Released!)
|
||||
[#]: via: (https://itsfoss.com/musescore/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Open Source Music Notations Software MuseScore 3.3 Released!
|
||||
======
|
||||
|
||||
_**Brief: MuseScore is an open-source software to help you create, play, and print sheet music. They released a major update recently. So, we take a look at what MuseScore has to offer**_ _**overall.**_
|
||||
|
||||
### MuseScore: A Music Composition and Notation Software
|
||||
|
||||
![][1]
|
||||
|
||||
[MuseScore][2] is open-source software that lets you create, play, and print [sheet music][3].
|
||||
|
||||
You can even use a MIDI keyboard as input and simply play the tune you want to create the notation of.
|
||||
|
||||
In order to make use of it, you need to know how sheet music notations work. In either case, you can just play something using your MIDI keyboard or any other instrument and learn how the music notations work while using it.
|
||||
|
||||
So, it should come in handy for beginners and experts as well.
|
||||
|
||||
You can download and use MuseScore for free. However, if you want to share your music/composition and reach out to a wider community on the MuseScore platform, you can opt to create a free or premium account on [MuseScore.com][4].
|
||||
|
||||
### Features of MuseScore
|
||||
|
||||
![Musescore 3 Screenshot][5]
|
||||
|
||||
MuseScore includes a lot of things that can be highlighted. If you are someone who is not involved in making music notations for your compositions – you might have to dig deeper just like me.
|
||||
|
||||
Usually, I just head over to any [DAW available on Linux][6] and start playing something to record/loop it without needing to create the music notations. So, for me, MuseScore definitely presents a learning curve with all the features offered.
|
||||
|
||||
I’ll just list out the features with some brief descriptions – so you can explore them if it sounds interesting to you.
|
||||
|
||||
* Supports Input via MIDI keyboard
|
||||
* You can transfer to/from other programs via [MusicXML][7], MIDI, and other options.
|
||||
* A Huge collection of palettes (music symbols) to choose from.
|
||||
* You also get the ability to re-arrange the palettes and create your own list of most-used palettes or edit them.
|
||||
* Some plugins supported to extend the functionality
|
||||
* Import PDFs to read and play notations
|
||||
* Several instruments supported
|
||||
* Basic or Advanced layout of palettes to get started
|
||||
|
||||
|
||||
|
||||
Some of the recent key changes include the palettes redesign, accessibility, and the not input workflow. For reference, you can check out how the new palettes work:
|
||||
|
||||
### Installing MuseScore 3.3.3 on Ubuntu/Linux
|
||||
|
||||
The latest version of MuseScore is 3.3.3 with all the bug fixes and improvements to its recent [MuseScore 3.3 release][8].
|
||||
|
||||
You may find an older release in your Software Center (or your official repo). So, you can either opt for a Flatpak package, Snap, or maybe an AppImage from its [download page][9] with links for different Linux distributions.
|
||||
|
||||
[Download MuseScore][9]
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
I was quite fascinated to learn about MuseScore being an open-source and free solution to create, play, and print sheet music.
|
||||
|
||||
It may not be the most easy-to-use software there is – but when considering the work with music notations, it will help you learn more about it and help you with your work as well.
|
||||
|
||||
What do you think about MuseScore? Do share your thoughts in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/musescore/
|
||||
|
||||
作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/musescore-3.jpg?ssl=1
|
||||
[2]: https://musescore.org/en
|
||||
[3]: https://en.wikipedia.org/wiki/Sheet_music
|
||||
[4]: https://musescore.com/
|
||||
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/11/musescore-3-screenshot.jpg?ssl=1
|
||||
[6]: https://itsfoss.com/best-audio-editors-linux/
|
||||
[7]: https://en.wikipedia.org/wiki/MusicXML
|
||||
[8]: https://musescore.org/en/3.3
|
||||
[9]: https://musescore.org/en/download
|
@ -1,3 +1,5 @@
|
||||
translating
|
||||
|
||||
Think global: How to overcome cultural communication challenges
|
||||
======
|
||||
Use these tips to ensure that every member of your global development team feels involved and understood.
|
||||
|
@ -1,161 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (6 signs you might be a Linux user)
|
||||
[#]: via: (https://opensource.com/article/19/10/signs-linux-user)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
6 signs you might be a Linux user
|
||||
======
|
||||
If you're a heavy Linux user, you'll probably recognize these common
|
||||
tendencies.
|
||||
![Tux with binary code background][1]
|
||||
|
||||
Linux users are a diverse bunch, but many of us share a few habits. You might not have any of the telltale signs listed in this article, and if you're a new Linux user, you may not recognize many of them... yet.
|
||||
|
||||
Here are six signs you might be a Linux user.
|
||||
|
||||
### 1\. As far as you know, the world began on January 1, 1970.
|
||||
|
||||
There are many rumors about why a Unix computer clock always sets itself back to 1970-01-01 when it resets. But the mundane truth is that the Unix "epoch" serves as a common and simple reference point for synchronization. For example, Halloween is the 304th day of this year in the Julian calendar, but we commonly refer to the holiday as being "on the 31st". We know which 31st we mean because we have common reference points: We know that Halloween is celebrated in October and that October is the 10th month of the year, and we know how many days each preceding month contains. Without these values, we could use traditional methods of timekeeping, such as phases of the moon, to keep track of special seasonal events, but of course, a computer doesn't have that ability.
|
||||
|
||||
A computer requires firm and clearly defined values, so the value 1970-01-01T00:00:00Z was chosen as the beginning of the Unix epoch. Any time a [POSIX][2] computer loses track of time, a service like the Network Time Protocol (NTP) can provide it the number of seconds since 1970-01-01T00:00:00Z, which the computer can convert to a human-friendly date.
|
||||
|
||||
Date and time are a famously complex thing to track in computing, largely because there are exceptions to nearly standard. A month doesn't always have 30 days, a year doesn't always have 365 days, and even seconds tend to drift a little each year. If you're looking for a fun and frustrating programming exercise, try to program a reliable calendaring application!
|
||||
|
||||
### 2\. You think it's a chore to type anything over two letters to get something done.
|
||||
|
||||
The most common Unix commands are famously short. In addition to commands like **cd** and **ls** and **mv**, there's one command that literally can't get any shorter: **w** (which shows who is currently logged in according to the **/var/run/utmp** file).
|
||||
|
||||
On the one hand, extremely short commands seem unintuitive. A new user probably isn't going to guess that typing **ls** would _list_ directories. Once you learn the commands, though, the shorter they are, the better. If you spend all day in a terminal, the fewer keystrokes you have to type means you can spend more time getting your work done.
|
||||
|
||||
Luckily, single-letter commands are far and few between, which means you can use most letters for aliases. For example, I use Emacs often enough that I consider **emacs** too long to type, so I alias it to **e** by adding this line to my **.bashrc** file:
|
||||
|
||||
|
||||
```
|
||||
`alias e='emacs'`
|
||||
```
|
||||
|
||||
You can also alias commands temporarily. For instance, if you find yourself running [firewall-cmd][3] repeatedly while you troubleshoot a network issue, then you can create an alias just for your current session:
|
||||
|
||||
|
||||
```
|
||||
$ alias f='firewall-cmd'
|
||||
$ f
|
||||
usage: see firewall-cmd man page
|
||||
No option specified.
|
||||
```
|
||||
|
||||
As long as the terminal is open, your alias persists. Once the terminal is closed, it's forgotten.
|
||||
|
||||
### 3\. You think it's a chore to click more than two times to get something done.
|
||||
|
||||
Linux users are fond of efficiency. While not every Linux user is always in a hurry to get things done, there are conventions in Linux desktops that seek to reduce the number of actions required to accomplish any given task. Here are some examples.
|
||||
|
||||
* In the KDE file manager Dolphin, a single click opens a file or directory. It's assumed that if you want to select a file, you can either click and drag or else Ctrl+Click instead. This may confuse users who are used to double-clicking everything, but once you've tried single-click actions, you usually can't go back to laborious double-clicks.
|
||||
* On most Linux desktops, a middle-click pastes the most recent contents of the clipboard.
|
||||
* On many Linux desktops, drag actions can be modified by pressing the Alt, Ctrl, or Shift keys. For instance, Alt+Drag moves a window in KDE, and Ctrl+Drag in GNOME causes a file to be copied instead of moved.
|
||||
|
||||
|
||||
|
||||
### 4\. You've never performed any action on a computer more than three times because you've already automated it by the third time.
|
||||
|
||||
Pardon the hyperbole, but many Linux users expect their computer to work harder than they do. While it takes time to learn how to automate common tasks, it tends to be easier on Linux than on other platforms because the Linux terminal and the Linux operating system are so tightly integrated. The easy things to automate are the actions you already do in a terminal because commands are just strings that you type into an interpreter, and that interpreter (the terminal) doesn't care whether you typed the strings out manually or whether you're just pointing it to a script.
|
||||
|
||||
For instance, if you find yourself frequently moving a set of files from one place to another, then you can probably use the same sequence of instructions as a script, which you can trigger with a single command. Imagine you are doing this manually each morning:
|
||||
|
||||
|
||||
```
|
||||
$ cd Documents
|
||||
$ trash reports-latest.txt
|
||||
$ wget myserver.local/reports/daily/report-latest.txt
|
||||
$ cp report-latest.txt reports_daily/2019-31-10.log
|
||||
```
|
||||
|
||||
It's a simple sequence, but repeating it daily isn't the most efficient way of spending your time. With a little bit of abstraction, you could automate it with a simple script:
|
||||
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
trash $HOME/Documents/reports-latest.txt
|
||||
|
||||
wget myserver.local/reports/daily/report-latest.txt \
|
||||
-P $HOME/Documents/udpates_daily/`date --iso-8601`.log
|
||||
|
||||
cp $HOME/Documents/udpates_daily/`date --iso-8601`.log \
|
||||
$HOME/Documents/reports-latest.txt
|
||||
```
|
||||
|
||||
You could call your script **get-reports.sh** and launch it manually each morning, or you could even enter it into your crontab so that your computer performs the task without requiring any intervention from you.
|
||||
|
||||
This can be confusing for a new user because it's not always obvious what's integrated with what. For instance, if you regularly find yourself opening images and scaling them down by 50%, then you're probably used to doing something like this:
|
||||
|
||||
1. Opening up your photo viewer or editor
|
||||
2. Scaling the image
|
||||
3. Exporting the image as a modified file
|
||||
4. Closing the application
|
||||
|
||||
|
||||
|
||||
If you did this several times a day, you would probably get tired of the repetition. However, because you perform those actions in the graphical user interface (GUI), you would need to know how to script the GUI to automate it. Some applications, like [GIMP][4], have a rich scripting interface, but the process is obviously different than just adapting a bunch of commands and dumping those into a file.
|
||||
|
||||
Then again, sometimes there are command-line equivalents to things you do in a GUI. Converting documents from one text format to another can be done with [Pandoc][5], images can be manipulated with [Image Magick][6], music and video can be edited and converted, and so on. It's a matter of knowing what to look for, and usually learning a new (and sometimes complex) command. Scaling images down, however, is notably simpler in the terminal than in a GUI:
|
||||
|
||||
|
||||
```
|
||||
#!/bin/sh
|
||||
|
||||
convert "${1}" -scale 50% `basename "${1}" .jpg`_50.jpg
|
||||
```
|
||||
|
||||
It's worth investigating those bothersome, repetitious tasks. You never know how simple and fast your work is for a computer to do!
|
||||
|
||||
### 5\. You distro hop
|
||||
|
||||
I'm an ardent Slackware user at home and a RHEL user at work. Actually, that's not true; I'm a Fedora user at work now. Except when I use CentOS. And there was that time I ran [Mageia][7] for a while.
|
||||
|
||||
![Debian on a PowerPC64 box, image CC BY SA Claudio Miranda][8]
|
||||
|
||||
Debian on a PowerPC64 box
|
||||
|
||||
It doesn't matter how great a distribution is; part of the guilty pleasure of being a Linux user is the freedom to be indecisive about which distro you run. At a glance, they're all basically the same, and that's refreshing. But depending on your mood, you might prefer the stability of CentOS to the constant updates of Fedora, or you might truly enjoy the centralized control center of Mageia one day and then frolic in the modularity of raw [Debian][9] configuration files another. And sometimes you turn to an alternate OS altogether.
|
||||
|
||||
![OpenBSD, image CC BY SA Claudio Miranda][10]
|
||||
|
||||
OpenBSD, not a Linux distro
|
||||
|
||||
The point is, Linux distributions are passion projects, and it's fun to be a part of other people's open source passions.
|
||||
|
||||
### 6\. You have a passion for open source.
|
||||
|
||||
Regardless of your experience, if you're a Linux user, you undoubtedly have a passion for open source. Whether you express that on a daily basis through [Creative Commons artwork][11] or code or you sublimate it and just get your work done in a liberating (and liberated) environment, you're living in and building upon open source. It's because of you that there's an open source community, and the community is richer for having you as a member.
|
||||
|
||||
There are lots of things I haven't mentioned. What else betrays you as a Linux user? Let us know in the comments!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/signs-linux-user
|
||||
|
||||
作者:[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/tux_linux_penguin_code_binary.jpg?itok=TxGxW0KY (Tux with binary code background)
|
||||
[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains
|
||||
[3]: https://opensource.com/article/19/7/make-linux-stronger-firewalls
|
||||
[4]: https://www.gimp.org/
|
||||
[5]: https://opensource.com/article/19/5/convert-markdown-to-word-pandoc
|
||||
[6]: https://opensource.com/article/17/8/imagemagick
|
||||
[7]: http://mageia.org
|
||||
[8]: https://opensource.com/sites/default/files/uploads/debian.png (Debian on a PowerPC64 box)
|
||||
[9]: http://debian.org
|
||||
[10]: https://opensource.com/sites/default/files/uploads/openbsd.jpg (OpenBSD)
|
||||
[11]: http://freesvg.org
|
@ -0,0 +1,142 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (8 ways to prepare your data center for AI’s power draw)
|
||||
[#]: via: (https://www.networkworld.com/article/3454626/8-ways-to-prepare-your-data-center-for-ai-s-power-draw.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
8 ways to prepare your data center for AI’s power draw
|
||||
======
|
||||
Artificial intelligence requires greater processor density, which increases the demand for cooling and raises power requirements.
|
||||
Thinkstock
|
||||
|
||||
As artificial intelligence takes off in enterprise settings, so will data center power usage. AI is many things, but power efficient is not one of them.
|
||||
|
||||
For data centers running typical enterprise applications, the average power consumption for a rack is around 7 kW. Yet it’s common for AI applications to use more than 30 kW per rack, according to data center organization [AFCOM][1]. That’s because AI requires much higher processor utilization, and the processors – especially GPUs – are power hungry. Nvidia GPUs, for example, may run several orders of magnitude faster than a CPU, but they also consume twice as much power per chip. Complicating the issue is that many data centers are already power constrained.
|
||||
|
||||
**READ MORE:** [Do you really need high performance computing?][2]
|
||||
|
||||
Cooling is also an issue: AI-oriented servers require greater processor density, which means more chips crammed into the box, and they all run very hot. Greater density, along with higher utilization, increases the demand for cooling as compared to a typical back-office server. Higher cooling requirements in turn raise power demands.
|
||||
|
||||
[][3]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][3]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
So what can you do if you want to embrace AI for competitive reasons but the power capacity of your existing facility isn’t up to the high-density infrastructure requirements of AI? Here are some options.
|
||||
|
||||
### Consider liquid cooling
|
||||
|
||||
Fan cooling typically loses viability once a rack exceeds 15 kW. Water, however, has 3,000 times the heat capacity of air, according to [CoolIT Systems][4], a maker of enterprise liquid cooling products. As a result, server cabinet makers have been adding liquid pipes to their cabinets and connecting water piping to their heat sinks instead of fans.
|
||||
|
||||
“Liquid cooling is definitely a very good option for higher density loads,” says John Sasser, senior vice president for data center operations at [Sabey][5], a developer and operator of data centers. “That removes the messy airflow issue. Water removes a lot more heat than air does, and you can direct it through pipes. A lot of HPC [high performance computing] is done with liquid cooling.”
|
||||
|
||||
Most data centers are set up for air cooling, so liquid cooling will require a capital investment, “but that might be a much more sensible solution for these efforts, especially if a company decides to move in the direction [of AI],” Sasser says.
|
||||
|
||||
### Run AI workloads at lower resolutions
|
||||
|
||||
Existing data centers might be able to handle AI computational workloads but in a reduced fashion, says Steve Conway, senior research vice president for [Hyperion Research][6]. Many, if not most, workloads can be operated at half or quarter precision rather than 64-bit double precision.
|
||||
|
||||
“For some problems, half precision is fine,” Conway says. “Run it at lower resolution, with less data. Or with less science in it.”
|
||||
|
||||
Double-precision floating point calculations are primarily needed in scientific research, which is often done at the molecular level. Double precision is not typically used in AI training or inference on deep learning models because it is not needed. Even Nvidia [advocates][7] for use of single- and half-precision calculations in deep neural networks.
|
||||
|
||||
### Build an AI containment segment
|
||||
|
||||
AI will be a part of your business but not all, and that should be reflected in your data center. “The new facilities that are being built are contemplating allocating some portion of their facilities to higher power usage,” says Doug Hollidge, a partner with [Five 9s Digital][8], which builds and operates data centers. “You’re not going to put all of your facilities to higher density because there are other apps that have lower draw.”
|
||||
|
||||
The first thing to do is assess the energy supply to the building, Hollidge says. “If you are going to increase energy use in the building, you’ve got to make sure the power provider can increase the power supply.”
|
||||
|
||||
Bring in an engineer to assess which portion of the data center is best equipped for higher density capabilities. Workload requirements will determine the best solution, whether it be hot aisle containment or liquid cooling or some other technology. “It’s hard to give one-size-fits-all solution since all data centers are different,” Hollidge says.
|
||||
|
||||
### Spread out your AI systems
|
||||
|
||||
An alternative approach – rather than crowding all your AI systems into one spot hotter than Death Valley in August – is to spread them out among the racks.
|
||||
|
||||
“Most of the apps are not high density. They run at eight to 10 kilowatts and up to 15 kilowatts. You can handle that with air,” says David McCall, chief innovation officer with [QTS][9], a builder of data centers.
|
||||
|
||||
In an optimized heterogeneous environment, a collocation provider might have a rack or two in a cabinet to host an HPC or AI environment, and the rest of the racks in the cabinet are dedicated to hosting less power-hungry applications, such as databases and back-office apps. That won't yield a 5 kW rack, but it gets a rack closer to 12 kW or 15 kW, which is an environment that air cooling can handle, McCall says.
|
||||
|
||||
### Control hot air flow in the data center
|
||||
|
||||
Standard data center layout is hot aisle/cold aisle, where the cabinets are laid out in alternating rows so that cold air intakes face each other on one front-facing aisle, and hot air exhausts face each other on the alternating back-facing aisle. That works fine, but access can be tricky if an IT worker needs to get behind a cabinet to work on a server.
|
||||
|
||||
The other problem is that air is “messy,” as Sasser put it. Power is often easier to model because it flows through conductors, and you can control (and thus plan and model) where power goes. Air goes where it wants and is hard to control.
|
||||
|
||||
Sabey customers that want higher density environments use a hot aisle containment pod to control air flow. The company puts doors at the end of the hot aisle and plastic plates over the top, so heat is directed into a ceiling intake pipe and the barriers keep hot air and cold air from mixing.
|
||||
|
||||
"In an air-cooled server world, the advice I give is go with a hot aisle containment environment,” Sasser says. "The other advice I would give is make sure the data center is tested for air flow, not just modeled for airflow. Modeling is dependent on a lot of variables, and they easily change."
|
||||
|
||||
### Consider a chimney cabinet
|
||||
|
||||
Another way to help manage temperatures in data centers is to use a chimney cabinet. Instead of venting the hot air out the back, a chimney cabinet uses good old physics convection to send hot air up into a chimney, which is then connected to an air conditioning vent. [Chatsworth Systems][10] is best known for this style of cabinets.
|
||||
|
||||
“The air pathway is more constrained this way,” Sasser says. “Since that air pathway is more constrained, you can get greater density into a cabinet than with a hot aisle pod.”
|
||||
|
||||
### Process data where it resides
|
||||
|
||||
Moving data around has a very high energy cost: It can take up to 100 times more energy to move data than it takes to process data, Conway says. Any form of data movement requires electricity, and that power drain increases with the volume of data – a significant issue for data-intensive AI applications. “You want to move data as rarely and as little distance as you can,” Conway says.
|
||||
|
||||
“The solution is not to have to move the data any more or further than is absolutely necessary. So people are striving to put data closer to where it is processed. One thing cloud services providers and people who use cloud services agree on is it doesn’t make sense to move a massive amount of data to a third-party cloud,” he says.
|
||||
|
||||
### Consider leasing data center space
|
||||
|
||||
Most of the companies looking to implement AI are corporations that lease data center space from a data center operator, Hollidge says. There are some data center operators that are not capable of handling high density AI computation, but some have transitioned to offering a portion of high density environments for AI.
|
||||
|
||||
“You might have to go through a few providers before finding it, but there is more attention being paid to that on the data center operations side,” Hollidge says. And a third-party data center provider gives you more growth options. “Most of the time you are better off entering into a flexible lease that allows you to expand and grow your AI business as opposed to building ground up.”
|
||||
|
||||
### Wait for next-generation servers
|
||||
|
||||
Supercomputers to date haven’t been very data friendly, Conway says. As supercomputers have gotten bigger, the designs have gotten less data-centric. The result is that more data has to be moved around and shuttled between processors, memory, and storage systems. And as discussed above, it costs more power to move data than to process it.
|
||||
|
||||
The first exascale systems will come with more accelerators and more powerful interconnections for moving around data. And many innovations that start in supercomputing, including GPUs and storage-class memory (SCM), eventually work their way down to more mainstream servers.
|
||||
|
||||
Future servers also will come with a more heterogeneous chip layout; instead of all x86 CPUs, they will include GPUs, FPGAs, and AI accelerators. And for high speed storage, NVMe-over-Fabric and SCM will become more affordable. Servers are set to change in the coming years, and many of the advances will benefit enterprise AI application environments.
|
||||
|
||||
**Learn more about HPC and supercomputers**
|
||||
|
||||
* [HPE to buy Cray, offer HPC as a service][11]
|
||||
* [Decommissioning the Titan supercomputer][12]
|
||||
* [10 of the world's fastest supercomputers][13]
|
||||
* [What’s quantum computing and why should enterprises care?][14]
|
||||
* [Who’s developing quantum computers?][15]
|
||||
|
||||
|
||||
|
||||
Join the Network World communities on [Facebook][16] and [LinkedIn][17] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3454626/8-ways-to-prepare-your-data-center-for-ai-s-power-draw.html
|
||||
|
||||
作者:[Andy Patrizio][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/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.afcom.com/
|
||||
[2]: https://www.networkworld.com/article/3444399/high-performance-computing-do-you-need-it.html
|
||||
[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[4]: https://www.coolitsystems.com/
|
||||
[5]: https://sabeydatacenters.com/
|
||||
[6]: https://hyperionresearch.com/
|
||||
[7]: https://devblogs.nvidia.com/mixed-precision-training-deep-neural-networks/
|
||||
[8]: https://five9sdigital.com/
|
||||
[9]: https://www.qtsdatacenters.com/
|
||||
[10]: https://www.chatsworth.com/en-us/products/families/teraframe
|
||||
[11]: https://www.networkworld.com/article/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html
|
||||
[12]: https://www.networkworld.com/article/3408176/the-titan-supercomputer-is-being-decommissioned-a-costly-time-consuming-project.html
|
||||
[13]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html#slide1
|
||||
[14]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html#nww-fsb
|
||||
[15]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html
|
||||
[16]: https://www.facebook.com/NetworkWorld/
|
||||
[17]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,251 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (My journey to becoming an open source maintainer)
|
||||
[#]: via: (https://opensource.com/article/19/11/journey-open-source-maintainer)
|
||||
[#]: author: (Juliano Alves https://opensource.com/users/juliano)
|
||||
|
||||
My journey to becoming an open source maintainer
|
||||
======
|
||||
Hacktoberfest got me thinking. My first contribution to open source was
|
||||
challenging, but everything I've learned since then has made me a better
|
||||
developer.
|
||||
![Guy on a laptop on a building][1]
|
||||
|
||||
[Hacktoberfest][2] is an initiative that invites developers from around the world to participate and contribute to open source. This is the second year in a row that I participated to completion of the challenge, and I was so inspired by it that I want to share my slightly longer journey to open source software.
|
||||
|
||||
### A long time ago, in a galaxy far, far away…
|
||||
|
||||
The year was 2010. The universe made its move to make me cross paths with my good friend, [Jonas Abreu][3]. Jonas is the creator of [Mirror][4], a simple domain-specific language (DSL) layer over the Java Reflection API, which makes [meta-programming][5] easier. There was a feature request open for a proxy creation capability, and Jonas asked me if I was interested in implementing it. I accepted the challenge.
|
||||
|
||||
I suffered for three days, dealing with code that I didn’t understand… until I did. I still remember the feeling that my triumph brought me that day. That pain was knowledge invading my brain!
|
||||
|
||||
This code was my first contribution to open source. I took quite a lot away from my experience contributing to Mirror:
|
||||
|
||||
* A lot about Java meta-programming
|
||||
* The concept of proxy classes
|
||||
* [Javassist][6] and [cglib][7] frameworks
|
||||
* How to receive and provide useful and respectful feedback
|
||||
* How to design a tool that will be used by others
|
||||
* Some interesting [dark magic][8]
|
||||
|
||||
|
||||
|
||||
Most importantly, I took away a sense of purpose. I love the idea of contributing to the greater good while challenging myself and working with brilliant engineers who were way smarter than me.
|
||||
|
||||
### Exploring ways to contribute to open source
|
||||
|
||||
I started taking part in community initiatives, like running coding dojos. While doing this, I met more great devs, and we started a small group. At some point, that group decided to learn Scala. We studied and coded together, and eventually started [Scaladores][9], the Scala user group of São Paulo.
|
||||
|
||||
Eventually, Jonas started talking about a different approach for learning, called [deliberate practice][10].
|
||||
|
||||
> _What if we could put all this recently acquired knowledge altogether?_
|
||||
|
||||
The resulting project from studying this practice is [Aprenda][11], a learning platform that mixes gamification and deliberate practice to make it easier to learn HTML, regular expressions, or Git. Building something this significant felt like leveling up in my pursuit of open source contribution. I also found that I picked up more knowledge about programming and practices to motivate both others and myself.
|
||||
|
||||
As much as I enjoyed this pursuit, I couldn’t dedicate a lot of time to this project. At the same time as I was making progress on Aprenda, I had to shift focus to a new job.
|
||||
|
||||
### Contributing through my own Ruby gem
|
||||
|
||||
My new work had me in a common pattern: Every problem was solved by writing code that creates, reads, updates, or deletes data (CRUD). It gave me an idea, so I started a new project. I wanted to generate code the same way Ruby on Rails, a powerful web framework, allowed me to set up an environment with a simple command: **rails g scaffold**. Using [Thor][12], the same gem that powers Rails generators, I created [Spring MVC Scaffold][13]. Now, any time I needed to create a CRUD I typed:
|
||||
|
||||
|
||||
```
|
||||
$ springmvc scaffold product name:string value:double active:boolean
|
||||
```
|
||||
|
||||
The code I wrote reducing the work my team had to do to get their job done, and I shared it further by posting it publicly. Here are some of the highlights of what I learned:
|
||||
|
||||
* Generating code and files with Thor
|
||||
* Defining commands for a CLI
|
||||
* Organizing Ruby lib code
|
||||
* Creating a Ruby gem
|
||||
* Building projects with [Travis CI][14]
|
||||
* Publishing to RubyGems
|
||||
|
||||
|
||||
|
||||
> _After solving a common problem, think about making that solution available. Most likely, other people have similar problems._
|
||||
|
||||
Even though it’s not being maintained anymore, Spring MVC Scaffold is still available on [RubyGems][15]. And I tell you what, after that project, I went to work in a tech environment full of problems.
|
||||
|
||||
### Shifting technology
|
||||
|
||||
My new work required a shift in languages. I started working with Microsoft .NET, and I found issues that other communities had already solved. That recognition excited me because I knew it was my opportunity. My new opportunity to contribute came in the form of porting those solutions.
|
||||
|
||||
#### Selenia
|
||||
|
||||
[Selenium][16] is the dominate way to programmatically interact with websites as if the code is a "real" user (accessing it via a web browser). The API has always been too complex in my opinion. So I built a tool, we called Selenia, that could be used to write concise UI tests in C#, so instead of using:
|
||||
|
||||
|
||||
```
|
||||
IWebDriver driver;
|
||||
ChromeOptions options = [new][17] ChromeOptions();
|
||||
options.addExtensions([new][17] File("/path/to/extension.crx"));
|
||||
ChromeDriver driver = [new][17] ChromeDriver(options);
|
||||
driver = [new][17] ChromeDriver();
|
||||
driver.Navigate().GoToUrl("<http://www.google.com/ncr>");
|
||||
|
||||
IWebElement query = driver.FindElement(By.Name("q"));
|
||||
query.SendKeys("Selenium");
|
||||
query.Submit();
|
||||
|
||||
driver.Quit();
|
||||
```
|
||||
|
||||
We can write as:
|
||||
|
||||
|
||||
```
|
||||
Open("<http://www.google.com/>");
|
||||
S(By.Name("q").Value("Selenia").Enter();
|
||||
```
|
||||
|
||||
Selenium users may have a question at this point. If you are wondering, the answer is "no." It’s not necessary to close the driver yourself.
|
||||
|
||||
#### Designing for immutability with Ioget
|
||||
|
||||
Immutability, which means never changing an object that already exists, makes a developer’s life easy. This opinion is a newer one, however. Back in the day, ASP.NET MVCs would recommend updating information in place. The only way to instantiate objects was via **setters**.
|
||||
|
||||
I built [Ioget][18] to help with unmarshalling request parameters in web applications. HTTP request parameters are strings, so Ioget looks for the best way to parse those params according to the given class, instantiating objects via their constructors and therefore making them immutable.
|
||||
|
||||
I published this project publicly to NuGet, but I never managed to integrate Ioget with ASP.NET like I intended to. I stopped working with Microsoft technology, and thus this project fell behind from its once lofty goals.
|
||||
|
||||
Continuing with my deliberate practice, I kept track of the lessons learned along the way.
|
||||
|
||||
* [Reification][19]
|
||||
* ASP.NET MVC internals
|
||||
* Monad implementation
|
||||
* .NET framework internals
|
||||
|
||||
|
||||
|
||||
I also took note of a pattern I used with Selenia. I really like this snippet, which I used to close the driver:
|
||||
|
||||
|
||||
```
|
||||
private void MarkForAutoClose(IWebDriver driver) =>
|
||||
AppDomain.CurrentDomain.DomainUnload += (s, e) => driver.Quit();
|
||||
```
|
||||
|
||||
### Contributing to Quill
|
||||
|
||||
I moved to London in 2016, which paused my contributions for a while. Eventually, I watched a talk by [Gustavo Amigo][20] about his project, [quill-pgsql][21], which is an extension to support PostgreSQL data types with [Quill][22]. He mentioned that this project was in its early moments, which meant it was ideal for someone to join, and I was interested in writing in Scala. After a few pull requests, I decided to contribute to the main project.
|
||||
|
||||
Quill transforms regular collection-like code into SQL queries in compile-time. I consider it the most challenging (and interesting) project I have ever contributed to. It’s been a few years since I started, and today I am [one of the maintainers][23].
|
||||
|
||||
Here’s what I learned by working on Quill:
|
||||
|
||||
* Abstract syntax trees (AST)
|
||||
* The Dark Arts (also known as [Scala macros][24])
|
||||
* How to make code extensible via [implicits][25]
|
||||
* Exclusive and weird [SQL rules][26]
|
||||
|
||||
|
||||
|
||||
Quill has a module called quill-async, which uses [an asynchronous database driver][27] that is no longer maintained. Quill’s creator, [Flavio Brasil][28], suggested that we could write a new async driver. That’s how [Non-Blocking Database Connectivity (NDBC)][29] got started.
|
||||
|
||||
NDBC is a fully async alternative to Java Database Connectivity (JDBC). Its architecture was designed to provide high-performance, non-blocking connectivity to the database on top of [Trane.io Futures][30] and [Netty 4][31]:
|
||||
|
||||
|
||||
```
|
||||
// Create a Config with an Embedded Postgres
|
||||
Config config = Config.create("io.trane.ndbc.postgres.netty4.DataSourceSupplier", "localhost", 0, "user")
|
||||
.database("test_schema")
|
||||
.password("test")
|
||||
.embedded("io.trane.ndbc.postgres.embedded.EmbeddedSupplier");
|
||||
|
||||
// Create a DataSource
|
||||
DataSource<[PreparedStatement][32], Row> ds = DataSource.fromConfig(config);
|
||||
|
||||
// Define a timeout
|
||||
Duration timeout = Duration.ofSeconds(10);
|
||||
|
||||
// Send a query to the db defining a timeout and receiving back a List
|
||||
List<Row> rows = ds.query("SELECT 1 AS value").get(timeout);
|
||||
|
||||
// iterate over awesome strongly typed rows
|
||||
rows.forEach(row -> [System][33].out.println(row.getLong("value")));
|
||||
```
|
||||
|
||||
More knowledge was acquired along the way:
|
||||
|
||||
* Understanding binary protocols
|
||||
* Using Netty 4
|
||||
* Weaknesses of the Java type system
|
||||
* Fully implementing functional structures
|
||||
|
||||
|
||||
|
||||
That’s where I am at the moment. I divide my attention between Quill and NDBC, trying to make them work together.
|
||||
|
||||
### Plans for the future
|
||||
|
||||
The contributions I have in mind for the near future are implementing:
|
||||
|
||||
* Array support in [Finagle Postgres][34]
|
||||
* A Clojure wrapper for NDBC
|
||||
* A ndbc-spring module
|
||||
* A CLI in [Rust][35]
|
||||
|
||||
|
||||
|
||||
I now have almost 10 years of open source in my journey, and it taught me something extremely valuable: Open source is about sharing knowledge. When I am solving an issue, I am acquiring knowledge. When I send a pull request, I am spreading that knowledge. Knowledge brings more knowledge!
|
||||
|
||||
I strongly recommend that you become part of the open source community. It can be difficult, especially in the beginning, but everything you will learn will make you a better developer. I promise.
|
||||
|
||||
> _Open source is about sharing knowledge. When I am solving an issue, I am acquiring knowledge. When I send a pull request, I am spreading that knowledge. Knowledge brings more knowledge!_
|
||||
|
||||
_This article was originally posted on [Juliano Alves' Programming Blog][36]. It has been edited for style and clarity._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/journey-open-source-maintainer
|
||||
|
||||
作者:[Juliano Alves][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/juliano
|
||||
[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 (Guy on a laptop on a building)
|
||||
[2]: https://hacktoberfest.digitalocean.com/
|
||||
[3]: https://twitter.com/jonasabreu
|
||||
[4]: http://projetos.vidageek.net/mirror/mirror/
|
||||
[5]: https://www.ibm.com/developerworks/library/l-metaprog1/index.html
|
||||
[6]: https://www.javassist.org/
|
||||
[7]: https://github.com/cglib/cglib
|
||||
[8]: https://github.com/vidageek/mirror/blob/master/src/main/java/net/vidageek/mirror/provider/java/ObjenesisConstructorBypassingReflectionProvider.java
|
||||
[9]: https://www.meetup.com/scaladores/
|
||||
[10]: https://jamesclear.com/deliberate-practice-theory
|
||||
[11]: https://aprenda.vidageek.net/
|
||||
[12]: http://whatisthor.com/
|
||||
[13]: https://github.com/juliano/springmvc-scaffold
|
||||
[14]: https://travis-ci.com/
|
||||
[15]: https://rubygems.org/gems/springmvc-scaffold
|
||||
[16]: https://www.seleniumhq.org/
|
||||
[17]: http://www.google.com/search?q=new+msdn.microsoft.com
|
||||
[18]: https://www.nuget.org/packages/Ioget/
|
||||
[19]: https://en.wikipedia.org/wiki/Reification_(computer_science)
|
||||
[20]: https://github.com/gustavoamigo
|
||||
[21]: https://github.com/gustavoamigo/quill-pgsql
|
||||
[22]: https://getquill.io/
|
||||
[23]: https://github.com/getquill/quill
|
||||
[24]: http://scalamacros.org/
|
||||
[25]: https://docs.scala-lang.org/tour/implicit-parameters.html
|
||||
[26]: https://teamsql.io/blog/?p=923
|
||||
[27]: https://github.com/mauricio/postgresql-async
|
||||
[28]: https://twitter.com/flaviowbrasil
|
||||
[29]: https://ndbc.io/
|
||||
[30]: http://trane.io/
|
||||
[31]: https://netty.io/
|
||||
[32]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+preparedstatement
|
||||
[33]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[34]: https://github.com/finagle/finagle-postgres/issues/55
|
||||
[35]: https://opensource.com/tags/rust
|
||||
[36]: https://juliano-alves.com/2019/11/02/the-journey-of-an-open-source-developer/
|
@ -0,0 +1,124 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (A framework for building products from open source projects)
|
||||
[#]: via: (https://opensource.com/article/19/11/products-open-source-projects)
|
||||
[#]: author: (Kevin Xu https://opensource.com/users/kevin-xu)
|
||||
|
||||
A framework for building products from open source projects
|
||||
======
|
||||
Here is a roadmap for turning a project into a commercial open source
|
||||
product.
|
||||
![An airplane.][1]
|
||||
|
||||
My first memory of playing with a computer was through an [MS-DOS][2] terminal on the x86 PC in my grandfather's pharmaceutical research lab in the early '90s—playing games stored on 3.5" floppy disks and doing touch-typing exercises. As technology improved, I spent an obscene amount of time taking my computer apart to add more RAM, a new graphics card, or a new fan, mostly so I could play cooler games. It was a fun, ongoing project, and I bonded with my father over it. It was also way cheaper than buying a new computer.
|
||||
|
||||
What's the point of this in the context of open source?
|
||||
|
||||
Well, even though I had no idea what "open source" was at the time, I was behaving like a typical developer does with open source projects today—spending my free time to piece together and build things I wanted, sometimes for a specific goal, sometimes to learn new things, sometimes as a way to connect with others.
|
||||
|
||||
But, over time, I stopped tinkering. For whatever reason, I decided that my time was becoming too "valuable" to retrofit my older computers. I started using a MacBook, and when my older MacBook wasn't functioning well, I paid a pretty penny for a new one with a better configuration instead of unscrewing the bottom to see if I could jam in a new RAM card.
|
||||
|
||||
My behavior became more like that of an enterprise buyer—saving time and trouble by spending money.
|
||||
|
||||
### An open source software project is not a product you sell
|
||||
|
||||
If your experience with technology resembles mine in any way, you know intuitively that the _projects_ we [DIY][3] are not the same as the _products_ we spend money buying.
|
||||
|
||||
This isn't a new observation in the open source community.
|
||||
|
||||
[Stephen Walli][4], an IT industry veteran and part of the [Open Container Initiative][5], has written [numerous detailed blog posts][6] on this topic. [Sarah Novotny][7], who led the Kubernetes community and was heavily involved in the Nginx and MySQL communities, [emphatically articulated][8] at the inaugural [Open Core Summit][9] that the open source project a company shepherds and the product that a company sells are two completely _different_ things.
|
||||
|
||||
Yet, project and product continue to be conflated by maintainers-turned-founders of commercial open source software (COSS) companies, especially (and ironically) when the open source project gets traction.
|
||||
|
||||
This mistake gets repeated, I believe, because it's hard to mentally conceptualize how and why a commercial product should be different when the open source project is already being used widely.
|
||||
|
||||
### What makes a COSS product different?
|
||||
|
||||
Two core elements differentiate a commercial product from its open source root: packaged experience and buyer-specific features.
|
||||
|
||||
#### Packaged experience
|
||||
|
||||
Packaging your project so that it has that out-of-the-box user experience isn't just about a polished user interface (UI) or hosting it on your server as SaaS (although that could be part of it). It's an expressed opinion of how you, the creator or maintainer of the project turned founder of the company, believe the technology should be used to solve your customer's business problem. That "opinion" is essentially the product experience the customer is paying for.
|
||||
|
||||
When you are running an open source community project, it's usually good to be _not_ opinionated and let your community organically flourish. When you are developing a product for customers, it's usually good to _be_ opinionated.
|
||||
|
||||
It's the retrofitted x86 PC versus the MacBook dynamic.
|
||||
|
||||
[Dave McJannet][10], CEO of Hashicorp, and [Peter Reinhardt][11], CEO of Segment, both cited packaging as a crucial step to get right in order to turn an open source project into a scalable commercial product.
|
||||
|
||||
#### Buyer-specific features
|
||||
|
||||
A well-packaged product must also have the features that are necessary for your targeted buyer to justify a purchase. What these features are depends on the profile of your buyer, but the possibilities are finite and manageable.
|
||||
|
||||
An enterprise buyer, say a Global 2000, will have a relatively consistent set of features that it must have to purchase a product. ([EnterpriseReady.io][12] is a great resource about what those features tend to be.)
|
||||
|
||||
A small- or medium-sized business buyer, say your local mom-and-pop bakery, that has less financial resources and people power and is more price-sensitive, will need different things to be convinced to buy.
|
||||
|
||||
A consumer service monetized via ads, where your buyers are the advertisers while your users are everyday people, will be different still.
|
||||
|
||||
One thing is for sure: your buyer is almost _never_ your open source community.
|
||||
|
||||
Know what your buyer requires for a purchase, and package that with your expert opinion on how to solve the buyer's problem; **that's what differentiates a product from a project.**
|
||||
|
||||
Sid Sijbrandij's articulation of GitLab's [buyer-based open core][13] model is a good example for enterprises.
|
||||
|
||||
Certainly, other elements can be added to further the differentiation. But a packaged experience with buyer-specific features is essential. Without one or the other, your prospective customers might as well just tinker on their own for free.
|
||||
|
||||
### One metric that matters: Time-to-value
|
||||
|
||||
A perennially difficult thing in product development is measuring progress and establishing a data-driven framework to determine whether you are on the right path or not. I'm a fan of the One Metric That Matters (OMTM) mentality, elaborated in [_Lean Analytics_][14], where you focus on one single number (above everything else) for your current stage. This approach enforces focus and discipline among a sea of data you can gather and distract yourself with (oftentimes vanity metrics like download numbers or GitHub stars). The single metric can effectively rally your entire company around one tangible goal or mission—especially critical for an early-stage company. And the metric you focus on will be different at different stages.
|
||||
|
||||
So what's the right OMTM in the early days of product development?
|
||||
|
||||
I propose **time-to-value**
|
||||
|
||||
"Time" here is straightforward—the lower, the better.
|
||||
|
||||
"Value" needs a precise, rigorous definition that is technology- and problem-specific. Your distributed database is valuable because it can serve data with no downtime when servers fail. Your continuous integration tool is valuable because it enables application developers to push improvements faster without breaking the application. You get the idea.
|
||||
|
||||
How quickly can a customer see or feel the _one core piece of value_ that you measure and optimize for? Whatever is "a sufficiently short time" depends on the use case, but given the increasing consumerization of enterprise technology, any product's time-to-value that's more than 30 minutes is probably too long.
|
||||
|
||||
Finding and tightly defining that "value" is hard and iterative, but also table stakes if you are looking to build a product company around an open source project. Without a deep understanding of what that value is for your customer, there's probably not much of a company to build.
|
||||
|
||||
At the end of the day, as much fun as it was to "beef up" my x86 PC, I'm pretty satisfied with my MacBook and happy to pay the premium. So don't get too enamored with the joy of tinkering if your goal is actually to sell MacBook.
|
||||
|
||||
(P.S. The mental framework outlined here may not apply if you are building a consultancy or support-oriented company that services open source project users. For more expansive reading on different COSS business models, see _[_COSS business model progressions_][15]_ by Joseph Jacks.)
|
||||
|
||||
_Special thanks to Sarah Novotny for her feedback on this post's draft._
|
||||
|
||||
* * *
|
||||
|
||||
_This article was [previously published on COSS Media][16] and is edited and republished with permission._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/products-open-source-projects
|
||||
|
||||
作者:[Kevin Xu][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/kevin-xu
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/206308main_image_976_946-710.jpg?itok=U6hh3EIO (An airplane.)
|
||||
[2]: https://en.wikipedia.org/wiki/MS-DOS
|
||||
[3]: https://en.wikipedia.org/wiki/Do_it_yourself
|
||||
[4]: https://stephesblog.blogs.com/about.html
|
||||
[5]: https://www.opencontainers.org/
|
||||
[6]: https://medium.com/@stephenrwalli
|
||||
[7]: https://sarahnovotny.com/about/
|
||||
[8]: https://www.linkedin.com/pulse/personal-reflection-open-core-summit-kevin-xu/
|
||||
[9]: https://opencoresummit.com/#speakers
|
||||
[10]: https://founderrealtalk.ggvc.com/2019/04/25/episode-23-hashicorp-ceo-dave-mcjannet-reveals-the-secrets-of-commercializing-open-source-selling-to-enterprises-and-building-successful-relationships-with-founders/
|
||||
[11]: https://www.youtube.com/watch?v=Q75V35unztw&feature=youtu.be
|
||||
[12]: https://www.enterpriseready.io/#
|
||||
[13]: https://www.youtube.com/watch?v=G6ZupYzr_Zg
|
||||
[14]: http://leananalyticsbook.com/
|
||||
[15]: https://coss.media/coss-business-model-progressions/
|
||||
[16]: https://coss.media/deriving-product-from-open-source/
|
@ -0,0 +1,88 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How cloud providers' performance differs)
|
||||
[#]: via: (https://www.networkworld.com/article/3455197/how-cloud-providers-performance-differs.html)
|
||||
[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/)
|
||||
|
||||
How cloud providers' performance differs
|
||||
======
|
||||
The 2019 ThousandEyes Benchmark report shows that not all cloud providers are created equal across all regions
|
||||
Denis Isakov / Getty Images
|
||||
|
||||
Not all public cloud service providers are the same when it comes to network performance.
|
||||
|
||||
Each one’s connectivity approach varies, which causes geographical discrepancies in network performance and predictability. As businesses consider moving to the cloud, especially software-defined wide-area networks ([SD-WAN][1]) and [multi-cloud][2], it’s important to understand what each public cloud service provider brings to the table and how they compare.
|
||||
|
||||
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
|
||||
|
||||
In 2018, ThousandEyes first conducted [a benchmark study assessing three major public cloud providers][4]: Amazon Web Services (AWS), Microsoft Azure (Azure), and Google Cloud Platform (GCP). The study gathered data on network performance and connectivity architecture to guide businesses in the planning stage.
|
||||
|
||||
[][5]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[HPE Synergy For Dummies][5]
|
||||
|
||||
Here’s how IT can provide an anytime, anywhere, any workload infrastructure.
|
||||
|
||||
[This year’s study][6] offers a more comprehensive view of the competition, with two more providers added to the list: Alibaba Cloud and IBM Cloud. It compares 2018 and 2019 data to show changes that took place year-over-year and what triggered them.
|
||||
|
||||
ThousandEyes periodically collected bi-directional network performance metrics—such as latency, packet loss and jitter—from 98 user vantage points in global [data centers][7] across all five public cloud providers over a four-week period. Additionally, it looked at network performance from leading U.S. broadband internet service providers (ISPs), including AT&T, Verizon, Comcast, CenturyLink, Cox, and Charter.
|
||||
|
||||
The network management company then analyzed more than 320 million data points to create the benchmark. Here are the results.
|
||||
|
||||
### Inconsistencies among providers
|
||||
|
||||
In its initial study, ThousandEyes revealed that some cloud providers rely heavily on the public internet to carry user traffic while others don’t. In this year’s study, the cloud providers generally showed similar performance in bi-directional network latency.
|
||||
|
||||
However, ThousandEyes found architectural and connectivity differences have a big impact on how traffic travels between users and certain cloud hosting regions. AWS and Alibaba mostly rely on the internet to transport user traffic. Azure and GCP use their private backbone networks. IBM is different from the rest and takes a hybrid approach.
|
||||
|
||||
ThousandEyes tested the theory of whether AWS Global Accelerator out-performs the internet. AWS Global Accelerator launched in November 2018, offering users the option to utilize the AWS private backbone network for a fee instead of the default public internet. Although performance did improve in some regions around the world, there where other instances where the internet was faster and more reliable than AWS Global Accelerator.
|
||||
|
||||
Broadband ISPs that businesses use to connect to each cloud also showed inconsistencies, even in the mature U.S. market. After evaluating network performance from the six U.S. ISPs, sub-optimal routing results were recorded, with up to 10 times the expected network latency in some cases.
|
||||
|
||||
**Location, location, location**
|
||||
|
||||
Cloud providers commonly experience packet loss when crossing through China’s content-filtering firewall, even those from the region like Alibaba. The 2019 study closely examined the performance toll cloud providers pay in China, which has a notoriously challenging geography for online businesses. For those with customers in China, ThousandEyes recommends Hong Kong as a hosting region since Alibaba Cloud traffic experienced the least packet loss there, followed by Azure and IBM.
|
||||
|
||||
In other parts of the world, Latin America and Asia showed the highest performance variations for all cloud providers. For example, network latency was six times higher from Rio de Janeiro to GCP’s São Paulo hosting region because of a suboptimal reverse path, compared to other providers. But across North America and Western Europe, all five cloud providers demonstrated comparable, robust network performance.
|
||||
|
||||
The study’s results confirm that location is a major factor, therefore, user-to-hosting-region performance data should be considered when selecting a public cloud provider.
|
||||
|
||||
**Multi-cloud connectivity**
|
||||
|
||||
In 2018, ThousandEyes discovered extensive connectivity between the backbone networks of AWS, GCP, and Azure. An interesting finding in this year’s study shows multi-cloud connectivity was erratic when IBM and Alibaba Cloud were added to the list.
|
||||
|
||||
ThousandEyes found IBM and Alibaba Cloud don’t have fully established, direct connectivity with other providers. That’s because they typically use ISPs to connect their clouds to other providers. AWS, Azure, and GCP, on the other hand, peer directly with each other and don’t require third-party ISPs for multi-cloud communication.
|
||||
|
||||
With multi-cloud initiatives on the rise, network performance should be included as a metric in evaluating multi-cloud connectivity since it appears to be inconsistent across providers and geographical boundaries.
|
||||
|
||||
ThousandEyes’ comprehensive performance benchmark can serve as a guide for businesses deciding which public cloud provider best meets their needs. But to err on the side of caution, businesses selecting public cloud connectivity should consider the unpredictable nature of the internet, how it affects performance, creates risk, and increases operational complexity. Businesses should address those challenges by gathering their own network intelligence on a case-by-case basis. Only then they will benefit fully from what cloud providers have to offer.
|
||||
|
||||
Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3455197/how-cloud-providers-performance-differs.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/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html
|
||||
[2]: https://www.networkworld.com/article/3429258/real-world-tools-for-multi-cloud-management.html
|
||||
[3]: https://www.networkworld.com/newsletters/signup.html
|
||||
[4]: https://www.networkworld.com/article/3319776/the-network-matters-for-public-cloud-performance.html
|
||||
[5]: https://www.networkworld.com/article/3399618/hpe-synergy-for-dummies.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE19718&utm_content=sidebar (HPE Synergy For Dummies)
|
||||
[6]: https://www.thousandeyes.com/press-releases/second-annual-cloud-performance-benchmark-research
|
||||
[7]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html
|
||||
[8]: https://www.facebook.com/NetworkWorld/
|
||||
[9]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,138 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (SASE: Redefining the network and security architecture)
|
||||
[#]: via: (https://www.networkworld.com/article/3481519/sase-redefining-the-network-and-security-architecture.html)
|
||||
[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/)
|
||||
|
||||
SASE: Redefining the network and security architecture
|
||||
======
|
||||
Adoption of SASE reduces complexity and overhead, improves security and boosts application performance.
|
||||
Getty Images
|
||||
|
||||
In a cloud-centric world, users and devices require access to services everywhere. The focal point has changed. Now it is the identity of the user and device as opposed to the traditional model that focused solely on the data center. As a result, these environmental changes have created a new landscape that we need to protect and connect.
|
||||
|
||||
This new landscape is challenged by many common problems. The enterprises are loaded with complexity and overhead due to deployed appliances for different technology stacks. The legacy network and security designs increase latency. In addition, the world is encrypted; this dimension needs to be inspected carefully, without degrading the application performance.
|
||||
|
||||
These are some of the reasons that surface the need for a cloud-delivered secure access service edge (SASE). SASE consists of a tailored network fabric optimization where it makes the most sense for the user, device and application - at geographically dispersed PoPs. To deliver optimum network experience everywhere you should avoid the unpredictability of the Internet core. In the requirements for SASE, Gartner recommends that this backbone should not be based on AWS or Azure. Their PoP density is insufficient. It is not sufficient to offer a SASE service built solely on a hyper-scale.
|
||||
|
||||
[][1]
|
||||
|
||||
BrandPost Sponsored by HPE
|
||||
|
||||
[Take the Intelligent Route with Consumption-Based Storage][1]
|
||||
|
||||
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
|
||||
|
||||
There are clear benefits that can be achieved by redefining the network and security architecture. Yes, the adoption of SASE reduces complexity and overhead, improves security. It increases the application performance, but practically, what does that mean?
|
||||
|
||||
[Linda Musthaler had a great example in her conversation with Andrew Thomson, Director of IT at BioIVT,][2] a provider of biological materials and scientific services to research and development organizations, who adopted Cato Networks’ SASE platform nearly two years ago:
|
||||
|
||||
_“We positioned it as a platform for everything that we wanted to be able to do over the next three years with the business,” he told Linda, “The big goal, the business strategy, is growth and acquisition. We presented this as a platform, as a base service that we just had to have in place in order to leverage things like voice over IP, Office 365, Azure, cloud-based computing services, hosting servers in the cloud. Without a common core solid foundation, we wouldn't have been able to do any of those things reliably without adding staff to do monitoring or maintenance or administrative overhead.”_
|
||||
|
||||
It’s that last line – “without adding staff to do monitoring or maintenance or administrative overhead” – that I found particularly striking. So, let’s understand why SASE can be so impactful from an architectural perspective.
|
||||
|
||||
**[ Now read [20 hot jobs ambitious IT pros should shoot for][3]. ]**
|
||||
|
||||
### Complexity and overhead
|
||||
|
||||
Traditional mechanisms are limited by the hardware capacity of the physical appliances located at the customer's site. Such mechanisms create a lag in the hardware refresh rates that are needed to add new functionality.
|
||||
|
||||
Hardware-based network and security solutions build into the hardware the differentiator of the offering. Primarily, with different hardware, you can accelerate the services and add new features. There are some features that are available only on the specific hardware, not the hardware you already have onsite. In this case, heavy lifting by the customer will be required.
|
||||
|
||||
As the environment evolves, we should not depend on the new network and security features coming from the new generation of an appliance. Typically, this model is inefficient and complex. It creates high operational overhead and management complexity.
|
||||
|
||||
Device upgrades for new features require a lot of management. From past experience, to change out a line card would involve multiple teams. The line card might run out of ports or you may simply need additional features from a new generation. Largely, this would involve project planning, on-site engineers, design guides, hopefully, line card testing and hours of work. For critical sites to ensure a successful refresh, team members may need to be backed up. Therefore, there are many touches that need to be managed.
|
||||
|
||||
### SASE – Easing management
|
||||
|
||||
The cloud-based SASE enables the updates for new features and functionality without the need for new deployments of appliances (physical or virtual) and software versions on the customer side. This has an immediate effect on the ease of management.
|
||||
|
||||
Now the network and security deployment can occur without ever touching the enterprise network. This allows enterprises to adopt new capabilities quickly. Once the tight coupling between the features and the customer appliance is removed, this increases the agility and simplicity for the deployment of network and security services.
|
||||
|
||||
With a SASE platform, when we create an object, such as a policy in the networking domain, it is then available in other domains as well. So any policies assigned to users are tied to that user, regardless of the network location. This significantly removes the complexity of managing both; network and security policies across multiple locations, users and types of devices. Supremely, all of this can be done from one platform.
|
||||
|
||||
Also, when we examine the security solution, many buy individual appliances that focus just on one job. To troubleshoot, you need to gather information, such as the logs from each device. This is what a SIEM is useful for but it can only be used in some organizations as it’s resource-heavy. For the ones who don’t have ample resources, the process is backbreaking and there will be false positives.
|
||||
|
||||
In addition, SASE enables easier troubleshooting because all the data is in one common repository. You no longer have normalized data from different appliances/solution and then import the data into a database for a common view.
|
||||
|
||||
### Consolidation of vendors and technology stacks
|
||||
|
||||
I recall an experience from a previous consultancy, wherein we were planning the next year's security budget. The network was packed with numerous security solutions. All these point solutions are expensive and there is never a fixed price. So how do you actually plan for this?
|
||||
|
||||
Some new solutions we were considering charge on the usage models which at that time we didn’t have the quantity. SASE removes these types of headaches. By consolidating services into a single provider, there will be a reduction in the number of vendors and agents/clients on the end-user device.
|
||||
|
||||
Overall, there will be high complexity saving from the consolidation of vendors and technology stacks. The complexity is pushed to the cloud away from the on-premise enterprise network. The SASE fabric abstracts the complexity and reduces costs.
|
||||
|
||||
From a hardware point of view: for scale and additional capacity, the cloud-based SASE can add more PoPs of the same instance. This is known as vertical scaling. This scaling can also be carried in new locations, known as horizontal scaling.
|
||||
|
||||
Additionally, the SASE-based cloud takes care of intensive processing. For example, since a large proportion of internet traffic is now encrypted, malware can use encryption to evade and hide from detection. Here, each of the PoPs can perform DPI on TLS-encrypted traffic.
|
||||
|
||||
Traditional firewalls are not capable of inspecting encrypted traffic. Performing DPI on TLS-encrypted traffic would require extra modules or a new appliance. A SASE solution ensures that the decryption and inspection are done at the PoP. Consequently, there is no performance-hit or the need for new appliances on the customer sites.
|
||||
|
||||
### Ways to improve performance
|
||||
|
||||
Network congestion resulting in dropped and out of order packets is bad for applications. Latency-sensitive applications, such as collaboration, video, VoIP and web conferencing are hit hardest because of packet drops. Luckily, there are options to minimize latency and the effects of packet loss.
|
||||
|
||||
SD-WAN solutions have WAN optimization features that can be applied on an application-by-application or site-by-site basis. Along with WAN optimization features, there are protocol and application acceleration techniques that can be employed.
|
||||
|
||||
On top of the existing techniques to reduce the packet loss and latency, we can privatize the WAN as much as possible. You can control the adverse and varying effects that the last mile and middle mile have on the applications by privatizing with a global backbone consisting of a fabric of PoPs.
|
||||
|
||||
Once privatized, we can have more control over traffic paths, packet loss and latency. A private network fabric is a key benefit gained from SASE as it drives the application performance.
|
||||
|
||||
### SASE PoP optimizations
|
||||
|
||||
Each PoP in the SASE cloud-based solution optimizes where it makes the most sense, not just at the WAN edge. Within the backbone, we have global route optimizations to determine which path is the best at the current time and it can also be changed for all traffic or certain applications.
|
||||
|
||||
These routing algorithms factor in the performance metrics, such as latency, packet loss and jitter. These algorithms can help in selecting the optimal route for every network packet. The WAN backbone constantly analyzes and tries to improve the performance. This is unlike internet routing that favors cost over performance.
|
||||
|
||||
As everything is privatized, we have all the information to create the largest packet size and use rate-based algorithms over traditional loss-based algorithms. As a result, you don't need to learn anything, and the end-to-end throughput can be maintained.
|
||||
|
||||
As each PoP acts as a TCP proxy server, certain techniques are employed so that the TCP client and server think that they are closer. Therefore, a larger TCP window is set, allowing more data to be passed before waiting for an acknowledgment.
|
||||
|
||||
### Preferred egress points
|
||||
|
||||
We can also define preferred egress points to exit the cloud application traffic. These could be the points closest to the customer's application instance. The optimal global routing algorithms determine the best path to the customer's cloud application instance from anywhere in the world.
|
||||
|
||||
The PoPs can be collocated in the data centers directly connected to the IXP that connects to all major Infrastructures as service providers. This provides a good on-ramp to access the services from Amazon AWS, Microsoft Azure and Google cloud.
|
||||
|
||||
Therefore, you can keep the traffic on the private cloud for the majority of the time. Within a SASE design, the internet is used only to provide a short hop to the SASE fabric.
|
||||
|
||||
### Security – Identity-centric perimeter
|
||||
|
||||
SASE converges the networking and security pillars into a single platform. This allows multiple security solutions into a cloud service that enforces a unified policy across all the corporate locations, users and data.
|
||||
|
||||
SASE recommends you employ the zero-trust principles. The initial path to zero trust starts with identifying that network access is based on the identity of user, device and application. It is not based on the IP address or physical location of the device. And this is for a good reason as there is no contextual information.
|
||||
|
||||
The identity of the user/device must reflect the business context as opposed to being associated with binary constructs that are completely disjointed from the upper layers. This binds the identity to the world of networking and is the best way forward for policy enforcement. This way, the dependency on IP or applications as identifiers is removed. Now, the policy can be applied consistently, regardless of where the user/device is located. At the same time, the identity of the user/device/service can be factored into the applied policy.
|
||||
|
||||
The SASE stack is dynamically applied based on the identity and context while serving zero trust at strategic points in the cloud. This is what enforces an identity-centric perimeter.
|
||||
|
||||
_You can learn more about SASE and how it relates to [SD-WAN architectures][4] in a recent course I’ve rolled out. The course shines the torch on various SD-WAN solutions from Silver Peak, VMware, Cisco and Cato._
|
||||
|
||||
**This article is published as part of the IDG Contributor Network. [Want to Join?][5]**
|
||||
|
||||
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/3481519/sase-redefining-the-network-and-security-architecture.html
|
||||
|
||||
作者:[Matt Conran][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/Matt-Conran/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
|
||||
[2]: https://www.networkworld.com/article/3453030/sase-is-more-than-a-buzzword-for-bioivt.html
|
||||
[3]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html
|
||||
[4]: https://www.pluralsight.com/courses/sd-wan-architectures-big-picture
|
||||
[5]: https://www.networkworld.com/contributor-network/signup.html
|
||||
[6]: https://www.facebook.com/NetworkWorld/
|
||||
[7]: https://www.linkedin.com/company/network-world
|
70
sources/talk/20191127 Is your code inclusive.md
Normal file
70
sources/talk/20191127 Is your code inclusive.md
Normal file
@ -0,0 +1,70 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Is your code inclusive?)
|
||||
[#]: via: (https://opensource.com/article/19/11/inclusive-design-code)
|
||||
[#]: author: (Peter Cheer https://opensource.com/users/petercheer)
|
||||
|
||||
Is your code inclusive?
|
||||
======
|
||||
Learn how developers can support assistive technology projects and
|
||||
inclusivity.
|
||||
![plastic game pieces on a board][1]
|
||||
|
||||
I have been involved with assistive technology for about ten years now, beginning with a stint as an assistive technology tutor with the [Kenya Society for the Blind][2].
|
||||
|
||||
Assistive technology helps improve the lives of people with cognitive, physical or sensory challenges. It comprises a wide range of hardware, specialist software such as screen readers, as well as accessibility features in general software.
|
||||
|
||||
Over the ten years that I have worked with assistive technology, it has vastly improved. This is due in part to the advent of more powerful technologies, as well as better education and stronger disability rights legislation across much of the world. However, progress has been uneven and much of the legislation, well-meaning as it is, is poorly enforced, so there is still work to be done.
|
||||
|
||||
[The Association for the Advancement of Assistive Technology in Europe (AAATE)][3] is an interdisciplinary pan-European association devoted to all aspects of assistive technology, such as use, research, development, manufacture, supply, provision, and policy. Following the AAATE 2019 Conference in Bologna, the association published ["The Bologna Declaration."][4]
|
||||
|
||||
The declaration is a call to action "to improve access to quality assistive technology for realizing fundamental human rights and achieving the sustainable development goals in a fully inclusive manner."
|
||||
|
||||
It includes a list of ten important steps in an agenda for action. These points are not specifically aimed at the open source community; they are intended for policymakers and the whole assistive technology sector. This agenda for action is well thought out and deserves to be widely read across the technology sector.
|
||||
|
||||
### Examples of open source assistive technology
|
||||
|
||||
A look at the projects listed at [Open Assistive][5] offers an idea of the range of open source assistive technology projects that are already out there. A good example of mainstream open source software embracing accessibility is the Mozilla Firefox web browser "reader view" feature, which removes ads, background images, and other clutter for distraction-free viewing. The spoken text option in "reader view" also aids accessibility. This feature has certainly improved my user experience and has the great advantage of being a standard option rather than an add-on.
|
||||
|
||||
Some of the open source assistive tools that I have used with my clients include:
|
||||
|
||||
* [Vinux][6] — a Linux distro that is optimized for users with visual impairments
|
||||
* [NVDA][7] — a capable screen reader for MS Windows
|
||||
* [Autohotkey][8] — automates almost anything in MS Windows by sending keystrokes and mouse clicks
|
||||
* [Mulberry symbol set][9] — Mulberry symbols, or pictograms, are a set of scalable SVG graphic images designed for communications use. They are ideal for software, devices, or any online accessibility use.
|
||||
|
||||
|
||||
|
||||
There is a huge range of open source assistive technology projects; one large subset that I am interested to explore is the growing list of open source assistive technology hardware projects. If you have a favorite project that you use or contribute to, share it with us in the comments!
|
||||
|
||||
You can support assistive technology by encouraging users to try it, by contributing coding work to assistive technology projects, or by working on documentation and user guides. Even if they’re not working specifically on assistive technology, all developers should keep in mind the need for inclusive design in their projects. If you would like to endorse the Bologna Declaration "to raise awareness so people take action and do everything in their power to actively implementing the points on the agenda," please visit <https://aaate.net/endorse-bologna-declaration/>.
|
||||
|
||||
Assistive technology such as Augmented/Assisted Communication (AAC), Text-to-Speech and Speech-to-...
|
||||
|
||||
Assistive technology software is any program or operating system feature designed to let a user...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/inclusive-design-code
|
||||
|
||||
作者:[Peter Cheer][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/petercheer
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1 (plastic game pieces on a board)
|
||||
[2]: http://www.ksblind.org/
|
||||
[3]: https://opensource.com/article/19/11/www.aaate.net
|
||||
[4]: https://aaate.net/the-bologna-declaration/
|
||||
[5]: https://openassistive.org
|
||||
[6]: https://wiki.vinuxproject.org/
|
||||
[7]: https://www.nvaccess.org/
|
||||
[8]: https://www.autohotkey.com/
|
||||
[9]: https://mulberrysymbols.org/
|
@ -0,0 +1,97 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why do we contribute to open source software?)
|
||||
[#]: via: (https://opensource.com/article/19/11/why-contribute-open-source-software)
|
||||
[#]: author: (Gordon Haff https://opensource.com/users/ghaff)
|
||||
|
||||
Why do we contribute to open source software?
|
||||
======
|
||||
Dive into the research supporting the open source ecosystem and
|
||||
developers’ motivations for participating.
|
||||
![question mark in chalk][1]
|
||||
|
||||
Organizations as a whole contribute to open source software projects for a variety of reasons.
|
||||
|
||||
One of the most important is that the open source development model is such an effective way to collaborate with other companies on projects of mutual interest. But they also want to better understand the technologies they use. They also want to influence direction.
|
||||
|
||||
The specific rationale will vary by organization but it usually boils down to the simple fact that working in open source benefits their business.
|
||||
|
||||
But why do individuals contribute to open source? They mostly see some kind of personal benefit too, but what specifically motivates them?
|
||||
|
||||
### The types of motivation
|
||||
|
||||
When we talk about motivations, one common way to do so is in terms of incentive theory. This theory began to emerge during the 1940s and 1950s, building on the earlier drive-reduction theories established by psychologists such as Clark Hull and Kenneth Spence. Incentive theory was originally based on the idea that motivation is largely fueled by the prospect of an external reward or incentive.
|
||||
|
||||
Money is a classic extrinsic motivator. So is winning an award, getting a grade, or obtaining a certification that is likely to lead to a better job.
|
||||
|
||||
However, in the 1970s, researchers began to also consider intrinsic motivations, which do not require an apparent reward other than the activity itself. Self-determination theory, developed by Edward Deci and Richard Ryan, would later evolve from studies comparing intrinsic and extrinsic motives, and from a growing understanding of the dominant role intrinsic motivations can play in behavior.
|
||||
|
||||
While intrinsic motivations can come from a number of different sources, the most straightforward one is the simple enjoyment of a particular activity. You play in a softball league after work because you like playing softball. You enjoy the exercise, the camaraderie, the game itself.
|
||||
|
||||
Researchers have also proposed a further distinction between this enjoyment-based intrinsic motivation and obligation/community-based intrinsic motivation, which is more about adherence to social or community norms. Maybe you don’t really like having the relatives over for Thanksgiving but you do it anyway because you know you should.
|
||||
|
||||
Today’s psychology literature also includes the idea of internalized extrinsic motivations. These are extrinsic motivations such as gaining skills to enhance career opportunities—but they’ve been internalized so that the motivation comes from within rather than the desire for whatever carrot is being dangled by someone else.
|
||||
|
||||
### What motivates open source developers?
|
||||
|
||||
In 2012, four researchers at [ETH Zurich][2] surveyed the prior ten years of study into open source software contribution. Among their results, they were able to group study findings into the following three categories: extrinsic motivation, intrinsic motivation, and internalized extrinsic motivation—as well as some common sub-groupings within those broader categories.
|
||||
|
||||
No surprise that money showed up as an extrinsic motivator. During the period studied, there were fewer large projects associated with successful commercially-supported products than is the case today. Even so, most of the open source projects the researchers examined had a significant number of contributors whose companies had paid them to work on open source.
|
||||
|
||||
Career obviously goes hand in hand with pay, but is open source software any different from proprietary software development in this regard? There’s some evidence that it is.
|
||||
|
||||
Lerner and Tirole [first suggested in 2002][3] that "individual developers would be motivated by career concerns when developing open source software. By publishing software that was free for all to inspect, they could signal their talent to potential employers and thus increase their value in the labor market."
|
||||
|
||||
More recently, there’s been significant empirical evidence that there are career advantages to developing code and making it available for others to see and work with. It has become almost an expectation in some industry segments for job applicants to have public GitHub code repositories, which are effectively part of their resume.
|
||||
|
||||
It’s reasonable to ask whether this trend has gone too far. After all, many highly qualified developers work on proprietary code. But it’s clear that, fair or not, at least some career prospects can come specifically from being an open source developer.
|
||||
|
||||
Among intrinsic motivators, ideology and altruism often seem closely related.
|
||||
|
||||
Free software was primarily an ideological statement at first, even if user control also had an important practical side; several researchers have found support for ideological motives in developer surveys.
|
||||
|
||||
Altruism can also be a developer motive, though research on this is mixed. One paper identified the “desire to give a present to the programmer community” as a crucial pattern in open source software. But other studies have qualified the importance of altruism as a motive, especially among programmers getting a paycheck. Other work found that altruism could be a motivator but only among developers who were otherwise satisfied.
|
||||
|
||||
There’s also the motivational power of fun and enjoyment, a classic intrinsic motivator. This should come as no surprise to anyone who hangs around open source developers. Almost all of them like working on open source projects. One large 2007 study determined that fun accounted for 28 percent of the effort (in terms of number of hours) dedicated to projects. One implication of this research is that activities developers typically enjoy less–tech support often tops this list–may require alternative forms of motivation.
|
||||
|
||||
Much of the research into reputation as an internalized extrinsic motivator has focused specifically on peer recognition. Your reputation among your peers can be a source of your own pride, but it also signals your talent to community insiders and potential employers. The suggestion that reputation could be an important motivator in contributing to open source goes back at least as far as 1998, in Eric Raymond’s essay ["Homesteading the Noosphere."][4] However, since then, a variety of surveys have supported the idea that peer reputation is a driver for participation.
|
||||
|
||||
Another motivator in this category is what researchers call "own-use value" but is more recognizably described as something like "scratch your own itch"–develop something that you want for yourself and in the process, create something valuable to others. The initial motivation essentially comes from a selfish need but that can evolve into more of an internalized desire to contribute.
|
||||
|
||||
Its unsurprising research would identify own-use value as a good motivator. Certainly, the folk wisdom is that many developers get into open source by developing something they themselves need—such as when Linus Torvalds wrote Git because Linux needed an appropriate distributed version control system.
|
||||
|
||||
As we’ve seen, contributors to open source software have a variety of different motivations but there are a few general threads worth highlighting in closing.
|
||||
|
||||
Motivators can actually be counterproductive when a single motivator is relied upon too heavily. One study reported that developers scratching their own itch worked "eclectically," fixing bugs that annoyed them and then quitting until the next time.
|
||||
|
||||
In particular, don’t expect non-extrinsic motivators to carry too much of the load. Fun isn’t a good motivator if the task is not actually fun. Altruism motivates some but it also doesn’t pay their bills.
|
||||
|
||||
That said, developers do contribute for reasons that aren’t purely about money or other extrinsic reasons. Learning, peer reputation, and recognition are important to many (and not just in open source development.) Organizations should not neglect the role these can play in motivating developers and should implement incentive programs around them, such as peer reward systems.
|
||||
|
||||
* * *
|
||||
|
||||
This post is based on material from _[How Open Source Ate Software][5]_ (Apress, 2018) by the author.
|
||||
|
||||
There are lots of non-code ways to contribute to open source: Here are three alternatives.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/why-contribute-open-source-software
|
||||
|
||||
作者:[Gordon Haff][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/ghaff
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk)
|
||||
[2]: https://pdfs.semanticscholar.org/7712/3726f65f8fd88126357c12cad230cc832f41.pdf
|
||||
[3]: https://onlinelibrary.wiley.com/doi/abs/10.1111/1467-6451.00174
|
||||
[4]: https://pdfs.semanticscholar.org/98a6/c566a7e28a48facb664c8689607a52c57a5d.pdf
|
||||
[5]: https://www.apress.com/gp/book/9781484238936
|
@ -0,0 +1,109 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (“We follow a holistic approach to drive open source adoption across the client base at Infosys”)
|
||||
[#]: via: (https://opensourceforu.com/2019/11/we-follow-a-holistic-approach-to-drive-open-source-adoption-across-the-client-base-at-infosys/)
|
||||
[#]: author: (Rahul Chopra https://opensourceforu.com/author/rahul-chopra/)
|
||||
|
||||
“We follow a holistic approach to drive open source adoption across the client base at Infosys”
|
||||
======
|
||||
|
||||
[![][1]][2]
|
||||
|
||||
_As a global services company operating in fiercely competitive environments, Infosys has set up a well-established open source practice. **Gautam Khanna, VP & head – modernization practice, Infosys**, shares with **Rahul Chopra, editorial director, EFY Group**, how the company keeps its employees up-to-date with open source, motivates and helps them to contribute to the open source ecosystem, and more._
|
||||
|
||||
**Q. What are your thoughts about the pace at which open source software (OSS) is being adopted amongst global enterprises (Top 2000 or 5000)? Is it accelerating?**
|
||||
**A.** Open source adoption in enterprises is growing more rapidly than ever. A recent global survey of IT leaders revealed that nearly 90 per cent see open source as necessary to their enterprises. Open source usage is increasingly seen in categories like cloud management, security, analytics and storage, which have historically been more associated with proprietary products. Over two-thirds of the participants in the survey have increased their open source adoption in the last 12 months, and nearly 60 per cent expect to improve adoption levels over the next year as well.
|
||||
|
||||
These numbers reinforce what we have observed among our clients across industry verticals – they are using open source more than ever in their modernization journeys. This is driven by the trifecta of unmatched innovation, quality, and value that open source delivers. However, what we have also observed is that there are differing levels of adoption across verticals. The retail and communication verticals are strategically and consistently adopting open source while financial institutions are a bit more cautious in doing so.
|
||||
|
||||
**Q. Are there any specific countries or geographic regions that are leading this trend?**
|
||||
**A.** We see the growth as pervasive across geographies. India, for example, has some amazing stories of open source adoption in government, in initiatives like Aadhaar.
|
||||
|
||||
**Q. Are you seeing an increase in the number of deals that require systems integrators (SIs) like Infosys to have expertise on various open source stacks?**
|
||||
**A.** As clients look to reduce their dependence on proprietary software, manage costs, and introduce increased agility and innovation, most application modernization deals today have open source as an integral component. We see this trend only getting stronger, so building open source competencies at scale is a must for every global SI.
|
||||
|
||||
**Q. In the earlier days, there were a lot of myths about open source. Some proprietary brands were deliberately spreading FUD (fear, uncertainty and doubt) too. Today, what are the common myths or other inhibiting factors that prevent firms from adopting open source?**
|
||||
**A.** While the awareness and acceptability of open source has certainly increased a lot over the years, we still notice the prevalence of some myths. Most of them are related to open source support, security, enterprise scalability and reliability.
|
||||
|
||||
Clients also face challenges in adopting open source at the enterprise scale – including identifying the best-fit solutions from a plethora of technologies, navigating a complex vendor ecosystem and making their open source journeys cost-neutral. In all our client conversations, we focus on debunking any myths and helping our clients make informed and optimal decisions in their open source journeys.
|
||||
|
||||
**Q. How is Infosys gearing up to become a leading SI in the open source space? What new initiatives has the company taken in the last few years?**
|
||||
**A.** Open source is a strong focus area for Infosys. We have established an open source practice that works with all our services lines to execute client engagements, drive internal innovation, open source contribution and talent enablement. We have a comprehensive set of service offerings – spanning open source advisory services, architecture consulting, implementation, migration and support – to help our clients accelerate open source adoption.
|
||||
|
||||
Our architects bring both depth and breadth across the stack to deliver end-to-end solutions. We have built a suite of in-house tools and accelerators to further speed up open source based modernization and migration initiatives.
|
||||
|
||||
We have a strong ecosystem of more than 25 partners, which helps us offer end-to-end services and a single commercial interface to our clients by bundling product subscription and support along with our application services.
|
||||
|
||||
We have a razor-sharp focus on talent enablement at scale – we have over 330 open source courses, which our employees can access via our ‘learn anywhere’ platforms, and to date, over 65,000 people have been trained on open source.
|
||||
|
||||
**Q. Are there any major open source case studies that you’d like to share with our audience, particularly a case study from India?**
|
||||
**A.** There are several exciting case studies, none more impressive than from our own backyard – the GSTN project and the platform behind the most extensive indirect tax reforms in Indian history. This is also one of the largest and most complex in the world.
|
||||
|
||||
Infosys had the privilege of designing and building this ‘population-scale’ platform using an entirely open source stack, based on fundamental principles like openness, no vendor lock-in, security, reliability, availability and scalability. The system is capable of handling some astonishing volumes – around 50,000 invoices per second and 1.2 billion invoices on the last day of filing, with extremely high availability and performance. The system has been tested to handle up to 135,000 concurrent user filings and 2,000,000 tax returns on a single day. It also collects US$ 3.7 billion of tax revenues on the peak day across 800,000 transactions.
|
||||
|
||||
Case studies like GSTN showcase the power of open source in every aspect and should convince any sceptics about its suitability at the enterprise scale.
|
||||
|
||||
**Q. How does your team empower or enable other teams at Infosys, when it comes to open source?**
|
||||
**A.** Enablement of architects and developers across the company is one of the key responsibilities of our open source practice. There are three pillars of enablement – internal learning systems, partners and hackathons. We have dedicated open source technology trainers within the education, training and assessment team to enable employees at scale. Our partner and open source practice SMEs offer webinars on the latest topics related to their products, every week. Partner training courses and certifications are integrated with our anytime, anywhere, learning system LEX. We have a well-structured refactoring program for employees who may have adjacent skills to follow a defined learning path by getting themselves trained in at least one open source technology followed by certification. It is only after this that we deploy employees on an open source project, and post gaining hands-on experience, we tag them as open source professionals. We also run open source hackathons at the organization level. In these hackathons, that we run for multiple weeks, we do a mass enablement of our employees, post which they work on solving various industry problems using open source technologies.
|
||||
|
||||
**Q. How do you ensure that your team keeps pace with the rapid changes in the open source space, and is ready to offer solutions based on the latest technology stacks?**
|
||||
**A.** We have a strong team of SMEs and full-stack architects in our open source practice. A portion of our architects’ time is dedicated to learning and certifying themselves on new technologies. They are also encouraged to contribute to open source community projects. Open source SMEs participate in various forums and partner summits to share our experiences as well as learn from others experiences. They also monitor the latest trends in the industry.
|
||||
|
||||
We have a strong ecosystem of partners that we work closely with in order to understand the latest enhancements in their products and how to take these forward with clients. In the hackathons that we conduct, we encourage hackers to unleash their imagination, innovate and build new solutions leveraging latest features.
|
||||
|
||||
We believe in building joint solutions with our partners and in solving our clients’ business problems. We have a dedicated engineering team to explore and develop new tools and accelerators to solve client problems by embracing the latest open source technologies. For example, we have built a solution using the offline capability of Couchbase in collaboration with the Couchbase team.
|
||||
|
||||
**Q. Do members of your team contribute back to the open source ecosystem too? Can you share some details?**
|
||||
**A.** Yes, we do. Infosys has a structured contribution process and has created an OS Contribution Portal internally. A contributor builds a contribution and submits it for review and IP checking. Post the IP check, the contribution can be published. Infosys has contributed homegrown products like the Infosys DevOps Platform and tools like Infosys Data Rapid, NIADataRConnector, High Availability Hadoop, HBase to Hive, etc. to the open source ecosystem.
|
||||
|
||||
Infosys has executed a Corporate Contributor License Agreement (CCLA) with the Cloud Native Computing Foundation (CNCF) and is actively participating in the Kubernetes project. We have made over 50 contributions in Kubernetes in the form of bug fixes, blogs and query responses. Apart from Kubernetes, Infosys has also contributed to PostgreSQL, Elastic, Couchbase, Apache Beam and Neo4J communities. Infosys has also collaborated with the Microsoft product engineering team to enable PostgreSQL and MariaDB in Azure Data Services. This is one focus area of our open source practice. There are many more contributions in the pipeline.
|
||||
|
||||
**Q. Does Infosys motivate its employees to contribute back to the open source ecosystem or is it their individual decision?**
|
||||
**A.** It’s both. Infosys motivates employees to contribute to the open source ecosystem. We conduct internal and external events. Kubernetes Day was organized at Infosys Bengaluru this March, where thousands of people participated. We invited some industry-level open source contributors to share their open source journey and experiences. These talks were webcast to all Infoscions across locations. We have a reward and recognition process to acknowledge and appreciate open source contributors.
|
||||
|
||||
**Q. Is there a shortage of skilled professionals? Are there any specific skillsets that are badly needed, even in countries like India?**
|
||||
**A.** The average age of an S&P 500 company is under 20 years, down from 60 years in the 1950s, according to Credit Suisse. This trend is accelerating and the leading reason for this is the disruptive nature of new technologies.
|
||||
|
||||
As per a 2018 Gartner survey, talent shortage ranks third among the Top 5 business risks. Digital transformation initiatives have increased this pressure and companies are finding that retaining and hiring talent with niche skills is a key challenge.
|
||||
|
||||
Today, just 20 per cent of the current workforce has the skills required for 60 per cent of the future jobs – those that will be available in the next five to ten years. The unprecedented scale at which new technologies are getting adopted into the mainstream due to the competitive edge they provide makes it almost impossible to find talent at scale on these technologies.
|
||||
|
||||
Catering to the skills diversity needed in an organization and hiring/retaining people are key challenges. In this new harsh reality, hiring talent that is passionate about learning becomes more important than finding talent with the right skills.
|
||||
At Infosys, we are trying to address this challenge through a combination of hiring and reskilling.
|
||||
|
||||
**Q. What would be your advice to tech professionals who want to benefit from these opportunities but don’t know where to start?**
|
||||
**A.** My advice to tech professionals is straightforward; we are living in exciting times with limitless opportunities. Never before in the history of humanity have we seen such democratization of knowledge and technology, as today. There is no defined starting line, but what is most important is to learn and apply the knowledge in real business problems continuously. Knowledge begets knowledge, if shared with a broader community. So we should also look at sharing knowledge through contributions, participation at various forums and collaboration. At Infosys, we have always believed and invested heavily in learning, and we have enabled our employees to learn anytime, anywhere, through our mobile learning platform, LEX, which has over 40K resources and 600+ courses. Employees are also encouraged to and recognised for sharing their knowledge, both externally and internally. We are collaborating with our strategic partners to contribute to open source communities jointly. As we speak, we are working with one of our partners to launch an open source academy.
|
||||
|
||||
**Q. Has there been an increase in the number of open source related professionals being hired at Infosys?**
|
||||
**A.** We are seeing a huge demand for open source technologies and most of our Top 200 clients are increasingly moving their legacy systems to open source technologies. We use a combination of refactoring our existing talent pool and hiring to meet the demand.
|
||||
|
||||
![Avatar][3]
|
||||
|
||||
[Rahul Chopra][4]
|
||||
|
||||
The author is the Editor-in-Chief of Open Source For You magazine.
|
||||
|
||||
[![][5]][6]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensourceforu.com/2019/11/we-follow-a-holistic-approach-to-drive-open-source-adoption-across-the-client-base-at-infosys/
|
||||
|
||||
作者:[Rahul Chopra][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://opensourceforu.com/author/rahul-chopra/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Gautam-Khanna-VP-head-modernization-practice-Infosys.jpg?resize=500%2C627&ssl=1 (Gautam Khanna, VP & head - modernization practice, Infosys)
|
||||
[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/11/Gautam-Khanna-VP-head-modernization-practice-Infosys.jpg?fit=500%2C627&ssl=1
|
||||
[3]: https://secure.gravatar.com/avatar/372bbe65753ca17bcceb2b0e9692af8f?s=100&r=g
|
||||
[4]: https://opensourceforu.com/author/rahul-chopra/
|
||||
[5]: https://opensourceforu.com/wp-content/uploads/2019/11/assoc.png
|
||||
[6]: https://feedburner.google.com/fb/a/mailverify?uri=LinuxForYou&loc=en_US
|
@ -0,0 +1,111 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (My Linux story: Covering open source in Spanish)
|
||||
[#]: via: (https://opensource.com/article/19/11/linux-open-source-spanish)
|
||||
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
|
||||
|
||||
My Linux story: Covering open source in Spanish
|
||||
======
|
||||
Meet Lorenzo Carbonell, who brings GNU/Linux and open source to the
|
||||
Spanish-speaking community through his blog site, El Atareao, and
|
||||
applications.
|
||||
![Guy on a laptop on a building][1]
|
||||
|
||||
From time to time, when I'm looking for some help on how to do something on my GNU/Linux desktop or server, I'll come across an article or conversation in a language other than English. If that language happens to be French or Spanish, that's fine for me. If it's in Portuguese or Italian, I can stumble through it. And, for other languages, occasionally, I'll give one of those online AI translators a go in the hopes of gleaning something useful.
|
||||
|
||||
But for folks who are comfortable only in English, I suspect that many potentially useful (and sometimes very entertaining) sources are unknown and ignored. And what are the options for people who aren't comfortable in English, when so much that is written about open source (and many other topics) is in English?
|
||||
|
||||
Last year, while researching [open source music players][2], I had the good fortune to stumble on [El Atareao – Linux para legos][3], a well-written, gorgeously illustrated Castilian Spanish blog that focuses on GNU/Linux and open source topics. El Atareao contains tutorials, discussions about applications, and podcasts. Its author, Lorenzo Carbonell, writes beautifully clear and entertaining text and generously shares his accumulating wisdom in a very practical form. He also develops open source applications, including LPlayer, which is how I found his blog.
|
||||
|
||||
I had a discussion with Lorenzo about what it takes to create a great non-English, open source-oriented blog. Here is our conversation, translated from Spanish and edited for clarity.
|
||||
|
||||
**Q: Lorenzo, I've been a fan of your blog since May 2018. I like everything about it—very interesting articles, solid content, beautiful images, great design overall. What motivated you to start this fine project? And what motivates you today?**
|
||||
|
||||
**A:** I got to know GNU/Linux at university about 25 years ago; it attracted my attention, and I used it for several months. For whatever reason—maybe I wasn't sufficiently prepared, maybe the distribution, Slackware, was too much for me—I decided to abandon it when I started working. However, it stuck in my memory.
|
||||
|
||||
About 10 years ago, I was tired of bringing office work home, and I decided to come up with a solution. At that moment, some recollection of that GNU/Linux operating system came back to me, and I thought using a different operating system might be the solution. The incompatibility between the two would make it hard to bring work home, I thought.
|
||||
|
||||
I chose Ubuntu as my platform, and this distribution has stayed with me until today, a distribution that showed me my mistake: With Ubuntu, or really any other distro, I can still do office work at home!
|
||||
|
||||
Yes, in the beginning, I had some difficulties. And these difficulties were what led to the birth of Atareao.es, because that was where I posted the lessons I learned from this incredible operating system.
|
||||
|
||||
Using an open source operating system, which provides the opportunity to get into the guts of the system and adapt its functions to my needs, stole my heart. Implementing applications like [LPlayer][4], [Touchpad-Indicator][5], or [My Weather Indicator][6] and seeing other people finding them useful filled me with satisfaction. Not only the satisfaction of implementing applications and bringing them to the attention of other users through Atareao.es, but also the satisfaction of being able (or at least trying) to show the potential of this operating system. The potential of this operating system is that it allows you to do almost anything you can imagine, for the simple reason that the code is there and available so that you can study it and adapt it to your needs.
|
||||
|
||||
What motivates me? To have an operating system with so much potential; that is the great unknown. This is what motivates me: having successes to shout to the four winds to let everyone know. And once everyone knows, each one can decide. This is one of the reasons for free applications that can make life simpler or at least help the newly arrived.
|
||||
|
||||
**Q: Please explain the name "El Atareao"… is it local slang? I understand "el atareado" (the busy person).**
|
||||
|
||||
**A:** "El Atareao" was something that arose from work 10 years ago. At that time, I was always busy with work. A close friend mentioned that phrase to me, and it branded itself in my mind. Now it's "el atareao" that will support the company. And to honor and respect this, I used the name for this site.
|
||||
|
||||
So with respect to "atareao" in place of "atareado," effectively it's local slang.
|
||||
|
||||
**Q: So when you aren't "atareao," what do you do? Are you a software developer? Do you work in open source by day?**
|
||||
|
||||
**A:** Currently, I'm working as a developer and in part as a system administrator. And I must say that this came about thanks to Atareao.es. Before, I was working in something completely and totally different, but software development has been my passion. And so, relatively recently, a visionary (or a crazy person) rescued me from my old job and brought me to this incredible world of development, where you can convert anything you can imagine to reality. I say "visionary" because he knew how to see what I could not, and "crazy" because he has to be really bold to make that bet. Today I'm like a kid in a candy store.
|
||||
|
||||
**Q: Your articles provide a solid amount of useful detail. For example, this [article about Rsync][7]. How do you decide on a topic? How do you determine your readers' level of ability so you can write in a way they can understand?**
|
||||
|
||||
**A:** Normally, the articles arise from my need to solve a problem or a situation that I'm facing or that someone has contacted me to ask for help. Though the latter is less common because interactivity in the world 2.0 is not always what I, and I suppose others, would like.
|
||||
|
||||
The objective of any article is to be sufficiently detailed so that any person reading it can reproduce it and can succeed at putting the material to work. It's very frustrating to read an article about some technology that is apparently really simple and not be able to make it work—because the person who wrote the article did not try it out, or because it's vaguely documented, or because it's explained in a technically excessive manner.
|
||||
|
||||
My objective is to try to acquaint as many people as possible to the greatest extent possible with this operating system. How can I tell you about something if you can't make it work because I didn't explain it sufficiently or with enough detail? When someone writes to me and tells me they were unable to follow something or that it wasn't well explained or that there is some error, it makes me very uneasy and motivates me to write better, to strengthen myself, to study more, to learn.
|
||||
|
||||
With respect to the readers' level of ability, this is probably my biggest worry. I know that the majority who read Atareao.es are beginners or "legos" (in the sense of not being professionals), and I try to orient myself to these people. Nevertheless, some of the readers are professionals and are quite challenging to satisfy. In whatever way, I always try for the most straightforward and simple result. Or, at least to be sufficiently clear, so that I can understand it without problems.
|
||||
|
||||
**Q: Do you have other hobbies apart from this blog?**
|
||||
|
||||
**A:** Currently, the blog, the podcast, and developing applications absorb nearly all of my free time. An article or a podcast takes a couple of hours. Creating an application never ends and sucks up all my available time.
|
||||
|
||||
But one hobby that I am dedicated to is running; this is something I do every day or nearly so. And so, as I mention in the "[Who am I?][8]" section of the blog, if one day you visit Silla, the town in Valencia where I live, early in the morning, you can find me on my running circuits. When we travel, which is the other hobby that I have and share with my wife, my running shoes and my laptop always come with me. You can always find me traveling or running or sitting in a coffee shop writing an article.
|
||||
|
||||
**Q: As someone who is not a native speaker of (Castilian) Spanish, I nevertheless enjoy your use of the language; I feel that how one expresses oneself is as important as what is written. Can you elaborate on this?**
|
||||
|
||||
**A:** It seems to me very important that an article, whether it's technical or not, should have the best possible wording. And not only to be correct, syntactically and semantically, but to be able to tell a story, a story that engages.
|
||||
|
||||
For this reason, whenever I can, I try to write the technical article within an experience, a situation, or a circumstance that has happened to me. From my perspective, writing about real, daily successes that frame a technical article works better for readers and makes them feel much more involved.
|
||||
|
||||
**Q: There are a lot of people who prefer information in their mother tongue. As someone who writes in Spanish, what do you think about this issue? Do you have any idea of the level of demand for information about open source software in Spanish?**
|
||||
|
||||
**A:** I think that Spanish speakers, and especially those born in Spain, prefer (Castilian) Spanish as their working language. In Spain, they don't teach us English; rather, they teach us how to pass the English course, which is a real shame. I would enjoy speaking, writing, and expressing myself in English as well as you, but there isn't a means, despite the fact that every day, I consume more video and audio in English, and every day I push myself more with it. I need English more and more; I need to develop myself better in this language.
|
||||
|
||||
With respect to the demand for open source software in Spanish, as far as I understand, it's very low, too low for my liking. In general, open source software is the unknown. Few know Linux, and few understand that it's what is behind open source software. A significant number come at first for the simple fact that it's free. This is a great advantage because it's a way to first approach open source. Nevertheless, it's necessary to go deeper, to take a radical turn, because to the Spanish speaker, or at least to the Spaniard, when something is free or very cheap, it seems that it is of low quality. And "free" software is not synonymous with "no cost"; it must be defined based on its high quality.
|
||||
|
||||
**Q: Where is** **El Atareao** **going in the future? More podcasts? YouTube channels? Adding other authors? Syndicated content?**
|
||||
|
||||
**A:** Where is Atareao.es going? I know where I'd like it to go. I'd like to dedicate myself to it full time. I'd like to live on [income from] the site, although I know that's really difficult. One approach that I'm exploring is to convert it to a membership site, although providing the content for free. This is something that I need to keep working on.
|
||||
|
||||
As a part of this, I'm trying to participate in related events and give talks at conferences. I started down this road last year at [Ubucon][9] Europe 2018, I continued this year, and next year I'd like to deepen this involvement. "De-virtualization" is important, putting faces to names, seeing that open source software isn't something far away, distant, or cold; quite the contrary.
|
||||
|
||||
In the short term, I'd like to work on my [YouTube channel][10] while working on talks and attending conferences. I'm planning to start a series on YouTube, although I don't have it completed, and only my wife and now you (all) know about it.
|
||||
|
||||
### Conclusion
|
||||
|
||||
Thanks very much, Lorenzo, for taking the time to share your thoughts with us, and best wishes for the continued success of El Atareao.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/11/linux-open-source-spanish
|
||||
|
||||
作者:[Chris Hermansen][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/clhermansen
|
||||
[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 (Guy on a laptop on a building)
|
||||
[2]: https://opensource.com/article/18/6/open-source-music-players
|
||||
[3]: https://www.atareao.es/
|
||||
[4]: https://github.com/atareao/lplayer
|
||||
[5]: https://github.com/atareao/Touchpad-Indicator
|
||||
[6]: https://github.com/atareao/my-weather-indicator
|
||||
[7]: https://www.atareao.es/podcast/sincronizacion-en-red-y-vpn/
|
||||
[8]: https://www.atareao.es/quien-soy/
|
||||
[9]: https://wiki.ubuntu.com/Ubucon
|
||||
[10]: https://www.youtube.com/c/atareao
|
@ -1,262 +0,0 @@
|
||||
luming translating
|
||||
23 open source audio-visual production tools
|
||||
======
|
||||
|
||||

|
||||
|
||||
Open source is well established in cloud infrastructure, web hosting, embedded devices, and many other areas. Fewer people know that open source is a great option for producing professional-level audio-visual materials.
|
||||
|
||||
As a product owner and sometimes marketing support person, I produce a lot of content for end users: documentation, web articles, video tutorials, event booth materials, white papers, interviews, and more. I have found plenty of great open source software that helps me do my job producing audio, video, print, and screen graphics. There are a lot of [reasons][1] that people choose open source over proprietary options, and I've compiled this list of open source audio and video tools for people who:
|
||||
|
||||
* want to switch to GNU/Linux, but need to start slowly with cross-platform software on their regular operating system;
|
||||
* are already open source enthusiasts, but are new to open source A/V software and want to know which options to trust;
|
||||
* want to discover new tools to fuel their creativity and don't want to use the same approaches or software everyone else uses; or
|
||||
* have some other reason to use open source A/V solutions (if this is you, share your reason in the comments).
|
||||
|
||||
|
||||
|
||||
Fortunately, there is a lot of open source software available for A/V creators, as well as hardware that supports those applications. All of the software on this list meets the following criteria:
|
||||
|
||||
* cross-platform
|
||||
* open source (for software and drivers)
|
||||
* stable
|
||||
* actively maintained
|
||||
* well documented and supported
|
||||
|
||||
|
||||
|
||||
I've divided this list into graphics, audio, video, and animation solutions. Note that the software applications in this article are not exact equivalents of well-known proprietary software, they'll require you to learn new applications, and you may need to modify your workflow, but learning new tools enables you to create differently.
|
||||
|
||||
### Graphics
|
||||
|
||||
I create a lot of graphics for print and web, including logos, banners, video titles, and mockups. Here are some of the open source applications I use, as well as the hardware I use with them.
|
||||
|
||||
#### Software
|
||||
|
||||
**1.[Inkscape][2]** (vector graphics)
|
||||
Inkscape is a good vector graphics editor for creating SVG and PDF files in the RGB color space. (It can create CMYK images, but that's not the main aim.) It's a lifesaver for manipulating SVG maps and charts for web applications; not only can you open files with the integrated XML editor, you can also see all of an object's parameters. One drawback: it is not well optimized on Mac. For examples, see [Inkscape's gallery][3].
|
||||
|
||||
**2.[GIMP][4]** (picture editor)
|
||||
GIMP is my favorite application to edit images, including manipulating color, cropping and resizing, and (especially) optimizing file size for the web (many of my Photoshop-using colleagues ask me to do that last step for them). You can also create and draw images from scratch, but GIMP is not my favorite tool for that. See [GIMP Artists on DeviantArt][5] for examples.
|
||||
|
||||
**3.[Krita][6]** (digital painting)
|
||||
So you have this beautiful Wacom drawing tablet on your desk, and you want to try a true digital painting application? Krita is what you need to create beautiful drawings and paintings. See [Krita's Gallery][7] to see what I mean.
|
||||
|
||||
**4.[Scribus][8]** (desktop publishing)
|
||||
You can use Scribus to create a complete document, or just to convert a PDF from Inkscape or Libre Office from RGB to CMYK. One feature I really like: You can simulate and check what people with visual disabilities will experience with a Scribus document. I count on Scribus when I send PDF files to a commercial printer. While printing companies may be used to files created with proprietary solutions like InDesign, if your Scribus file is done correctly, your printer won't have any issues. Free trick: The first time you send a file, don't tell the printer the name of the software you used to create it. See [Made with Scribus][9] for examples of documents created with this software.
|
||||
|
||||
**5.[RawTherapee][10]** (RAW image photo development)
|
||||
RawTherapee is the only completely cross-platform alternative to Lightroom I know of. You can use your camera in RAW mode, and then use RawTherapee to "develop" your picture. It provides a very powerful engine and a non-destructive editor. For examples, see [RawTherapee screenshots][11].
|
||||
|
||||
**6.[LibreOffice Draw][12]** (desktop publishing)
|
||||
Although you may not think of LibreOffice Draw as a professional desktop publishing solution, it can save you in many situations; for example, if you are creating whitepapers, diagrams, or posters that other people (even those who don't know graphics software) can update later. Not only is it easy to use, it's also a great alternative to Impress or PowerPoint for creating interesting documents.
|
||||
|
||||
#### Graphics hardware
|
||||
|
||||
**Graphics tablets**
|
||||
[Wacom][13] tablets (and compatibles) are usually well supported on all operating systems.
|
||||
|
||||
**Color calibration**
|
||||
Color calibration products are available on all operating systems, including GNU/Linux. The [Spyder][14] products by Datacolor are well supported with applications for all platforms.
|
||||
|
||||
**Scanners and printers**
|
||||
Graphic artists need the colors they output (whether print or electronic) to be accurate. But devices that are truly cross-platform, with easy-to-install drivers for all platform, are not as common as you'd think. Your best choices are scanners that are compatible with TWAIN and printers that are compatible with Postscript. In my experience, professional-range printers and scanners from Epson and Xerox are less likely to have driver issues, and they always work out of the box, with beautiful and accurate colors.
|
||||
|
||||
### Audio
|
||||
|
||||
There are plenty of open source audio software options for musicians, video makers, game makers, music publishers, and others. Here are the ones that I've used for content creation and audio recording.
|
||||
|
||||
#### Software
|
||||
|
||||
**7. [Ardour][15] **(digital audio recording)
|
||||
For recording and editing audio, the best alternative to the professional Pro Tools music-creation software is, hands down, Ardour. It sounds great, the mixer section is complete and flexible, it supports your favorite plugins, and it makes it very easy to edit, listen, and compare your modifications. I use it a lot for audio recording or mixing sound on videos. It's not easy to find music recorded with Ardour, because musicians rarely credit the software they use. However, you can get an idea of its capabilities by looking at its [features and screenshots][16].
|
||||
|
||||
(If you are looking for an "analog feeling" in term of sound and workflow, you can try [Harrison Mixbus][17], which is not an open source project, but is heavily based on Ardour, with Harrison's analog console emulator. I really like to work with it and my customers like the sound. Mixbus is cross platform.)
|
||||
|
||||
**8.[Audacity][18]** (audio editing)
|
||||
Audacity is the "Swiss Army knife" of audio software. It's not perfect, but you can do almost everything with it. Plus it's very easy to use, and anyone can learn it in a few minutes. Like Ardour, it's hard to find work credited to Audacity, but you can find ways to use it on these [screenshots][19].
|
||||
|
||||
**9.[LMMS][20]** (music production)
|
||||
LMMS, designed as an alternative to FL Studio, might not be as popular, but it is very complete and easy to use. You can use your favorite plugins, edit instruments using "piano roll" sequencing, play drum samples with a step sequencer, mix your tracks ... almost anything is possible. I use it to create audio loops for videos when I don't have the time to record musicians. See [The Best of LMMS][21] playlists for examples.
|
||||
|
||||
**10.[Mixxx][22]** (DJ, music mixing)
|
||||
If you need powerful software to mix music and play DJ, Mixx is the one to use. It's compatible with most MIDI controllers, timecoded discs, and dedicated sound cards. You can manage your music library, add effects, and have fun. Take a look at the [features][23] to see how it works.
|
||||
|
||||
#### Audio interface hardware
|
||||
|
||||
While you can record audio with any computer's sound card, to record well, you need an audio interface—a specialized type of external sound card that records high-quality audio input. For cross-platform compatibility, most "USB Class Compliant" or "compatible with iOS" audio interface devices should work for MIDI or other audio. Below is a list of cross-platform devices I use and know well.
|
||||
|
||||
**[Behringer U-PHORIA UMC22][24]**
|
||||
The UMC22 is the cheapest option you should consider. With less expensive options, the preamps are too noisy and the quality of the box is very low.
|
||||
|
||||
**[Presonus AudioBox USB][25]**
|
||||
The AudioBox USB is one of the first USB Class Compliant (and thereby cross-platform) recording systems out there. It is very robust and available on the second-hand market.
|
||||
|
||||
**[Focusrite Scarlett][26]**
|
||||
The Scarlett range is, in my opinion, the highest quality cross-platform sound card available. The various options range from devices with two to 18 input/outputs. You can find first-version models on the second-hand market, and the new second version offers better preamps and specs. I've worked a lot with the [2i2][27] model.
|
||||
|
||||
**[Arturia AudioFuse][28]**
|
||||
The AudioFuse allows you to plug in nearly anything, from a microphone to a vinyl disc player to various digital inputs. It provides both great sound and great design, and it's what I'm using the most now. It is cross-platform, but the configuration software is not yet available for GNU/Linux. It remembers my configuration even after I unplug it from my Windows PC, but really, Arturia, please be serious and make the software available for GNU/Linux.
|
||||
|
||||
#### MIDI controllers
|
||||
|
||||
A MIDI controller is a musical instrument—e.g., keyboards, drum pads, etc.—that allow you to control music software and hardware. Most of the recent USB MIDI controllers are cross-platform and compatible with the main software used to record and edit audio. Web-based tutorials will help you configure them for different software; although it may be harder to find info on GNU/Linux configurations, they will work. I've used many Akai and M-Audio devices without any issues. It's best to try a musical instrument before you buy, at least to listen to the sound quality or to touch the buttons.
|
||||
|
||||
#### Audio codecs
|
||||
|
||||
Audio codecs compress and decompress digital audio to deliver the best-quality audio at the smallest possible file size. Fortunately, the best codec for listening and streaming happens to be open source: [FLAC][29]. [Ogg Vorbis][30] is another open source audio codec worth checking out; it's far better than MP3 at the same bitrate. If you need to export audio in different file formats, I recommend always exporting and archiving audio at the best possible quality, then compressing a specific version if it's needed.
|
||||
|
||||
### Video
|
||||
|
||||
The impact of video in brand communications is significant. Even if you are not a video specialist, it's smart to learn the basics.
|
||||
|
||||
#### Software
|
||||
|
||||
**11.[VLC][31]** (video player and converter)
|
||||
Originally developed for media streaming, VLC is now known for its ability to read all video formats on all devices. It's very useful; for example, you can also use it to convert a video into another codec or container or to recover a broken video.
|
||||
|
||||
**12.[OpenShot][32]** (video editor)
|
||||
OpenShot is simple software that produces great results, especially for short videos. (It is a bit limited in terms of editing or improving the sound of a video, but it will do the job.) I especially like the tool to move, resize, or crop a clip; it's perfect to create intros and outros that you can export, then use in a more complex editor. You can see [examples][33] (and get more information) on OpenShot's website.
|
||||
|
||||
**13.[Shotcut][34]** (video editor)
|
||||
I think Shotcut is a bit more complete than OpenShot—it's a very good competitor to the basic editors in your operating system, and it supports 4K and professional codecs. Give it a try, I think you will love it. You can see examples in these [video tutorials][35].
|
||||
|
||||
**14.[Blender Velvets][36]** (vdeo editing, compositing, effects)
|
||||
While the learning curve is not the lightest on this list, Blender Velvets is one of the most powerful solutions you will find. It is a collection of extensions and scripts, created by movie makers, that transform the Blender 3D creation software into a 2D video editor. While it's complexity means it's not my top choice for video editing, you can find plenty of tutorials on YouTube and other sites, and once you learn it, you can do everything with this software. Watch this [tutorial video][37] to see its functions and how it works.
|
||||
|
||||
**15.[Natron][38]** (compositing)
|
||||
I don't use Natron, but I've gotten great feedback from people who do. It's an alternative to Adobe's After Effects, but works differently. To learn more, watch a few video tutorials, like these on [Natron's YouTube][39] channel.
|
||||
|
||||
**16.[OBS][40]** (live editing, recording, and streaming)
|
||||
Open Broadcaster Software (OBS) is the leading solution for recording or [livestreaming][41] e-sports and video games on YouTube or Twitch. I use it a lot to record users' screens, conferences, meetups, etc. For more information, see the tutorial I wrote for Opensource.com about recording live presentations, [Part 1: Choosing your equipment][42] and [Part 2: Software setup][43].
|
||||
|
||||
#### Video hardware
|
||||
|
||||
First things first: You will need a powerful workstation with a fast hard drive and updated software and drivers.
|
||||
|
||||
**Graphics processing unit (GPU)**
|
||||
Some software on this list, including Blender and Shotcut, use OpenGL and hardware acceleration, which have high GPU demands. I recommend the most powerful GPU you can afford. I've had good experience with AMD and Nvidia, depending on the platform. Don't forget to install the latest drivers.
|
||||
|
||||
**Hard drives**
|
||||
In general, the faster and bigger the hard drive, the better it is for video. Don't forget to configure your software to use the right path.
|
||||
|
||||
**Video capture hardware**
|
||||
|
||||
* [Blackmagic Design][44]: Blackmagic provides very good, professional-grade video capture and playback hardware. Drivers are available for Mac, Windows, and GNU/Linux (but not all distributions).
|
||||
* [Epiphan][45]: Among Epiphan's professional USB video capture devices is a new USB Class Compliant model for HDMI and high screen resolutions. However, you can find the older VGA devices on the secondhand market, for which they continue to provide dedicated drivers for GNU/Linux and Windows.
|
||||
|
||||
|
||||
|
||||
#### Video codecs
|
||||
|
||||
Unfortunately, it is still difficult to work with open source codecs. For example, many cameras use proprietary codecs to record videos in H.264 and sound in AC3, in a format called AVCHD. Therefore, we have to be pragmatic and use what is available.
|
||||
|
||||
The good news is that the content industry is moving to open source codecs to avoid fees and to use open standards. For distribution and streaming, [Google'][46][s WebM][46] is a good open source codec, and most video editors can export in that format. Also, [GoPro's][47][Cineform][47] codec for very high resolution and 360° video is now open source. Hopefully more devices and vendors will use it soon.
|
||||
|
||||
### 2D and 3D animation
|
||||
|
||||
Animation is not my field of expertise, so I've asked my friends who are working on animated content, including movies and series for kids, for their recommendations to compile this list.
|
||||
|
||||
#### Software
|
||||
|
||||
**17. [Blender][48] **(3D modeling and rendering)
|
||||
Blender is the top open source and cross-platform software for 3D modeling and rendering. You can do your entire project directly in Blender, or use it to create 3D effects for a movie or video. You will find a lot of video tutorials on the web, so even though it isn't simple software, it's very easy to get started. Blender is a very active project and regularly produces short movies to showcase the technology. You can see some of them on [Blender Open Movies][49].
|
||||
|
||||
**18.[Synfig Studio][50]** (2D animation)
|
||||
The first time I used Synfig, it reminded me of the good, old Macromedia Flash editor. Since then, it has grown into a full-featured 2D animation studio. You can use it to produce promotional stories, commercials, presentations, or original intros, outros, and transitions for your videos, or even to work on full animated movies. See [Synfig's portfolio][51] for some examples.
|
||||
|
||||
**19.[TupiTube][52]** (stop-motion, 2D animation)
|
||||
TupiTube is an excellent way to learn the basics of 2D animation. You can transform a set of drawings or other pictures into a video or create an animated GIF or small loops. It's quite simple software, but very complete. Check out [TupiTube's YouTube][53] channel for some tutorials and examples.
|
||||
|
||||
#### Hardware
|
||||
|
||||
Animation uses the same hardware as graphic design, so look at the hardware list in the first section of this article for recommendations.
|
||||
|
||||
One additional note: You will need a powerful GPU for 3D modeling and rendering. The choices can be limited, depending on your platform or PC maker, but don't forget to install the latest drivers. Carefully choose your graphics card: they are expensive and critical for big 3D projects, particularly in the rendering step.
|
||||
|
||||
### Linux options
|
||||
|
||||
If you are a GNU/Linux user, I have some more good options for you. They aren't fully cross-platform, but some of them have a Windows installer, and some can be installed on Mac with Macports.
|
||||
|
||||
**20.[Kdenlive][54]** (video editor)
|
||||
With its last release (a few months ago), Kdenlive became my favorite video editor, especially when I work on a long video on my Linux machine. If you are a regular user of popular non-linear video editors, Kdenlive (which stands for KDE Non-Linear Video Editor) will be easy for you to use. It has good video and audio effects, is great when you need to work on details, and works on BSD and MacOS (although it's aimed at GNU/Linux) and is being ported to Windows.
|
||||
|
||||
**21.[Darktable][55]** (RAW development)
|
||||
Darktable is a very complete alternative to DxO that is made by photographers for photographers. Some research projects are using it as a platform for development and testing of new image processing algorithms. It is a very active project, and I can't wait until it becomes truly cross-platform.
|
||||
|
||||
**22.[MyPaint][56]** (digital painting)
|
||||
MyPaint is like a light table for digital painting. It works well with Wacom devices, and its brush engine is particularly appreciated, so GIMP developers are looking closely at it.
|
||||
|
||||
**23.[Shutter][57]** (desktop screenshots)
|
||||
When I create tutorials, I use a lot of screenshots to illustrate them. My favorite screenshot tool for GNU/Linux is Shutter; actually, I can't find an equivalent in terms of features for Windows or Mac. One missing piece: I would like to see Shutter add a feature to create animated GIF screenshots over a few seconds.
|
||||
|
||||
I hope this has convinced you that open source software is an excellent, viable solution for A/V content producers. If you are using other open source software—or have advice about using cross-platform software and hardware—for audio and video projects, please share your ideas in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/2/open-source-audio-visual-production-tools
|
||||
|
||||
作者:[Antoine Thomas][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/ttoine
|
||||
[1]:https://opensource.com/resources/what-open-source
|
||||
[2]:https://inkscape.org/
|
||||
[3]:https://inkscape.org/en/gallery/
|
||||
[4]:https://www.gimp.org/
|
||||
[5]:https://gimp-artists.deviantart.com/gallery/
|
||||
[6]:https://krita.org/
|
||||
[7]:https://krita.org/en/features/gallery/
|
||||
[8]:https://www.scribus.net/
|
||||
[9]:https://www.scribus.net/category/made-with-scribus/
|
||||
[10]:http://rawtherapee.com/
|
||||
[11]:http://rawtherapee.com/blog/screenshots
|
||||
[12]:https://www.libreoffice.org/discover/draw/
|
||||
[13]:http://www.wacom.com/en-us
|
||||
[14]:http://www.datacolor.com/photography-design/product-overview/#workflow_2
|
||||
[15]:https://www.ardour.org/
|
||||
[16]:http://ardour.org/features.html
|
||||
[17]:http://harrisonconsoles.com/site/mixbus.html
|
||||
[18]:http://www.audacityteam.org/
|
||||
[19]:http://www.audacityteam.org/about/screenshots/
|
||||
[20]:https://lmms.io/
|
||||
[21]:https://lmms.io/showcase/
|
||||
[22]:https://www.mixxx.org/
|
||||
[23]:https://www.mixxx.org/features/
|
||||
[24]:http://www.musictri.be/Categories/Behringer/Computer-Audio/Interfaces/UMC22/p/P0AUX
|
||||
[25]:https://www.presonus.com/products/audiobox-usb
|
||||
[26]:https://us.focusrite.com/scarlett-range
|
||||
[27]:https://us.focusrite.com/usb-audio-interfaces/scarlett-2i2
|
||||
[28]:https://www.arturia.com/products/audio/audiofuse/overview
|
||||
[29]:https://en.wikipedia.org/wiki/FLAC
|
||||
[30]:https://xiph.org/vorbis/
|
||||
[31]:https://www.videolan.org/
|
||||
[32]:https://www.openshot.org/
|
||||
[33]:https://www.openshot.org/videos/
|
||||
[34]:https://shotcut.com/
|
||||
[35]:https://shotcut.org/tutorials/
|
||||
[36]:http://blendervelvets.org/
|
||||
[37]:http://blendervelvets.org/video-tutorial-new-functions-for-the-blender-velvets/
|
||||
[38]:https://natron.fr/
|
||||
[39]:https://www.youtube.com/playlist?list=PL2n8LbT_b5IeMwi3AIzqG4Rbg8y7d6Amk
|
||||
[40]:https://obsproject.com/
|
||||
[41]:https://opensource.com/article/17/7/obs-studio-pro-level-streaming
|
||||
[42]:https://opensource.com/article/17/9/equipment-recording-presentations
|
||||
[43]:https://opensource.com/article/17/9/equipment-setup-live-presentations
|
||||
[44]:https://www.blackmagicdesign.com/
|
||||
[45]:https://www.epiphan.com/
|
||||
[46]:https://www.webmproject.org/
|
||||
[47]:https://fr.gopro.com/news/gopro-open-sources-the-cineform-codec
|
||||
[48]:https://www.blender.org/
|
||||
[49]:https://www.blender.org/about/projects/
|
||||
[50]:https://www.synfig.org/
|
||||
[51]:https://www.synfig.org/#portfolio
|
||||
[52]:https://maefloresta.com/
|
||||
[53]:https://www.youtube.com/channel/UCBavSfmoZDnqZalr52QZRDw
|
||||
[54]:https://kdenlive.org/
|
||||
[55]:https://www.darktable.org/
|
||||
[56]:http://mypaint.org/
|
||||
[57]:http://shutter-project.org/
|
@ -1,118 +0,0 @@
|
||||
Must-Have Tools for Writers on the Linux Platform
|
||||
======
|
||||
|
||||

|
||||
I’ve been a writer for more than 20 years. I’ve written thousands of articles and how-tos on various technical topics and have penned more than 40 works of fiction. So, the written word is not only important to me, it’s familiar to the point of being second nature. And through those two decades (and counting) I’ve done nearly all my work on the Linux platform. I must confess, during those early years it wasn’t always easy. Formats didn’t always mesh with what an editor required and, in some cases, the open source platform simply didn’t have the necessary tools required to get the job done.
|
||||
|
||||
That was then, this is now.
|
||||
|
||||
A perfect storm of Linux evolution and web-based tools have made it such that any writer can get the job done (and done well) on Linux. But what tools will you need? You might be surprised to find out that, in some instances, the job cannot be efficiently done with 100% open source tools. Even with that caveat, the job can be done. Let’s take a look at the tools I’ve been using as both a tech writer and author of fiction. I’m going to outline this by way of my writing process for both nonfiction and fiction (as the process is different and requires specific tools).
|
||||
|
||||
A word of warning to seriously hard-core Linux users. A long time ago, I gave up on using tools like LaTeX and DocBook for my writing. Why? Because, for me, the focus must be on the content, not the process. When you’re facing deadlines, efficiency must take precedent.
|
||||
|
||||
### Nonfiction
|
||||
|
||||
We’ll start with nonfiction, as that process is the simpler of the two. For writing technical how-tos, I collaborate with different editors and, in some cases, have to copy/paste content into a CMS. But like with my fiction, the process always starts with Google Drive. This is the point at which many open source purists will check out. Fear not, you can always opt to either keep all of your files locally, or use a more open-friendly cloud service (such as [Zoho][1] or [nextCloud][2]).
|
||||
|
||||
Why start on the cloud? Over the years, I’ve found I need to be able to access that content from anywhere at any time. The simplest solution was to migrate the cloud. I’ve also become paranoid about losing work. To that end, I make use of a tool like [Insync][3] to keep my Google Drive in sync with my desktop. With that desktop sync in place, I know there’s always a backup of my work, in case something should go awry with Google Drive.
|
||||
|
||||
For those clients with whom I must enter content into a Content Management System (CMS), the process ends there. I can copy/paste directly from a Google Doc into the CMS and be done with it. Of course, with technical content, there are always screenshots involved. For that, I use [Gimp][4], which makes taking screenshots simple:
|
||||
|
||||
![screenshot with Gimp][6]
|
||||
|
||||
Figure 1: Taking a screenshot with Gimp.
|
||||
|
||||
[Used with permission][7]
|
||||
|
||||
1. Open Gimp.
|
||||
|
||||
2. Click File > Create > Screenshot.
|
||||
|
||||
3. Select from a single window, the entire screen, or a region to grab (Figure 1).
|
||||
|
||||
4. Click Snap.
|
||||
|
||||
|
||||
|
||||
|
||||
The majority of my clients tend to prefer I work with Google Docs, because I can share folders so that they have reliable access to the content. There are a few clients I have that do not work with Google Docs, and so I must download the files into a format that can be used. What I do for this is download in .odt format, open the document in [LibreOffice][8] (Figure 2), format as needed, save in a format required by the client, and send the document on.
|
||||
|
||||
![Google Doc][10]
|
||||
|
||||
Figure 2: My Google Doc download opened in LibreOffice.
|
||||
|
||||
[Used with permission][7]
|
||||
|
||||
And that, is the end of the line for nonfiction.
|
||||
|
||||
### Fiction
|
||||
|
||||
This is where it gets a bit more complicated. The beginning steps are the same, as I always write every first draft of a novel in Google Docs. Once that is complete, I then download the file to my Linux desktop, open the file in LibreOffice, format as necessary, and then save as a file type supported by my editor (unfortunately, that means .docx).
|
||||
|
||||
The next step in the process gets a bit dicey. My editor prefers to use comments over track changes (as it makes it easier for both of us to read the document as we make changes). Because of this, a 60k word doc can include hundreds upon hundreds of comments, which slows LibreOffice to a useless crawl. Once upon a time, you could up the memory used for documents, but as of LibreOffice 6, that is no longer possible. This means any larger, novel-length, document with numerous comments will become unusable. Because of that, I’ve had to take drastic measures and use [WPS Office][11] (Figure 3). Although this isn’t an open source solution, WPS Office does a fine job with numerous comments in a document, so there’s no need to deal with the frustration that is LibreOffice (when working with these large files with hundreds of comments).
|
||||
|
||||
![comments][13]
|
||||
|
||||
Figure 3: WPS handles numerous comments with ease.
|
||||
|
||||
[Used with permission][7]
|
||||
|
||||
Once my editor and I finish up the edits for the book (and all comments have been removed), I can then open the file in LibreOffice for final formatting. When the formatting is complete, I save the file in .html format and then open the file in [Calibre][14] for exporting the file to .mobi and .epub formats.
|
||||
|
||||
Calibre is a must-have for anyone looking to publish on Amazon, Barnes & Noble, Smashwords, or other platforms. One thing Calibre does better than other, similar, solutions is enable you to directly edit the .epub files (Figure 4). For the likes of Smashword, this is an absolute necessity (as the export process will add elements not accepted on the Smashwords conversion tool).
|
||||
|
||||
![Calibre][16]
|
||||
|
||||
Figure 4: Editing an epub file directly in Calibre.
|
||||
|
||||
[Creative Commons Zero][17]
|
||||
|
||||
After the writing process is over (or sometimes while waiting for an editor to complete a pass), I’ll start working on the cover for the book. That task is handled completely in Gimp (Figure 5).
|
||||
|
||||
![Using Gimp][19]
|
||||
|
||||
Figure 5: Creating the cover of POTUS in Gimp.
|
||||
|
||||
[Used with permission][7]
|
||||
|
||||
And that finishes up the process of creating a work of fiction on the Linux platform. Because of the length of the documents, and how some editors work, it can get a bit more complicated than the process of creating nonfiction, but it’s far from challenging. In fact, creating fiction on Linux is just as simple (and more reliable) than other platforms.
|
||||
|
||||
### HTH
|
||||
|
||||
I hope this helps aspiring writers to have the confidence to write on the Linux platform. There are plenty of other tools available to use, but the ones I have listed here have served me quite well over the years. And although I do make use of a couple of proprietary tools, as long as they keep working well on Linux, I’m okay with that.
|
||||
|
||||
Learn more about Linux in the[ Introduction to Open Source Development, Git, and Linux (LFD201) ][20]training course from The Linux Foundation, and sign up now to start your open source journey.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/learn/2018/11/must-have-tools-writers-linux-platform
|
||||
|
||||
作者:[Jack Wallen][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/users/jlwallen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.zoho.com/
|
||||
[2]: https://nextcloud.com/
|
||||
[3]: https://www.insynchq.com
|
||||
[4]: https://www.gimp.org/
|
||||
[5]: /files/images/writingtools1jpg
|
||||
[6]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/writingtools_1.jpg?itok=Uko7DZ8U (screenshot with Gimp)
|
||||
[7]: /licenses/category/used-permission
|
||||
[8]: https://www.libreoffice.org/
|
||||
[9]: /files/images/writingtools2jpg
|
||||
[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/writingtools_2.jpg?itok=vDgxd8hu (Google Doc)
|
||||
[11]: https://www.wps.com/en-US/
|
||||
[12]: /files/images/writingtools3jpg
|
||||
[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/writingtools_3.jpg?itok=AYrsfz01 (comments)
|
||||
[14]: https://calibre-ebook.com/
|
||||
[15]: /files/images/writingtools4jpg
|
||||
[16]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/writingtools_4.jpg?itok=wFMEsL7b (Calibre)
|
||||
[17]: /licenses/category/creative-commons-zero
|
||||
[18]: /files/images/writingtools5jpg
|
||||
[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/writingtools_5.jpg?itok=e7SZCgip (Using Gimp)
|
||||
[20]: https://training.linuxfoundation.org/training/introduction-to-open-source-development-git-and-linux/?utm_source=linux.com&utm_medium=article&utm_campaign=lfd201
|
@ -1,133 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Can Better Task Stealing Make Linux Faster?)
|
||||
[#]: via: (https://www.linux.com/blog/can-better-task-stealing-make-linux-faster)
|
||||
[#]: author: (Oracle )
|
||||
|
||||
Can Better Task Stealing Make Linux Faster?
|
||||
======
|
||||
|
||||
_Oracle Linux kernel developer Steve Sistare contributes this discussion on kernel scheduler improvements._
|
||||
|
||||
### Load balancing via scalable task stealing
|
||||
|
||||
The Linux task scheduler balances load across a system by pushing waking tasks to idle CPUs, and by pulling tasks from busy CPUs when a CPU becomes idle. Efficient scaling is a challenge on both the push and pull sides on large systems. For pulls, the scheduler searches all CPUs in successively larger domains until an overloaded CPU is found, and pulls a task from the busiest group. This is very expensive, costing 10's to 100's of microseconds on large systems, so search time is limited by the average idle time, and some domains are not searched. Balance is not always achieved, and idle CPUs go unused.
|
||||
|
||||
I have implemented an alternate mechanism that is invoked after the existing search in idle_balance() limits itself and finds nothing. I maintain a bitmap of overloaded CPUs, where a CPU sets its bit when its runnable CFS task count exceeds 1. The bitmap is sparse, with a limited number of significant bits per cacheline. This reduces cache contention when many threads concurrently set, clear, and visit elements. There is a bitmap per last-level cache. When a CPU becomes idle, it searches the bitmap to find the first overloaded CPU with a migratable task, and steals it. This simple stealing yields a higher CPU utilization than idle_balance() alone, because the search is cheap, costing 1 to 2 microseconds, so it may be called every time the CPU is about to go idle. Stealing does not offload the globally busiest queue, but it is much better than running nothing at all.
|
||||
|
||||
### Results
|
||||
|
||||
Stealing improves utilization with only a modest CPU overhead in scheduler code. In the following experiment, hackbench is run with varying numbers of groups (40 tasks per group), and the delta in /proc/schedstat is shown for each run, averaged per CPU, augmented with these non-standard stats:
|
||||
|
||||
* %find - percent of time spent in old and new functions that search for idle CPUs and tasks to steal and set the overloaded CPUs bitmap.
|
||||
* steal - number of times a task is stolen from another CPU. Elapsed time improves by 8 to 36%, costing at most 0.4% more find time.
|
||||
|
||||
|
||||
|
||||
![load balancing][1]
|
||||
|
||||
[Used with permission][2]
|
||||
|
||||
CPU busy utilization is close to 100% for the new kernel, as shown by the green curve in the following graph, versus the orange curve for the baseline kernel:
|
||||
|
||||
![][3]
|
||||
|
||||
Stealing improves Oracle database OLTP performance by up to 9% depending on load, and we have seen some nice improvements for mysql, pgsql, gcc, java, and networking. In general, stealing is most helpful for workloads with a high context switch rate.
|
||||
|
||||
### The code
|
||||
|
||||
As of this writing, this work is not yet upstream, but the latest patch series is at [https://lkml.org/lkml/2018/12/6/1253. ][4]If your kernel is built with CONFIG_SCHED_DEBUG=y, you can verify that it contains the stealing optimization using
|
||||
|
||||
```
|
||||
# grep -q STEAL /sys/kernel/debug/sched_features && echo Yes
|
||||
Yes
|
||||
```
|
||||
|
||||
If you try it, note that stealing is disabled for systems with more than 2 NUMA nodes, because hackbench regresses on such systems, as I explain in [https://lkml.org/lkml/2018/12/6/1250 .][5]However, I suspect this effect is specific to hackbench and that stealing will help other workloads on many-node systems. To try it, reboot with kernel parameter sched_steal_node_limit = 8 (or larger).
|
||||
|
||||
### Future work
|
||||
|
||||
After the basic stealing algorithm is pushed upstream, I am considering the following enhancements:
|
||||
|
||||
* If stealing within the last-level cache does not find a candidate, steal across LLC's and NUMA nodes.
|
||||
* Maintain a sparse bitmap to identify stealing candidates in the RT scheduling class. Currently pull_rt_task() searches all run queues.
|
||||
* Remove the core and socket levels from idle_balance(), as stealing handles those levels. Remove idle_balance() entirely when stealing across LLC is supported.
|
||||
* Maintain a bitmap to identify idle cores and idle CPUs, for push balancing.
|
||||
|
||||
|
||||
|
||||
_This article originally appeared at[Oracle Developers Blog][6]._
|
||||
|
||||
_Oracle Linux kernel developer Steve Sistare contributes this discussion on kernel scheduler improvements._
|
||||
|
||||
### Load balancing via scalable task stealing
|
||||
|
||||
The Linux task scheduler balances load across a system by pushing waking tasks to idle CPUs, and by pulling tasks from busy CPUs when a CPU becomes idle. Efficient scaling is a challenge on both the push and pull sides on large systems. For pulls, the scheduler searches all CPUs in successively larger domains until an overloaded CPU is found, and pulls a task from the busiest group. This is very expensive, costing 10's to 100's of microseconds on large systems, so search time is limited by the average idle time, and some domains are not searched. Balance is not always achieved, and idle CPUs go unused.
|
||||
|
||||
I have implemented an alternate mechanism that is invoked after the existing search in idle_balance() limits itself and finds nothing. I maintain a bitmap of overloaded CPUs, where a CPU sets its bit when its runnable CFS task count exceeds 1. The bitmap is sparse, with a limited number of significant bits per cacheline. This reduces cache contention when many threads concurrently set, clear, and visit elements. There is a bitmap per last-level cache. When a CPU becomes idle, it searches the bitmap to find the first overloaded CPU with a migratable task, and steals it. This simple stealing yields a higher CPU utilization than idle_balance() alone, because the search is cheap, costing 1 to 2 microseconds, so it may be called every time the CPU is about to go idle. Stealing does not offload the globally busiest queue, but it is much better than running nothing at all.
|
||||
|
||||
### Results
|
||||
|
||||
Stealing improves utilization with only a modest CPU overhead in scheduler code. In the following experiment, hackbench is run with varying numbers of groups (40 tasks per group), and the delta in /proc/schedstat is shown for each run, averaged per CPU, augmented with these non-standard stats:
|
||||
|
||||
* %find - percent of time spent in old and new functions that search for idle CPUs and tasks to steal and set the overloaded CPUs bitmap.
|
||||
* steal - number of times a task is stolen from another CPU. Elapsed time improves by 8 to 36%, costing at most 0.4% more find time.
|
||||
|
||||
|
||||
|
||||
![load balancing][1]
|
||||
|
||||
[Used with permission][2]
|
||||
|
||||
CPU busy utilization is close to 100% for the new kernel, as shown by the green curve in the following graph, versus the orange curve for the baseline kernel:
|
||||
|
||||
![][3]
|
||||
|
||||
Stealing improves Oracle database OLTP performance by up to 9% depending on load, and we have seen some nice improvements for mysql, pgsql, gcc, java, and networking. In general, stealing is most helpful for workloads with a high context switch rate.
|
||||
|
||||
### The code
|
||||
|
||||
As of this writing, this work is not yet upstream, but the latest patch series is at [https://lkml.org/lkml/2018/12/6/1253. ][4]If your kernel is built with CONFIG_SCHED_DEBUG=y, you can verify that it contains the stealing optimization using
|
||||
|
||||
```
|
||||
# grep -q STEAL /sys/kernel/debug/sched_features && echo Yes
|
||||
Yes
|
||||
```
|
||||
|
||||
If you try it, note that stealing is disabled for systems with more than 2 NUMA nodes, because hackbench regresses on such systems, as I explain in [https://lkml.org/lkml/2018/12/6/1250 .][5]However, I suspect this effect is specific to hackbench and that stealing will help other workloads on many-node systems. To try it, reboot with kernel parameter sched_steal_node_limit = 8 (or larger).
|
||||
|
||||
### Future work
|
||||
|
||||
After the basic stealing algorithm is pushed upstream, I am considering the following enhancements:
|
||||
|
||||
* If stealing within the last-level cache does not find a candidate, steal across LLC's and NUMA nodes.
|
||||
* Maintain a sparse bitmap to identify stealing candidates in the RT scheduling class. Currently pull_rt_task() searches all run queues.
|
||||
* Remove the core and socket levels from idle_balance(), as stealing handles those levels. Remove idle_balance() entirely when stealing across LLC is supported.
|
||||
* Maintain a bitmap to identify idle cores and idle CPUs, for push balancing.
|
||||
|
||||
|
||||
|
||||
_This article originally appeared at[Oracle Developers Blog][6]._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/blog/can-better-task-stealing-make-linux-faster
|
||||
|
||||
作者:[Oracle][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/linux-load-balancing.png?itok=2Uk1yALt (load balancing)
|
||||
[2]: /LICENSES/CATEGORY/USED-PERMISSION
|
||||
[3]: https://cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/b7a700fe-edc3-4ea0-876a-c91e1850b59b/Image/00c074f4282bcbaf0c10dd153c5dfa76/steal_graph.png
|
||||
[4]: https://lkml.org/lkml/2018/12/6/1253
|
||||
[5]: https://lkml.org/lkml/2018/12/6/1250
|
||||
[6]: https://blogs.oracle.com/linux/can-better-task-stealing-make-linux-faster
|
@ -1,200 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server)
|
||||
[#]: via: (https://www.linuxtechi.com/install-lemp-stack-fedora-30-server/)
|
||||
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
||||
|
||||
How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server
|
||||
======
|
||||
|
||||
In this article, we’ll be looking at how to install **LEMP** stack on Fedora 30 Server. LEMP Stands for:
|
||||
|
||||
* L -> Linux
|
||||
* E -> Nginx
|
||||
* M -> Maria DB
|
||||
* P -> PHP
|
||||
|
||||
|
||||
|
||||
I am assuming **[Fedora 30][1]** is already installed on your system.
|
||||
|
||||
![LEMP-Stack-Fedora30][2]
|
||||
|
||||
LEMP is a collection of powerful software setup that is installed on a Linux server to help in developing popular development platforms to build websites, LEMP is a variation of LAMP wherein instead of **Apache** , **EngineX (Nginx)** is used as well as **MariaDB** used in place of **MySQL**. This how-to guide is a collection of separate guides to install Nginx, Maria DB and PHP.
|
||||
|
||||
### Install Nginx, PHP 7.3 and PHP-FPM on Fedora 30 Server
|
||||
|
||||
Let’s take a look at how to install Nginx and PHP along with PHP FPM on Fedora 30 Server.
|
||||
|
||||
### Step 1) Switch to root user
|
||||
|
||||
First step in installing Nginx in your system is to switch to root user. Use the following command :
|
||||
|
||||
```
|
||||
root@linuxtechi ~]$ sudo -i
|
||||
[sudo] password for pkumar:
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
### Step 2) Install Nginx, PHP 7.3 and PHP FPM using dnf command
|
||||
|
||||
Install Nginx using the following dnf command:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install nginx php php-fpm php-common -y
|
||||
```
|
||||
|
||||
### Step 3) Install Additional PHP modules
|
||||
|
||||
The default installation of PHP only comes with the basic and the most needed modules installed. If you need additional modules like GD, XML support for PHP, command line interface Zend OPCache features etc, you can always choose your packages and install everything in one go. See the sample command below:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# sudo dnf install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-pecl-mongodb php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml -y
|
||||
```
|
||||
|
||||
### Step 4) Start & Enable Nginx and PHP-fpm Service
|
||||
|
||||
Start and enable Nginx service using the following command
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# systemctl start nginx && systemctl enable nginx
|
||||
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
Use the following command to start and enable PHP-FPM service
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# systemctl start php-fpm && systemctl enable php-fpm
|
||||
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
**Verify Nginx (Web Server) and PHP installation,**
|
||||
|
||||
**Note:** In case OS firewall is enabled and running on your Fedora 30 system, then allow 80 and 443 ports using beneath commands,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# firewall-cmd --permanent --add-service=http
|
||||
success
|
||||
[root@linuxtechi ~]#
|
||||
[root@linuxtechi ~]# firewall-cmd --permanent --add-service=https
|
||||
success
|
||||
[root@linuxtechi ~]# firewall-cmd --reload
|
||||
success
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
Open the web browser, type the following URL: http://<Your-Server-IP>
|
||||
|
||||
[![Test-Page-HTTP-Server-Fedora-30][3]][4]
|
||||
|
||||
Above screen confirms that NGINX is installed successfully.
|
||||
|
||||
Now let’s verify PHP installation, create a test php page(info.php) using the beneath command,
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/info.php
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
Type the following URL in the web browser,
|
||||
|
||||
http://<Your-Server-IP>/info.php
|
||||
|
||||
[![Php-info-page-fedora30][5]][6]
|
||||
|
||||
Above page confirms that PHP 7.3.5 has been installed successfully. Now let’s install MariaDB database server.
|
||||
|
||||
### Install MariaDB on Fedora 30
|
||||
|
||||
MariaDB is a great replacement for MySQL DB as it is works much similar to MySQL and also compatible with MySQL steps too. Let’s look at the steps to install MariaDB on Fedora 30 Server
|
||||
|
||||
### Step 1) Switch to Root User
|
||||
|
||||
First step in installing MariaDB in your system is to switch to root user or you can use a local user who has root privilege. Use the following command below:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# sudo -i
|
||||
[root@linuxtechi ~]#
|
||||
```
|
||||
|
||||
### Step 2) Install latest version of MariaDB (10.3) using dnf command
|
||||
|
||||
Use the following command to install MariaDB on Fedora 30 Server
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# dnf install mariadb-server -y
|
||||
```
|
||||
|
||||
### Step 3) Start and enable MariaDB Service
|
||||
|
||||
Once the mariadb is installed successfully in step 2), next step is to start the MariaDB service. Use the following command:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# systemctl start mariadb.service ; systemctl enable mariadb.service
|
||||
```
|
||||
|
||||
### Step 4) Secure MariaDB Installation
|
||||
|
||||
When we install MariaDB server, so by default there is no root password, also anonymous users are created in database. So, to secure MariaDB installation, run the beneath “mysql_secure_installation” command
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# mysql_secure_installation
|
||||
```
|
||||
|
||||
Next you will be prompted with some question, just answer the questions as shown below:
|
||||
|
||||
![Secure-MariaDB-Installation-Part1][7]
|
||||
|
||||
![Secure-MariaDB-Installation-Part2][8]
|
||||
|
||||
### Step 5) Test MariaDB Installation
|
||||
|
||||
Once you have installed, you can always test if MariaDB is successfully installed on the server. Use the following command:
|
||||
|
||||
```
|
||||
[root@linuxtechi ~]# mysql -u root -p
|
||||
Enter password:
|
||||
```
|
||||
|
||||
Next you will be prompted for a password. Enter the password same password that you have set during MariaDB secure installation, then you can see the MariaDB welcome screen.
|
||||
|
||||
```
|
||||
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
||||
Your MariaDB connection id is 17
|
||||
Server version: 10.3.12-MariaDB MariaDB Server
|
||||
|
||||
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
|
||||
|
||||
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
||||
|
||||
MariaDB [(none)]>
|
||||
```
|
||||
|
||||
And finally, we’ve completed everything to install LEMP (Linux, Nginx, MariaDB and PHP) on your server successfully. Please post all your comments and suggestions in the feedback section below and we’ll respond back at the earliest.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxtechi.com/install-lemp-stack-fedora-30-server/
|
||||
|
||||
作者:[Pradeep Kumar][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.linuxtechi.com/author/pradeep/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linuxtechi.com/fedora-30-workstation-installation-guide/
|
||||
[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/LEMP-Stack-Fedora30.jpg
|
||||
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Test-Page-HTTP-Server-Fedora-30-1024x732.jpg
|
||||
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Test-Page-HTTP-Server-Fedora-30.jpg
|
||||
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Php-info-page-fedora30-1024x732.jpg
|
||||
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Php-info-page-fedora30.jpg
|
||||
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Secure-MariaDB-Installation-Part1.jpg
|
||||
[8]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Secure-MariaDB-Installation-Part2.jpg
|
@ -1,121 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What you need to know to be a sysadmin)
|
||||
[#]: via: (https://opensource.com/article/19/7/be-a-sysadmin)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/kimvila)
|
||||
|
||||
What you need to know to be a sysadmin
|
||||
======
|
||||
Kickstart your sysadmin career by gaining these minimum competencies.
|
||||
![People work on a computer server with devices][1]
|
||||
|
||||
The system administrator of yesteryear jockeyed users and wrangled servers all day, in between mornings and evenings spent running hundreds of meters of hundreds of cables. This is still true today, with the added complexity of cloud computing, containers, and virtual machines.
|
||||
|
||||
Looking in from the outside, it can be difficult to pinpoint what exactly a sysadmin does, because they play at least a small role in so many places. Nobody goes into a career already knowing everything they need for a job, but everyone needs a strong foundation. If you're looking to start down the path of system administration, here's what you should be concentrating on in your personal or formal training.
|
||||
|
||||
### Bash
|
||||
|
||||
When you learn the Bash shell, you don't just learn the Bash shell. You learn a common interface to Linux systems, BSD, MacOS, and even Windows (under the right conditions). You learn the importance of syntax, so you can quickly adapt to systems like Cisco routers' command line or Microsoft's PowerShell, and eventually, you can even learn more powerful languages like Python or Go. And you also begin to think procedurally so you can analyze complex problems and break them down into individual components, which is key because _that's_ how systems, like the internet, or an organization's intranet, or a web server, or a backup solution, are designed.
|
||||
|
||||
But wait. There's more.
|
||||
|
||||
Knowing the Bash shell has become particularly important because of the recent trend toward DevOps and [containers][2]. Your career as a sysadmin may lead you into a world where infrastructure is treated like code, which usually means you'll have to know the basics of scripting, the structure of [YAML-based][3] configuration, and how to [interact][4] with [containers][5] (tiny Linux systems running inside a [sandboxed file][6]). Knowing Bash is the gateway to efficient management of the most exciting open source technology, so go get [Bourne Again][7].
|
||||
|
||||
#### Resources
|
||||
|
||||
There are many ways to get practice in the Bash shell.
|
||||
|
||||
Try a [portable Linux distribution][8]. You don't have to install Linux to use Linux, so grab a spare thumb drive and spend your evenings or weekends getting comfortable with a text-based interface.
|
||||
|
||||
There are several excellent [Bash articles][9] available here on opensource.com as well as [on Enable SysAdmin][10].
|
||||
|
||||
The problem with telling someone to practice with Bash is that to practice, you must have something to do. And until you know how to use Bash, you probably won't be able to think of anything to do. If that's your situation, go to Over The Wire and play [Bandit][11]. It's a game aimed at absolute beginners, with 34 levels of interactive basic hacking to get you comfortable with the Linux shell.
|
||||
|
||||
### Web server setup
|
||||
|
||||
Once you're comfortable with Bash, you should try setting up a web server. Not all sysadmins go around setting up web servers or even maintain web servers, but the skills you acquire while installing and starting the HTTP daemon, configuring Apache or Nginx, setting up the [correct permissions][12], and [configuring a firewall][13], are the same skills you need on a daily basis. After a little bit of effort, you may start to notice certain patterns in your labor. There are concepts you probably took for granted before trying to administer production-ready software and hardware, and you're no longer shielded from them in your fledgling role as an administrator. It might be frustrating at first because everyone likes to be good at everything they do, but that's actually a good thing. Let yourself be bad at new skills. That's how you learn.
|
||||
|
||||
And besides, the more you struggle through your first steps, the sweeter it is when you finally see that triumphant "it works!" default index.html.
|
||||
|
||||
#### Resources
|
||||
|
||||
David Both wrote an excellent article on [Apache web server][14] configuration. For extra credit, step through his follow-up article on how to [host multiple sites][15] on one machine.
|
||||
|
||||
### DHCP
|
||||
|
||||
The Dynamic Host Configuration Protocol (DHCP) is the system that assigns IP addresses to devices on a network. At home, the modem or router your ISP (internet service provider) supports probably has an embedded DHCP server in it, so it's likely out of your purview. If you've ever logged into your home router to adjust the IP address range or set up a static address for some of your network devices, then you're at least somewhat familiar with the concept. You may understand that devices on a network are assigned the equivalent of phone numbers in the form of IP addresses, and you may realize that computers communicate with one another by broadcasting messages addressed to a specific IP address. Message headers are read by routers along the path, each of which works to direct the message to the next most logical router along the path toward its ultimate goal.
|
||||
|
||||
Even if you understand these concepts, the inevitable escalation of basic familiarity with DHCP is to set up a DHCP server. Installing and configuring your own DHCP server provides you the opportunity to introduce DHCP collisions on your home network (try to avoid that, if you can, as it will definitely kill your network until it's resolved), control the distribution of addresses, create subnets, and monitor connections and lease times.
|
||||
|
||||
More importantly, setting up DHCP and experimenting with different configurations helps you understand inter-networking. You understand how networks represent "partitions" in data transference and what steps you have to take to pass information from one to the other. That's vital for a sysadmin to know because the network is easily one of the most important aspects of the job.
|
||||
|
||||
#### Resources
|
||||
|
||||
Before running your own DHCP server, ensure that the DHCP server in your home router (if you have one) is inactive. Once you have it up and running, read Archit Modi's [guide to network commands][16] for tips on how to explore your network.
|
||||
|
||||
### Network cables
|
||||
|
||||
It might sound mundane, but getting familiar with how network cables work not only makes for a really fun weekend but also gives you a whole new understanding of how data gets across the wires. The best way to learn is to go to your local hobby shop and purchase a Cat 5 cutter and crimper and a few Cat 5 terminators. Then head home, grab a spare Ethernet cable, and cut the terminators off. Spend whatever amount of time it takes to get that cable back in commission.
|
||||
|
||||
Once you have solved that puzzle, do it again, this time creating a working [crossover cable][17].
|
||||
|
||||
You should also start obsessing _now_ about cable management. If you're not naturally inclined to run cables neatly along the floor molding or the edges of a desk or to bind cables together to keep them orderly, then make it a goal to permanently condition yourself with a phobia of messy cables. You won't understand why this is necessary at first, but the first time you walk into a server room, you will immediately know.
|
||||
|
||||
### Ansible
|
||||
|
||||
[Ansible][18] is configuration management software, and it's a bit of a bridge between sysadmin and DevOps. Sysadmins use Ansible to configure fresh installs of an operating system and to maintain specific states on machines. DevOps uses Ansible to reduce time and effort spent on tooling so that more time and effort gets spent on developing. You should learn Ansible as part of your sysadmin training, with an eye toward the practices of DevOps, because most of what DevOps is pioneering now will end up as part of your workflow in the system administration of the future.
|
||||
|
||||
The good thing about Ansible is that you can start using it now. It's cross-platform, and it scales both up and down. Ansible may be overkill for a single-user computer, but then again, Ansible could change the way you spin up virtual machines, or it could help you synchronize the states of all the computers in your home or [home lab][19].
|
||||
|
||||
#### Resources
|
||||
|
||||
Read "[How to manage your workstation configuration with Ansible][20]" by Jay LaCroix for the quintessential introduction to get started with Ansible on a casual basis.
|
||||
|
||||
### Break stuff
|
||||
|
||||
Problems arise on computers because of user error, buggy software, administrator (that's you!) error, and any number of other factors. There's no way to predict what's going to fail or why, so part of your personal sysadmin training regime should be to poke at the systems you set up until they fail. The worse you are to your own lab infrastructure, the more likely you are to find weak points. And the more often you repair those weak spots, the more confident you become in your problem-solving skills.
|
||||
|
||||
Aside from the rigors of setting up all the usual software and hardware, your primary job as a sysadmin is to find solutions. There will be times when you encounter a problem outside your job description, and it may not even be possible for you to fix it, but it'll be up to you to find a workaround.
|
||||
|
||||
The more you break stuff now and work to fix it, the better prepared you will be to work as a sysadmin.
|
||||
|
||||
* * *
|
||||
|
||||
Are you a working sysadmin? Are there tasks you wish you'd prepared better for? Add them in the comments below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/7/be-a-sysadmin
|
||||
|
||||
作者:[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/marcobravohttps://opensource.com/users/kimvila
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices)
|
||||
[2]: https://opensource.com/article/19/6/kubernetes-dump-truck
|
||||
[3]: https://www.redhat.com/sysadmin/yaml-tips
|
||||
[4]: https://opensource.com/article/19/6/how-ssh-running-container
|
||||
[5]: https://opensource.com/resources/what-are-linux-containers
|
||||
[6]: https://opensource.com/article/18/11/behind-scenes-linux-containers
|
||||
[7]: https://opensource.com/article/18/7/admin-guide-bash
|
||||
[8]: https://opensource.com/article/19/6/linux-distros-to-try
|
||||
[9]: https://opensource.com/tags/bash
|
||||
[10]: https://www.redhat.com/sysadmin/managing-files-linux-terminal
|
||||
[11]: http://overthewire.org/wargames/bandit
|
||||
[12]: https://opensource.com/article/19/6/understanding-linux-permissions
|
||||
[13]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd
|
||||
[14]: https://opensource.com/article/18/2/how-configure-apache-web-server
|
||||
[15]: https://opensource.com/article/18/3/configuring-multiple-web-sites-apache
|
||||
[16]: https://opensource.com/article/18/7/sysadmin-guide-networking-commands
|
||||
[17]: https://en.wikipedia.org/wiki/Ethernet_crossover_cable
|
||||
[18]: https://opensource.com/sitewide-search?search_api_views_fulltext=ansible
|
||||
[19]: https://opensource.com/article/19/6/create-centos-homelab-hour
|
||||
[20]: https://opensource.com/article/18/3/manage-workstation-ansible
|
@ -1,222 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (7 Java tips for new developers)
|
||||
[#]: via: (https://opensource.com/article/19/10/java-basics)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
7 Java tips for new developers
|
||||
======
|
||||
If you're just getting started with Java programming, here are seven
|
||||
basics you need to know.
|
||||
![Coffee and laptop][1]
|
||||
|
||||
Java is a versatile programming language used, in some way, in nearly every industry that touches a computer. Java's greatest power is that it runs in a Java Virtual Machine (JVM), a layer that translates Java code into bytecode compatible with your operating system. As long as a JVM exists for your operating system, whether that OS is on a server (or [serverless][2], for that matter), desktop, laptop, mobile device, or embedded device, then a Java application can run on it.
|
||||
|
||||
This makes Java a popular language for both programmers and users. Programmers know that they only have to write one version of their software to end up with an application that runs on any platform, and users know that an application will run on their computer regardless of what operating system they use.
|
||||
|
||||
Many languages and frameworks are cross-platform, but none deliver the same level of abstraction. With Java, you target the JVM, not the OS. For programmers, that's the path of least resistance when faced with several programming challenges, but it's only useful if you know how to program Java. If you're just getting started with Java programming, here are seven basic tips you need to know.
|
||||
|
||||
But first, if you're not sure whether you have Java installed, you can find out in a terminal (such as [Bash][3] or [PowerShell][4]) by running:
|
||||
|
||||
|
||||
```
|
||||
$ java --version
|
||||
openjdk 12.0.2 2019-07-16
|
||||
OpenJDK Runtime Environment 19.3 (build 12.0.2+9)
|
||||
OpenJDK 64-Bit Server VM 19.3 (build 12.0.2+9, mixed mode, sharing)
|
||||
```
|
||||
|
||||
If you get an error or nothing in return, then you should install the [Java Development Kit][5] (JDK) to get started with Java development. Or install a Java Runtime Environment ****(JRE) if you just need to run Java applications.
|
||||
|
||||
### 1\. Java packages
|
||||
|
||||
In Java, related classes are grouped into a _package_. The basic Java libraries you get when you download the JDK are grouped into packages starting with **java** or **javax**. Packages serve a similar function as folders on your computer: they provide structure and definition for related elements (in programming terminology, a _namespace_). Additional packages can be obtained from independent coders, open source projects, and commercial vendors, just as libraries can be obtained for any programming language.
|
||||
|
||||
When you write a Java program, you should declare a package name at the top of your code. If you're just writing a simple application to get started with Java, your package name can be as simple as the name of your project. If you're using a Java integrated development environment (IDE), like [Eclipse][6], it generates a sane package name for you when you start a new project.
|
||||
|
||||
|
||||
```
|
||||
package helloworld;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* An application written in Java.
|
||||
*/
|
||||
```
|
||||
|
||||
Otherwise, you can determine the name of your package by looking at its path in relation to the broad definition of your project. For instance, if you're writing a set of classes to assist in game development and the collection is called **jgamer**, then you might have several unique classes within it.
|
||||
|
||||
|
||||
```
|
||||
package jgamer.avatar;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* An imaginary game library.
|
||||
*/
|
||||
```
|
||||
|
||||
The top level of your package is **jgamer**, and each package inside it is a descendant, such as **jgamer.avatar** and **jgamer.score** and so on. In your filesystem, the structure reflects this, with **jgamer** being the top directory containing the files **avatar.java** and **score.java**.
|
||||
|
||||
### 2\. Java imports
|
||||
|
||||
The most fun you'll ever have as a polyglot programmer is trying to keep track of whether you **include**, **import**, **use**, **require**, or **some other term** a library in whatever programming language you're writing in. Java, for the record, uses the **import** keyword when importing libraries needed for your code.
|
||||
|
||||
|
||||
```
|
||||
package helloworld;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* A GUI hello world.
|
||||
*/
|
||||
```
|
||||
|
||||
Imports work based on an environment's Java path. If Java doesn't know where Java libraries are stored on a system, then an import cannot be successful. As long as a library is stored in a system's Java path, then an import can succeed, and a library can be used to build and run a Java application.
|
||||
|
||||
If a library is not expected to be in the Java path (because, for instance, you are writing the library yourself), then the library can be bundled with your application (license permitting) so that the import works as expected.
|
||||
|
||||
### 3\. Java classes
|
||||
|
||||
A Java class is declared with the keywords **public class** along with a unique class name mirroring its file name. For example, in a file **Hello.java** in project **helloworld**:
|
||||
|
||||
|
||||
```
|
||||
package helloworld;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
/**
|
||||
* @author seth
|
||||
* A GUI hello world.
|
||||
*/
|
||||
|
||||
public class Hello {
|
||||
// this is an empty class
|
||||
}
|
||||
```
|
||||
|
||||
You can declare variables and functions inside a class. In Java, variables within a class are called _fields_.
|
||||
|
||||
### 4\. Java methods
|
||||
|
||||
Java methods are, essentially, functions within an object. They are defined as being **public** (meaning they can be accessed by any other class) or **private** (limiting their use) based on the expected type of returned data, such as **void**, **int**, **float**, and so on.
|
||||
|
||||
|
||||
```
|
||||
public void helloPrompt([ActionEvent][7] event) {
|
||||
[String][8] salutation = "Hello %s";
|
||||
|
||||
string helloMessage = "World";
|
||||
message = [String][8].format(salutation, helloMessage);
|
||||
[JOptionPane][9].showMessageDialog(this, message);
|
||||
}
|
||||
|
||||
private int someNumber (x) {
|
||||
return x*2;
|
||||
}
|
||||
```
|
||||
|
||||
When calling a method directly, it is referenced by its class and method name. For instance, **Hello.someNumber** refers to the **someNumber** method in the **Hello** class.
|
||||
|
||||
### 5\. Static
|
||||
|
||||
The **static** keyword in Java makes a member in your code accessible independently of the object that contains it.
|
||||
|
||||
In object-oriented programming, you write code that serves as a template for "objects" that get spawned as the application runs. You don't code a specific window, for instance, but an _instance_ of a window based upon a window class in Java (and modified by your code). Since nothing you are coding "exists" until the application generates an instance of it, most methods and variables (and even nested classes) cannot be used until the object they depend upon has been created.
|
||||
|
||||
However, sometimes you need to access or use data in an object before it is created by the application (for example, an application can't generate a red ball without first knowing that the ball is meant to be red). For those cases, there's the **static** keyword.
|
||||
|
||||
### 6\. Try and catch
|
||||
|
||||
Java is excellent at catching errors, but it can only recover gracefully if you tell it what to do. The cascading hierarchy of attempting to perform an action in Java starts with **try**, falls back to **catch**, and ends with **finally**. Should the **try** clause fail, then **catch** is invoked, and in the end, there's always **finally** to perform some sensible action regardless of the results. Here's an example:
|
||||
|
||||
|
||||
```
|
||||
try {
|
||||
cmd = parser.parse(opt, args);
|
||||
|
||||
if(cmd.hasOption("help")) {
|
||||
HelpFormatter helper = new HelpFormatter();
|
||||
helper.printHelp("Hello <options>", opt);
|
||||
[System][10].exit(0);
|
||||
}
|
||||
else {
|
||||
if(cmd.hasOption("shell") || cmd.hasOption("s")) {
|
||||
[String][8] target = cmd.getOptionValue("tgt");
|
||||
} // else
|
||||
} // fi
|
||||
} catch ([ParseException][11] err) {
|
||||
[System][10].out.println(err);
|
||||
[System][10].exit(1);
|
||||
} //catch
|
||||
finally {
|
||||
new Hello().helloWorld(opt);
|
||||
} //finally
|
||||
} //try
|
||||
```
|
||||
|
||||
It's a robust system that attempts to avoid irrecoverable errors or, at least, to provide you with the option to give useful feedback to the user. Use it often, and your users will thank you!
|
||||
|
||||
### 7\. Running a Java application
|
||||
|
||||
Java files, usually ending in **.java**, theoretically can be run with the **java** command. If an application is complex, however, whether running a single file results in anything meaningful is another question.
|
||||
|
||||
To run a **.java** file directly:
|
||||
|
||||
|
||||
```
|
||||
`$ java ./Hello.java`
|
||||
```
|
||||
|
||||
Usually, Java applications are distributed as Java Archives (JAR) files, ending in **.jar**. A JAR file contains a manifest file specifying the main class, some metadata about the project structure, and all the parts of your code required to run the application.
|
||||
|
||||
To run a JAR file, you may be able to double-click its icon (depending on how you have your OS set up), or you can launch it from a terminal:
|
||||
|
||||
|
||||
```
|
||||
`$ java -jar ./Hello.jar`
|
||||
```
|
||||
|
||||
### Java for everyone
|
||||
|
||||
Java is a powerful language, and thanks to the [OpenJDK][12] project and other initiatives, it's an open specification that allows projects like [IcedTea][13], [Dalvik][14], and [Kotlin][15] to thrive. Learning Java is a great way to prepare to work in a wide variety of industries, and what's more, there are plenty of [great reasons to use it][16].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/10/java-basics
|
||||
|
||||
作者:[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/coffee_cafe_brew_laptop_desktop.jpg?itok=G-n1o1-o (Coffee and laptop)
|
||||
[2]: https://www.redhat.com/en/resources/building-microservices-eap-7-reference-architecture
|
||||
[3]: https://www.gnu.org/software/bash/
|
||||
[4]: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6
|
||||
[5]: http://openjdk.java.net/
|
||||
[6]: http://www.eclipse.org/
|
||||
[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionevent
|
||||
[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+joptionpane
|
||||
[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+parseexception
|
||||
[12]: https://openjdk.java.net/
|
||||
[13]: https://icedtea.classpath.org/wiki/Main_Page
|
||||
[14]: https://source.android.com/devices/tech/dalvik/
|
||||
[15]: https://kotlinlang.org/
|
||||
[16]: https://opensource.com/article/19/9/why-i-use-java
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (heguangzhi)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wenwensnow)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user